Spaces:
Runtime error
Runtime error
Commit
·
2395e91
1
Parent(s):
5c71b65
Update app.py
Browse files
app.py
CHANGED
@@ -120,9 +120,10 @@ trainer = Trainer()
|
|
120 |
# y_hat = model(wav_tensor)
|
121 |
|
122 |
def transcribe(audio):
|
123 |
-
resmaple = torchaudio.transforms.Resample(8000, 16000)
|
124 |
-
wav_tensor,_ = torchaudio.load(audio,map_location=torch.device('cpu'))
|
125 |
-
wav_tensor =
|
|
|
126 |
#model = model.to('cuda')
|
127 |
y_hat = model.predict(wav_tensor)
|
128 |
labels = {0:"branch_address : enquiry about bank branch location",
|
@@ -143,6 +144,6 @@ def transcribe(audio):
|
|
143 |
|
144 |
|
145 |
get_intent = gr.Interface(fn = transcribe,
|
146 |
-
inputs=gr.Audio(source="microphone"
|
147 |
outputs="text").launch()
|
148 |
|
|
|
120 |
# y_hat = model(wav_tensor)
|
121 |
|
122 |
def transcribe(audio):
|
123 |
+
#resmaple = torchaudio.transforms.Resample(8000, 16000)
|
124 |
+
#wav_tensor,_ = torchaudio.load(audio,map_location=torch.device('cpu'))
|
125 |
+
sr, wav_tensor = audio
|
126 |
+
#wav_tensor = resmaple(wav_tensor)
|
127 |
#model = model.to('cuda')
|
128 |
y_hat = model.predict(wav_tensor)
|
129 |
labels = {0:"branch_address : enquiry about bank branch location",
|
|
|
144 |
|
145 |
|
146 |
get_intent = gr.Interface(fn = transcribe,
|
147 |
+
inputs=gr.Audio(source="microphone"),
|
148 |
outputs="text").launch()
|
149 |
|