File size: 311 Bytes
c7452b7
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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
)