akhaliq HF Staff commited on
Commit
c15a5ad
·
1 Parent(s): 3ba95e4

Fix prediction payload serialization style for Gradio Server API

Browse files
Files changed (1) hide show
  1. index.html +15 -15
index.html CHANGED
@@ -808,21 +808,21 @@
808
 
809
  processingStatus.textContent = "Running Vision Model (duration-locked)...";
810
 
811
- // Execute predictions using robust positional array syntax matching app.py signature
812
- const result = await clientInstance.predict("/run_inference", [
813
- selectedMediaType,
814
- imageFile,
815
- videoFile,
816
- taskType,
817
- category,
818
- modelMode,
819
- temp,
820
- topp,
821
- topk,
822
- shortSize,
823
- null,
824
- maxVideoFrames
825
- ]);
826
 
827
  console.log("Inference complete. API outputs:", result);
828
 
 
808
 
809
  processingStatus.textContent = "Running Vision Model (duration-locked)...";
810
 
811
+ // Execute predictions using named parameters object matching app.py signature
812
+ const result = await clientInstance.predict("/run_inference", {
813
+ input_type: selectedMediaType,
814
+ image_file: imageFile,
815
+ video_file: videoFile,
816
+ task_type: taskType,
817
+ category: category,
818
+ model_mode: modelMode,
819
+ temp: temp,
820
+ top_p: topp,
821
+ top_k: topk,
822
+ short_size: shortSize,
823
+ question_override: null,
824
+ max_video_frames: maxVideoFrames
825
+ });
826
 
827
  console.log("Inference complete. API outputs:", result);
828