Update
Browse files- 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(
|