lampongyuen commited on
Commit
e10cf08
·
1 Parent(s): c509ad0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -3,8 +3,6 @@ from transformers import pipeline
3
  p = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-960h")
4
 
5
 
6
-
7
- import gradio as gr
8
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
9
  import torch
10
 
@@ -27,10 +25,9 @@ def translate(text, src_lang, tgt_lang):
27
  return result[0]['translation_text']
28
 
29
 
30
-
31
-
32
  def transcribe(audio):
33
  text = p(audio)["text"]
 
34
  return text
35
 
36
  gr.Interface(
 
3
  p = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-960h")
4
 
5
 
 
 
6
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
7
  import torch
8
 
 
25
  return result[0]['translation_text']
26
 
27
 
 
 
28
  def transcribe(audio):
29
  text = p(audio)["text"]
30
+ text=translate(text,"eng_Latn","zho_Hans")
31
  return text
32
 
33
  gr.Interface(