YuhangDeng123 commited on
Commit
cad4f8a
β€’
1 Parent(s): 60a0946

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +6 -4
  2. app.py +23 -0
  3. requirements.txt +9 -0
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
- title: Whisper Online
3
- emoji: πŸš€
4
- colorFrom: gray
5
- colorTo: indigo
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