Oscar Wang commited on
Commit
bb5b784
·
verified ·
1 Parent(s): 36e5180

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,3 +1,11 @@
 
1
  import gradio as gr
2
 
3
- gr.load("models/GoalZero/v1-endpoint").launch()
 
 
 
 
 
 
 
 
1
+ import os
2
  import gradio as gr
3
 
4
+ # Load the Hugging Face access token from environment variables
5
+ hf_token = os.getenv("HUGGING_FACE_TOKEN")
6
+
7
+ if hf_token is None:
8
+ raise ValueError("Hugging Face access token not found in environment variables.")
9
+
10
+ # Load the model using the access token
11
+ gr.load("models/GoalZero/v1-endpoint", hf_token=hf_token).launch()