Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Define the pipeline for speech recognition with the NeMo Canary model
|
5 |
+
pipe = pipeline(
|
6 |
+
task="automatic-speech-recognition",
|
7 |
+
model="nvidia/canary-1b"
|
8 |
+
)
|
9 |
+
|
10 |
+
# Create a Gradio interface from the pipeline
|
11 |
+
interface = gr.Interface.from_pipeline(pipe, inputs="microphone", outputs="text")
|
12 |
+
|
13 |
+
# Launch the interface
|
14 |
+
interface.launch()
|