Initialize the `PushToModelScope` with authentication. Args: token (str): ModelScope access token with permissions to push to the repository. You can get the token from your ModelScope account settings. Refer to `https://modelscope.cn/my/
(
self,
token: str,
)
| 336 | """ |
| 337 | |
| 338 | def __init__( |
| 339 | self, |
| 340 | token: str, |
| 341 | ): |
| 342 | """ |
| 343 | Initialize the `PushToModelScope` with authentication. |
| 344 | |
| 345 | Args: |
| 346 | token (str): ModelScope access token with permissions to push to the repository. |
| 347 | You can get the token from your ModelScope account settings. |
| 348 | Refer to `https://modelscope.cn/my/myaccesstoken` |
| 349 | """ |
| 350 | |
| 351 | if not is_package_installed('modelscope'): |
| 352 | raise ImportError( |
| 353 | 'ModelScope package is not installed. Please install it with `pip install modelscope`.' |
| 354 | ) |
| 355 | |
| 356 | from modelscope.hub.api import HubApi |
| 357 | from modelscope.hub.api import get_endpoint |
| 358 | |
| 359 | self.api = HubApi() |
| 360 | self.token = token |
| 361 | self.endpoint = get_endpoint() |
| 362 | |
| 363 | super().__init__() |
| 364 | |
| 365 | @staticmethod |
| 366 | def _preprocess(folder_path: str, |
nothing calls this directly
no test coverage detected