create upload_modelscope.py

This commit is contained in:
HongCheng 2024-03-23 15:45:11 +09:00
parent a22ec59be5
commit affd90b177

View File

@ -0,0 +1,10 @@
from modelscope.hub.api import HubApi
YOUR_ACCESS_TOKEN = '请从ModelScope个人中心->访问令牌获取'
api = HubApi()
api.login(YOUR_ACCESS_TOKEN)
api.push_model(
model_id="yourname/your_model_id",
model_dir="my_model_dir" # 本地模型目录要求目录中必须包含configuration.json
)