Spaces:
Sleeping
Sleeping
Commit
Β·
f1266ab
1
Parent(s):
6b48de9
first commit, set up all
Browse files- .gitignore +2 -0
- README.md +5 -4
- app.py +19 -0
- requirements.txt +1 -0
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.env
|
2 |
+
.space_venv/
|
README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
|
|
7 |
sdk_version: 5.0.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
|
|
1 |
---
|
2 |
+
title: ASR Gradio
|
3 |
+
emoji: π
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
python_version: 3.12
|
8 |
sdk_version: 5.0.2
|
9 |
app_file: app.py
|
10 |
pinned: false
|
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
5 |
+
|
6 |
+
|
7 |
+
def process_input(audio):
|
8 |
+
transcription = pipe(audio)["text"]
|
9 |
+
return transcription
|
10 |
+
|
11 |
+
|
12 |
+
interface = gr.Interface(
|
13 |
+
fn=process_input,
|
14 |
+
inputs=gr.Audio(sources=["microphone", "upload"], type="filepath"),
|
15 |
+
outputs="text",
|
16 |
+
title="testing for data aug",
|
17 |
+
)
|
18 |
+
|
19 |
+
interface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
transformers
|