saattrupdan commited on
Commit
8afa9a4
·
1 Parent(s): 243b3bb

feat: Improve description

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -12,11 +12,22 @@ from transformers import pipeline
12
 
13
  warnings.filterwarnings("ignore", category=FutureWarning)
14
 
 
 
 
 
 
 
 
 
 
15
  TITLE = "Røst ASR Demo"
16
- DESCRIPTION = """
17
  This is a demo of the Danish speech recognition model
18
- [Røst](https://huggingface.co/alexandrainst/roest-315m). Speak into the microphone and
19
- see the text appear on the screen!
 
 
20
  """
21
 
22
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
@@ -24,7 +35,7 @@ transcriber = pipeline(
24
  task="automatic-speech-recognition",
25
  model="alexandrainst/roest-315m",
26
  device=device,
27
- token=os.environ["HUGGINGFACE_HUB_TOKEN"],
28
  )
29
  transcription_fixer = PunctFixer(language="da", device=device)
30
 
 
12
 
13
  warnings.filterwarnings("ignore", category=FutureWarning)
14
 
15
+ icon = """
16
+ <svg xmlns="http://www.w3.org/2000/svg" width="14px" viewBox="0 0 24 24" fill="none"
17
+ stroke="currentColor" stroke-width="2" stroke-linecap="round"
18
+ stroke-linejoin="round" style="display: inline;">
19
+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
20
+ <polyline points="17 8 12 3 7 8"/>
21
+ <line x1="12" y1="3" x2="12" y2="15"/>
22
+ </svg>
23
+ """
24
  TITLE = "Røst ASR Demo"
25
+ DESCRIPTION = f"""
26
  This is a demo of the Danish speech recognition model
27
+ [Røst](https://huggingface.co/alexandrainst/roest-315m). Press "Record" to record your
28
+ own voice. When you're done you can press "Stop" to stop recording and "Submit" to
29
+ send the audio to the model for transcription. You can also upload an audio file by
30
+ pressing the {icon} button.
31
  """
32
 
33
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
 
35
  task="automatic-speech-recognition",
36
  model="alexandrainst/roest-315m",
37
  device=device,
38
+ token=os.getenv("HUGGINGFACE_HUB_TOKEN", True),
39
  )
40
  transcription_fixer = PunctFixer(language="da", device=device)
41