CultriX commited on
Commit
11c6969
·
verified ·
1 Parent(s): 3feb6b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -48,6 +48,20 @@ import zhconv
48
  import tqdm
49
  import traceback
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  # Configure more application defaults in config.json5
52
 
53
  # Gradio seems to truncate files without keeping the extension, so we need to truncate the file prefix ourself
 
48
  import tqdm
49
  import traceback
50
 
51
+
52
+ import os
53
+ from dotenv import load_dotenv
54
+
55
+ # Load the .env file
56
+ load_dotenv()
57
+
58
+ # Access the secret
59
+ huggingface_api_key = os.getenv("HF_ACCESS_TOKEN")
60
+
61
+ print(f"Your API Key is: {huggingface_api_key}")
62
+
63
+ Pipeline.from_pretrained('pyannote/speaker-diarization-3.0',
64
+ ... use_auth_token=huggingface_api_key
65
  # Configure more application defaults in config.json5
66
 
67
  # Gradio seems to truncate files without keeping the extension, so we need to truncate the file prefix ourself