Spaces:
Running
Running
first commit
Browse files- .gitignore +2 -0
- app.py +19 -0
- requirements.txt +3 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from faster_whisper import WhisperModel
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
# Load model (run on CUDA for GPU)
|
| 5 |
+
model = WhisperModel("medium", device="cuda", compute_type="float16")
|
| 6 |
+
|
| 7 |
+
def transcribe(audio_file):
|
| 8 |
+
segments, info = model.transcribe(audio_file, beam_size=5)
|
| 9 |
+
transcription = " ".join([seg.text for seg in segments])
|
| 10 |
+
return transcription
|
| 11 |
+
|
| 12 |
+
iface = gr.Interface(
|
| 13 |
+
fn=transcribe,
|
| 14 |
+
inputs=gr.Audio(type="filepath"),
|
| 15 |
+
outputs="text",
|
| 16 |
+
title="Faster Whisper Medium Transcriber"
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
iface.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
faster-whisper==1.1.1
|
| 2 |
+
gradio==5.32.1
|
| 3 |
+
torch==2.7.0
|