Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import torch
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
model_id = "openai/whisper-
|
| 6 |
pipe = pipeline("automatic-speech-recognition", model=model_id)
|
| 7 |
|
| 8 |
title = "Automatic Speech Recognition"
|
|
@@ -12,13 +12,10 @@ description = """
|
|
| 12 |
def transcribe_speech(filepath):
|
| 13 |
output = pipe(
|
| 14 |
filepath,
|
| 15 |
-
max_new_tokens=256,
|
| 16 |
generate_kwargs={
|
| 17 |
"task": "transcribe",
|
| 18 |
"language": "english", # Set to English
|
| 19 |
},
|
| 20 |
-
chunk_length_s=30,
|
| 21 |
-
batch_size=8,
|
| 22 |
)
|
| 23 |
return output["text"]
|
| 24 |
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
+
model_id = "openai/whisper-large" # Using the model you provided
|
| 6 |
pipe = pipeline("automatic-speech-recognition", model=model_id)
|
| 7 |
|
| 8 |
title = "Automatic Speech Recognition"
|
|
|
|
| 12 |
def transcribe_speech(filepath):
|
| 13 |
output = pipe(
|
| 14 |
filepath,
|
|
|
|
| 15 |
generate_kwargs={
|
| 16 |
"task": "transcribe",
|
| 17 |
"language": "english", # Set to English
|
| 18 |
},
|
|
|
|
|
|
|
| 19 |
)
|
| 20 |
return output["text"]
|
| 21 |
|