Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- README.md +6 -6
- app.py +18 -0
- packages.txt +1 -0
- requirements.txt +3 -0
README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces
|
|
|
|
| 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
|