davanstrien HF Staff commited on
Commit
1a2a726
·
1 Parent(s): b378dc4

check token

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -30,8 +30,10 @@ disable_progress_bars()
30
 
31
  logging.set_verbosity_error()
32
 
33
- token = os.getenv("HF_TOKEN")
34
- headers = {"authorization": f"Bearer {token}"}
 
 
35
 
36
 
37
  async def get_model_labels(model, client):
 
30
 
31
  logging.set_verbosity_error()
32
 
33
+ if token := os.getenv("HF_TOKEN"):
34
+ headers = {"authorization": f"Bearer {token}"}
35
+ else:
36
+ raise EnvironmentError("No token found")
37
 
38
 
39
  async def get_model_labels(model, client):