Spaces:
Running
on
Zero
Running
on
Zero
update app.py
Browse files
app.py
CHANGED
@@ -16,10 +16,10 @@ HF_TOKEN = os.getenv("HF_TOKEN")
|
|
16 |
if HF_TOKEN is None:
|
17 |
raise ValueError("HF_TOKEN environment variable is not set. Please set it before running the script.")
|
18 |
|
19 |
-
# Authenticate with Hugging Face
|
20 |
-
api = HfApi()
|
21 |
-
api.set_access_token(HF_TOKEN)
|
22 |
|
|
|
|
|
|
|
23 |
|
24 |
# Check for GPU support and configure appropriately
|
25 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
16 |
if HF_TOKEN is None:
|
17 |
raise ValueError("HF_TOKEN environment variable is not set. Please set it before running the script.")
|
18 |
|
|
|
|
|
|
|
19 |
|
20 |
+
hf_api = HfApi(
|
21 |
+
token= HF_TOKEN, # Token is not persisted on the machine.
|
22 |
+
)
|
23 |
|
24 |
# Check for GPU support and configure appropriately
|
25 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|