st192011 commited on
Commit
601bbed
·
verified ·
1 Parent(s): 22f738f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -6,6 +6,7 @@ import random
6
  import librosa
7
  import soundfile as sf
8
  import pandas as pd
 
9
  from transformers import pipeline
10
  from datasets import load_dataset, Audio
11
  from gradio_client import Client
@@ -98,11 +99,11 @@ def process_audio_step_2(audio_path, norm_whisper):
98
  # Connect to the private API
99
  client = Client(PRIVATE_BACKEND_URL, token=HF_TOKEN)
100
 
101
- # Call the endpoint 'predict_dsr' defined in the Private Space
102
- # We send the audio file and the normalized whisper transcript
103
  prediction = client.predict(
104
- audio_path,
105
- norm_whisper,
106
  api_name="/predict_dsr"
107
  )
108
  return prediction
 
6
  import librosa
7
  import soundfile as sf
8
  import pandas as pd
9
+ from gradio_client import Client, handle_file
10
  from transformers import pipeline
11
  from datasets import load_dataset, Audio
12
  from gradio_client import Client
 
99
  # Connect to the private API
100
  client = Client(PRIVATE_BACKEND_URL, token=HF_TOKEN)
101
 
102
+ # FIX: Wrap audio_path with handle_file()
103
+ # This sends the metadata required by Pydantic ('gradio.FileData')
104
  prediction = client.predict(
105
+ audio_path=handle_file(audio_path),
106
+ whisper_norm=norm_whisper,
107
  api_name="/predict_dsr"
108
  )
109
  return prediction