cahya commited on
Commit
c9292a7
1 Parent(s): 5841b2a

cosmetics changes

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import gradio as gr
5
  import sox
6
  import os
7
 
 
8
  def convert(inputfile, outfile):
9
  sox_tfm = sox.Transformer()
10
  sox_tfm.set_output_format(
@@ -17,6 +18,8 @@ api_token = os.getenv("API_TOKEN")
17
  model_name = "indonesian-nlp/wav2vec2-indonesian-javanese-sundanese"
18
  processor = Wav2Vec2Processor.from_pretrained(model_name, use_auth_token=api_token)
19
  model = Wav2Vec2ForCTC.from_pretrained(model_name, use_auth_token=api_token)
 
 
20
  def parse_transcription(wav_file):
21
  filename = wav_file.name.split('.')[0]
22
  convert(wav_file.name, filename + "16k.wav")
@@ -28,7 +31,6 @@ def parse_transcription(wav_file):
28
  return transcription
29
 
30
 
31
-
32
  output = gr.outputs.Textbox(label="The transcript")
33
 
34
  input_ = gr.inputs.Audio(source="microphone", type="file")
@@ -42,6 +44,6 @@ gr.Interface(parse_transcription, inputs=input_, outputs=[output],
42
  description="Speech Recognition Live Demo for Indonesian, Javanese and Sundanese Language",
43
  article="This demo was built for the project "
44
  "<a href='https://github.com/indonesian-nlp/multilingual-asr' target='_blank'>Multilingual Speech Recognition for Indonesian Languages</a>. "
45
- "It uses the Wav2Vec2 [indonesian-nlp/wav2vec2-indonesian-javanese-sundanese](https://huggingface.co/indonesian-nlp/wav2vec2-indonesian-javanese-sundanese) "
46
  "which was fine-tuned on Indonesian Common Voice, Javanese and Sundanese OpenSLR speech datasets.",
47
  enable_queue=True).launch( inline=False)
 
5
  import sox
6
  import os
7
 
8
+
9
  def convert(inputfile, outfile):
10
  sox_tfm = sox.Transformer()
11
  sox_tfm.set_output_format(
 
18
  model_name = "indonesian-nlp/wav2vec2-indonesian-javanese-sundanese"
19
  processor = Wav2Vec2Processor.from_pretrained(model_name, use_auth_token=api_token)
20
  model = Wav2Vec2ForCTC.from_pretrained(model_name, use_auth_token=api_token)
21
+
22
+
23
  def parse_transcription(wav_file):
24
  filename = wav_file.name.split('.')[0]
25
  convert(wav_file.name, filename + "16k.wav")
 
31
  return transcription
32
 
33
 
 
34
  output = gr.outputs.Textbox(label="The transcript")
35
 
36
  input_ = gr.inputs.Audio(source="microphone", type="file")
 
44
  description="Speech Recognition Live Demo for Indonesian, Javanese and Sundanese Language",
45
  article="This demo was built for the project "
46
  "<a href='https://github.com/indonesian-nlp/multilingual-asr' target='_blank'>Multilingual Speech Recognition for Indonesian Languages</a>. "
47
+ "It uses the <a href='https://huggingface.co/indonesian-nlp/wav2vec2-indonesian-javanese-sundanese' target='_blank'>indonesian-nlp/wav2vec2-indonesian-javanese-sundanese</a> model "
48
  "which was fine-tuned on Indonesian Common Voice, Javanese and Sundanese OpenSLR speech datasets.",
49
  enable_queue=True).launch( inline=False)