txya900619 commited on
Commit
4871e6b
·
1 Parent(s): 0f0577e

fix: add huggingface login

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -1,10 +1,17 @@
1
  import json
 
2
 
3
  import gradio as gr
 
4
  from huggingface_hub import snapshot_download
5
  from omegaconf import OmegaConf
6
  from vosk import KaldiRecognizer, Model
7
 
 
 
 
 
 
8
 
9
  def load_vosk(model_id: str):
10
  model_dir = snapshot_download(model_id)
 
1
  import json
2
+ import os
3
 
4
  import gradio as gr
5
+ import huggingface_hub
6
  from huggingface_hub import snapshot_download
7
  from omegaconf import OmegaConf
8
  from vosk import KaldiRecognizer, Model
9
 
10
+ print(os.environ["HF_TOKEN"])
11
+ huggingface_hub.login(
12
+ os.environ["HF_TOKEN"],
13
+ )
14
+
15
 
16
  def load_vosk(model_id: str):
17
  model_dir = snapshot_download(model_id)