Spaces:
Runtime error
Runtime error
YuhangDeng123
commited on
Commit
β’
cad4f8a
1
Parent(s):
60a0946
Upload 3 files
Browse files- README.md +6 -4
- app.py +23 -0
- requirements.txt +9 -0
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title: Whisper
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.12.0
|
8 |
app_file: app.py
|
@@ -11,3 +11,5 @@ license: apache-2.0
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
1 |
---
|
2 |
+
title: Whisper-online
|
3 |
+
emoji: π
|
4 |
+
colorFrom: red
|
5 |
+
colorTo: green
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.12.0
|
8 |
app_file: app.py
|
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
14 |
+
|
15 |
+
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
import time
|
4 |
+
|
5 |
+
pipe= pipeline(model="YuhangDeng123/whisper-small-hi")
|
6 |
+
|
7 |
+
def transcribe(audio, state=""):
|
8 |
+
text = pipe(audio)["text"]
|
9 |
+
state += text + " "
|
10 |
+
return state, state
|
11 |
+
|
12 |
+
gr.Interface(
|
13 |
+
title="Whisper-Small Online Cantonese Recognition",
|
14 |
+
fn=transcribe,
|
15 |
+
inputs=[
|
16 |
+
gr.Audio(source="microphone", type="filepath", streaming=True),
|
17 |
+
"state"
|
18 |
+
],
|
19 |
+
outputs=[
|
20 |
+
"textbox",
|
21 |
+
"state"
|
22 |
+
],
|
23 |
+
live=True).launch()
|
requirements.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
torch
|
4 |
+
git+https://github.com/pytube/pytube
|
5 |
+
datasets
|
6 |
+
torchaudio
|
7 |
+
librosa
|
8 |
+
jiwer
|
9 |
+
moviepy
|