Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
import whisper
|
2 |
-
import gradio as gr
|
3 |
-
import time
|
4 |
-
import os
|
5 |
-
|
6 |
-
'''model = whisper.load_model("base")
|
7 |
-
print(model.device)'''
|
8 |
-
|
9 |
-
|
10 |
-
def speechtotext(tmp_filename, uploaded):
|
11 |
-
source = uploaded if uploaded is not None else tmp_filename
|
12 |
-
audio = whisper.load_audio(source)
|
13 |
-
model = whisper.load_model("small")
|
14 |
-
print(model.device)
|
15 |
-
result2 = model.transcribe(audio)
|
16 |
-
# result = os.system("whisper" + source + " --language Hindi " + " --task translate ")
|
17 |
-
return f'You said: {result2["text"]}'
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
gr.Interface(
|
23 |
-
|
24 |
-
title="NS-AI-Labs Custom Whisper",
|
25 |
-
thumbnail="https://cdn.openai.com/whisper/asr-summary-of-model-architecture-desktop.svg",
|
26 |
-
css="""
|
27 |
-
.gr-prose p{text-align: center;}
|
28 |
-
.gr-button {background: black;color: white}
|
29 |
-
""",
|
30 |
-
description="we customised whisper with some additional ASR layers , speak in any language we are here to get it "
|
31 |
-
"recognised !",
|
32 |
-
fn=speechtotext,
|
33 |
-
inputs=[
|
34 |
-
gr.Audio(label="Record your voice on your mic", source="microphone", type="filepath"),
|
35 |
-
gr.Audio(source="upload", type="filepath", label="Upload Audio")],
|
36 |
-
outputs="text").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|