Obiang commited on
Commit
1d969f4
·
1 Parent(s): 2e77301

Use gr.File for JSON API to fix file path handling

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -432,10 +432,10 @@ with gr.Blocks(css=custom_css, title="Pro-TeVA Tone Recognition") as demo:
432
  show_label=True
433
  )
434
 
435
- # JSON API interface
436
  json_api = gr.Interface(
437
  fn=predict_tone_json,
438
- inputs=gr.Audio(type="filepath", label="Audio File"),
439
  outputs=gr.JSON(label="Prediction Result"),
440
  api_name="predict_json",
441
  title="Pro-TeVA JSON API",
 
432
  show_label=True
433
  )
434
 
435
+ # JSON API interface - use gr.File to properly handle file paths from API
436
  json_api = gr.Interface(
437
  fn=predict_tone_json,
438
+ inputs=gr.File(label="Audio File", file_types=["audio"]),
439
  outputs=gr.JSON(label="Prediction Result"),
440
  api_name="predict_json",
441
  title="Pro-TeVA JSON API",