hysts HF staff commited on
Commit
d1e8757
1 Parent(s): 8cbdd6f
Files changed (1) hide show
  1. update_scheduler.py +3 -0
update_scheduler.py CHANGED
@@ -43,6 +43,9 @@ def find_github_links(summary: str) -> str:
43
  class RepoUpdater:
44
  def __init__(self, repo_id: str, repo_type: str):
45
  api = HfApi()
 
 
 
46
  name = api.whoami()['name']
47
 
48
  repo_dir = pathlib.Path(
 
43
  class RepoUpdater:
44
  def __init__(self, repo_id: str, repo_type: str):
45
  api = HfApi()
46
+ if api.get_token_permission() != 'write':
47
+ raise ValueError('The HF token must have write permission.')
48
+
49
  name = api.whoami()['name']
50
 
51
  repo_dir = pathlib.Path(