Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,15 +3,14 @@ import gradio as gr
|
|
| 3 |
def process_audio(audio_file):
|
| 4 |
# Load the model
|
| 5 |
asr_model = gr.load("models/rngzhi/cs3264-project")
|
| 6 |
-
|
| 7 |
result = asr_model(audio_file)
|
| 8 |
-
|
| 9 |
return result.text
|
| 10 |
|
| 11 |
-
|
|
|
|
| 12 |
fn=process_audio,
|
| 13 |
-
inputs=gr.inputs.Audio(source="
|
| 14 |
-
outputs="text"
|
| 15 |
)
|
| 16 |
|
| 17 |
# Launch the interface
|
|
|
|
| 3 |
def process_audio(audio_file):
|
| 4 |
# Load the model
|
| 5 |
asr_model = gr.load("models/rngzhi/cs3264-project")
|
|
|
|
| 6 |
result = asr_model(audio_file)
|
|
|
|
| 7 |
return result.text
|
| 8 |
|
| 9 |
+
|
| 10 |
+
file_transcribe = gr.Interface(
|
| 11 |
fn=process_audio,
|
| 12 |
+
inputs=gr.inputs.Audio(source="upload", type="filepath", optional=True, label="Audio file"),
|
| 13 |
+
outputs="text",
|
| 14 |
)
|
| 15 |
|
| 16 |
# Launch the interface
|