Delete app.py
Browse files
app.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
import numpy as np
|
| 4 |
-
import soundfile as sf
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
pipe1 = pipeline("automatic-speech-recognition", model="openai/whisper-base")
|
| 8 |
-
|
| 9 |
-
def transcribe_audio(audio):
|
| 10 |
-
audio_data, _ = sf.read(audio)
|
| 11 |
-
audio_array = np.array(audio_data)
|
| 12 |
-
|
| 13 |
-
transcription = pipe1(audio_array)
|
| 14 |
-
transcription_text = transcription['text']
|
| 15 |
-
|
| 16 |
-
return transcription_text
|
| 17 |
-
|
| 18 |
-
demo = gr.Interface(fn=transcribe_audio, inputs=gr.Audio(), outputs="text")
|
| 19 |
-
demo.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|