Spaces:
Runtime error
Runtime error
jasper9w
commited on
Commit
·
d03259c
1
Parent(s):
8d62595
init
Browse files- app.py +13 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
pipe = pipeline(model="openai/whisper-tiny")
|
6 |
+
|
7 |
+
def asr(test_file):
|
8 |
+
return pipe(test_file, max_new_tokens=100)
|
9 |
+
|
10 |
+
def gradio_asr(test_file):
|
11 |
+
return asr(test_file.name)
|
12 |
+
|
13 |
+
gr.Interface(fn=gradio_asr, inputs='file', outputs='text').launch(share=True)
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
soundfile
|
2 |
+
torch
|
3 |
+
numpy
|
4 |
+
transformers
|