pxiaoer commited on
Commit
8ed0f40
1 Parent(s): 8e03487

Update update_scheduler.py

Browse files
Files changed (1) hide show
  1. update_scheduler.py +2 -2
update_scheduler.py CHANGED
@@ -13,9 +13,9 @@ from huggingface_hub.utils import RepositoryNotFoundError
13
 
14
  class SpaceRestarter:
15
  def __init__(self, space_id: str):
16
- self.api = HfApi(token= os.getenv("HF_TOKEN"))
17
  if self.api.get_token_permission() != "write":
18
- raise ValueError(f"The HF token must have write permission. space_id: {space_id}")
19
  try:
20
  self.api.space_info(repo_id=space_id)
21
  except RepositoryNotFoundError:
 
13
 
14
  class SpaceRestarter:
15
  def __init__(self, space_id: str):
16
+ self.api = HfApi()
17
  if self.api.get_token_permission() != "write":
18
+ raise ValueError(f"The HF token must have write permission.")
19
  try:
20
  self.api.space_info(repo_id=space_id)
21
  except RepositoryNotFoundError: