Spaces:
Runtime error
Runtime error
Pavankalyan
commited on
Commit
·
b7a04f7
1
Parent(s):
846fa92
Update app.py
Browse files
app.py
CHANGED
@@ -120,10 +120,10 @@ trainer = Trainer()
|
|
120 |
# y_hat = model(wav_tensor)
|
121 |
|
122 |
def transcribe(audio):
|
123 |
-
|
124 |
-
|
125 |
-
sr, wav_tensor = audio
|
126 |
-
|
127 |
#model = model.to('cuda')
|
128 |
y_hat = model.predict(wav_tensor)
|
129 |
labels = {0:"branch_address : enquiry about bank branch location",
|
@@ -144,6 +144,6 @@ def transcribe(audio):
|
|
144 |
|
145 |
|
146 |
get_intent = gr.Interface(fn = transcribe,
|
147 |
-
inputs=gr.Audio(source="microphone"),
|
148 |
outputs="text").launch()
|
149 |
|
|
|
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", type="filepath"),
|
148 |
outputs="text").launch()
|
149 |
|