Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ DEFAULT_MODEL_ID = "FusionRAG/msp-audio-wav2vec2-lrs2"
|
|
| 6 |
DEVICE = 0 if torch.cuda.is_available() else -1
|
| 7 |
|
| 8 |
|
| 9 |
-
|
| 10 |
task="automatic-speech-recognition",
|
| 11 |
model=DEFAULT_MODEL_ID,
|
| 12 |
device=DEVICE,
|
|
@@ -17,8 +17,8 @@ asr_pipe = pipeline(
|
|
| 17 |
def transcribe(audio):
|
| 18 |
if audio is None:
|
| 19 |
return ""
|
| 20 |
-
result =
|
| 21 |
-
return result
|
| 22 |
|
| 23 |
|
| 24 |
demo = gr.Interface(
|
|
|
|
| 6 |
DEVICE = 0 if torch.cuda.is_available() else -1
|
| 7 |
|
| 8 |
|
| 9 |
+
pipe = pipeline(
|
| 10 |
task="automatic-speech-recognition",
|
| 11 |
model=DEFAULT_MODEL_ID,
|
| 12 |
device=DEVICE,
|
|
|
|
| 17 |
def transcribe(audio):
|
| 18 |
if audio is None:
|
| 19 |
return ""
|
| 20 |
+
result = pipe(audio)
|
| 21 |
+
return result["text"]
|
| 22 |
|
| 23 |
|
| 24 |
demo = gr.Interface(
|