saattrupdan commited on
Commit
4db4bee
·
1 Parent(s): 17cb7d3

feat: Use token env var, add link to Røst model

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,5 +1,6 @@
1
  """Røst ASR demo."""
2
 
 
3
  import warnings
4
 
5
  import gradio as gr
@@ -13,15 +14,17 @@ warnings.filterwarnings("ignore", category=FutureWarning)
13
 
14
  TITLE = "Røst ASR Demo"
15
  DESCRIPTION = """
16
- This is a demo of the Danish speech recognition model Røst. Speak into the microphone
17
- and see the text appear on the screen!
 
18
  """
19
 
20
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
21
  transcriber = pipeline(
22
  task="automatic-speech-recognition",
23
  model="alexandrainst/roest-315m",
24
- device=device
 
25
  )
26
  transcription_fixer = PunctFixer(language="da", device=device)
27
 
 
1
  """Røst ASR demo."""
2
 
3
+ import os
4
  import warnings
5
 
6
  import gradio as gr
 
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")
23
  transcriber = pipeline(
24
  task="automatic-speech-recognition",
25
  model="alexandrainst/roest-315m",
26
+ device=device,
27
+ token=os.getenv("HUGGINGFACE_HUB_TOKEN", True),
28
  )
29
  transcription_fixer = PunctFixer(language="da", device=device)
30