Omartificial-Intelligence-Space commited on
Commit
56dcd36
·
verified ·
1 Parent(s): d7924f2

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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"