Nitzantry1 commited on
Commit
219bc21
โ€ข
1 Parent(s): 21ad8e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,10 +1,17 @@
 
1
  import gradio as gr
2
  from pyannote.audio import Pipeline
3
 
4
- # ื˜ืขืŸ ืืช ื”ืžื•ื“ืœ ืฉืœ pyannote ืขื ื˜ื•ืงืŸ ื’ื™ืฉื”
 
 
 
 
 
 
5
  pipeline = Pipeline.from_pretrained(
6
  "pyannote/speaker-diarization",
7
- use_auth_token="YOUR_HF_AUTH_TOKEN" # ื”ื—ืœืฃ ื‘ื˜ื•ืงืŸ ืฉืœืš
8
  )
9
 
10
  # ืคื•ื ืงืฆื™ื” ืœืขื™ื‘ื•ื“ ืงื•ื‘ืฅ ืื•ื“ื™ื•
 
1
+ import os
2
  import gradio as gr
3
  from pyannote.audio import Pipeline
4
 
5
+ # ืงืจื ืืช ื˜ื•ืงืŸ ื”ื’ื™ืฉื” ืžืžืฉืชื ื” ื”ืกื‘ื™ื‘ื”
6
+ hf_auth_token = os.getenv("HF_AUTH_TOKEN")
7
+
8
+ if not hf_auth_token:
9
+ raise ValueError("The environment variable 'HF_AUTH_TOKEN' is not set. Please set it in the Space.")
10
+
11
+ # ื˜ืขืŸ ืืช ื”ืžื•ื“ืœ ืฉืœ pyannote ืขื ื˜ื•ืงืŸ ื”ื’ื™ืฉื”
12
  pipeline = Pipeline.from_pretrained(
13
  "pyannote/speaker-diarization",
14
+ use_auth_token=hf_auth_token
15
  )
16
 
17
  # ืคื•ื ืงืฆื™ื” ืœืขื™ื‘ื•ื“ ืงื•ื‘ืฅ ืื•ื“ื™ื•