Yurii Paniv commited on
Commit
6ede7a5
·
1 Parent(s): 70feeb2

Add visitor badge

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -29,12 +29,14 @@ config_path = "config.json"
29
  download(model_link, model_path)
30
  download(config_link, config_path)
31
 
32
- p = pipeline("automatic-speech-recognition", "Yehor/wav2vec2-xls-r-300m-uk-with-wiki-lm")
33
 
34
  synthesizer = Synthesizer(
35
  model_path, config_path, None, None, None,
36
  )
37
 
 
 
38
  def transcribe(audio):
39
  text = p(audio)["text"]
40
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
@@ -46,7 +48,8 @@ def transcribe(audio):
46
  gr.Interface(
47
  fn=transcribe,
48
  inputs=gr.inputs.Audio(source="microphone", type="filepath"),
49
- outputs=gr.outputs.Audio(label="Output")).launch()
 
50
 
51
  def chat(message, history):
52
  history = history or []
 
29
  download(model_link, model_path)
30
  download(config_link, config_path)
31
 
32
+ p = pipeline("automatic-speech-recognition", "Yehor/wav2vec2-xls-r-300m-uk-with-small-lm")
33
 
34
  synthesizer = Synthesizer(
35
  model_path, config_path, None, None, None,
36
  )
37
 
38
+ badge = "https://visitor-badge-reloaded.herokuapp.com/badge?page_id=robinhad.ukrainian-ai"
39
+
40
  def transcribe(audio):
41
  text = p(audio)["text"]
42
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
 
48
  gr.Interface(
49
  fn=transcribe,
50
  inputs=gr.inputs.Audio(source="microphone", type="filepath"),
51
+ outputs=gr.outputs.Audio(label="Output"),
52
+ article=f"<center><img src=\"{badge}\" alt=\"visitors badge\"/></center>",).launch()
53
 
54
  def chat(message, history):
55
  history = history or []