Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,12 @@
|
|
| 1 |
import tensoflow as tf
|
| 2 |
print(tf. __version__)
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import tensoflow as tf
|
| 2 |
print(tf. __version__)
|
| 3 |
+
import gradio as gr
|
| 4 |
+
from transformers import pipeline
|
| 5 |
+
def transcribe(audio):
|
| 6 |
+
text = pipe(audio)["text"]
|
| 7 |
+
return text
|
| 8 |
+
model_variant_name="Daya7624/Fine_tune_large_v2_adam_8bit"
|
| 9 |
+
pipe = pipeline(model=model_variant_name, task="automatic-speech-recognition")
|
| 10 |
+
demo = gr.Interface(fn=transcribe, inputs= gr.inputs.Audio(label="Upload .wav file", type="filepath"), outputs="text")
|
| 11 |
+
# demo = gr.Interface(fn=transcribe, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
| 12 |
+
demo.launch(debug=False)
|