Hemg commited on
Commit
731a070
Β·
verified Β·
1 Parent(s): 466c69c

Upload 4 files

Browse files
Files changed (4) hide show
  1. README.md +6 -6
  2. app.py +18 -0
  3. packages.txt +1 -0
  4. requirements.txt +3 -0
README.md CHANGED
@@ -1,12 +1,12 @@
1
  ---
2
- title: Nepali ASR
3
- emoji: πŸ“ˆ
4
- colorFrom: green
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 4.27.0
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: AutomaticSpeechRecognition
3
+ emoji: πŸ‘€
4
+ colorFrom: indigo
5
+ colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 2.9.1
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ p = pipeline("automatic-speech-recognition")
5
+
6
+ def transcribe(audio, state=""):
7
+ """ Speech to text function using pipeline"""
8
+ text = p(audio)["text"]
9
+ state += text + " "
10
+ return state, state
11
+
12
+ gr.Interface(fn=transcribe,
13
+ inputs=[gr.inputs.Audio(source="upload", type="filepath", label="Record/ Drop audio"), "state"],
14
+ outputs=["textbox", "state"],
15
+ title="Automatic Speech Recognition test",
16
+ description="Enable the recognition spoken language into text by computers.",
17
+ theme="huggingface",
18
+ live=True).launch()
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ ffmpeg
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ torch
2
+ transformers
3
+ gradio