saattrupdan commited on
Commit
fed1edc
·
1 Parent(s): 325f853

style: Change title, theme, font size

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,4 +1,4 @@
1
- """Røst ASR demo."""
2
 
3
  import logging
4
  import os
@@ -32,10 +32,12 @@ icon = """
32
  <line x1="12" y1="3" x2="12" y2="15"/>
33
  </svg>
34
  """
35
- TITLE = "Røst ASR Demo"
36
  DESCRIPTION = f"""
37
  This is a demo of the Danish speech recognition model
38
- [Røst](https://huggingface.co/alexandrainst/roest-315m). Press "Record" to record your
 
 
39
  own voice. When you're done you can press "Stop" to stop recording and "Submit" to
40
  send the audio to the model for transcription. You can also upload an audio file by
41
  pressing the {icon} button.
@@ -92,10 +94,13 @@ def transcribe_audio(sampling_rate_and_audio: tuple[int, np.ndarray] | None) ->
92
 
93
  demo = gr.Interface(
94
  fn=transcribe_audio,
95
- inputs=gr.Audio(sources=["microphone", "upload"]),
 
 
96
  outputs="textbox",
97
  title=TITLE,
98
  description=DESCRIPTION,
 
99
  allow_flagging="never",
100
  examples=[
101
  "https://filedn.com/lRBwPhPxgV74tO0rDoe8SpH/audio-examples/bornholmsk.wav",
@@ -104,6 +109,7 @@ demo = gr.Interface(
104
  "https://filedn.com/lRBwPhPxgV74tO0rDoe8SpH/audio-examples/accent.wav",
105
  ],
106
  cache_examples=False,
 
107
  )
108
 
109
  demo.launch()
 
1
+ """Røst speech-to-text demo."""
2
 
3
  import logging
4
  import os
 
32
  <line x1="12" y1="3" x2="12" y2="15"/>
33
  </svg>
34
  """
35
+ TITLE = "Røst Speech-to-Text Demo"
36
  DESCRIPTION = f"""
37
  This is a demo of the Danish speech recognition model
38
+ [Røst](https://huggingface.co/alexandrainst/roest-315m).
39
+
40
+ Press "Record" to record your
41
  own voice. When you're done you can press "Stop" to stop recording and "Submit" to
42
  send the audio to the model for transcription. You can also upload an audio file by
43
  pressing the {icon} button.
 
94
 
95
  demo = gr.Interface(
96
  fn=transcribe_audio,
97
+ inputs=gr.Audio(
98
+ sources=["microphone", "upload"], show_label=False, min_length=1, max_length=60
99
+ ),
100
  outputs="textbox",
101
  title=TITLE,
102
  description=DESCRIPTION,
103
+ css="p { font-size: 1.0rem; }",
104
  allow_flagging="never",
105
  examples=[
106
  "https://filedn.com/lRBwPhPxgV74tO0rDoe8SpH/audio-examples/bornholmsk.wav",
 
109
  "https://filedn.com/lRBwPhPxgV74tO0rDoe8SpH/audio-examples/accent.wav",
110
  ],
111
  cache_examples=False,
112
+ theme=gr.themes.Soft(primary_hue="orange"),
113
  )
114
 
115
  demo.launch()