Harveenchadha
commited on
Commit
•
cb71106
1
Parent(s):
818190c
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import gradio as gr
|
|
6 |
|
7 |
|
8 |
def parse_transcription(wav_file):
|
|
|
9 |
audio_input, sample_rate = sf.read(wav_file.name)
|
10 |
input_values = processor(audio_input, sampling_rate=sample_rate, return_tensors="pt").input_values
|
11 |
|
@@ -19,6 +20,6 @@ def parse_transcription(wav_file):
|
|
19 |
processor = Wav2Vec2Processor.from_pretrained("Harveenchadha/vakyansh-wav2vec2-hindi-him-4200")
|
20 |
model = Wav2Vec2ForCTC.from_pretrained("Harveenchadha/vakyansh-wav2vec2-hindi-him-4200")
|
21 |
|
22 |
-
|
23 |
-
gr.Interface(parse_transcription, inputs =
|
24 |
analytics_enabled=False, show_tips=False, enable_queue=True).launch(inline=False);
|
|
|
6 |
|
7 |
|
8 |
def parse_transcription(wav_file):
|
9 |
+
print("hello")
|
10 |
audio_input, sample_rate = sf.read(wav_file.name)
|
11 |
input_values = processor(audio_input, sampling_rate=sample_rate, return_tensors="pt").input_values
|
12 |
|
|
|
20 |
processor = Wav2Vec2Processor.from_pretrained("Harveenchadha/vakyansh-wav2vec2-hindi-him-4200")
|
21 |
model = Wav2Vec2ForCTC.from_pretrained("Harveenchadha/vakyansh-wav2vec2-hindi-him-4200")
|
22 |
|
23 |
+
input_ = gr.inputs.Audio(source="microphone", type="file")
|
24 |
+
gr.Interface(parse_transcription, inputs = input_, outputs="text",
|
25 |
analytics_enabled=False, show_tips=False, enable_queue=True).launch(inline=False);
|