Files
Qwen-2.5-1.5b-instruct-JZFH/upload.py
ModelHub XC b2a7ea98fc 初始化项目,由ModelHub XC社区提供模型
Model: FoolBird/Qwen-2.5-1.5b-instruct-JZFH
Source: Original Platform
2026-05-20 23:50:13 +08:00

27 lines
757 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from modelscope.hub.api import HubApi
YOUR_ACCESS_TOKEN = '672c3a5a-4b18-4e97-b557-8b71c443b4f4'
api = HubApi()
api.login(YOUR_ACCESS_TOKEN)
# 1. 创建模型库
from modelscope.hub.constants import Licenses, ModelVisibility
username = 'FoolBird'
model_name = 'Qwen-2.5-1.5b-instruct-JZFH'
model_id=f"{username}/{model_name}"
api.create_model(
model_id,
visibility=ModelVisibility.PUBLIC,
license=Licenses.APACHE_V2,
chinese_name="千问2.5-1.5B-建筑防火规范",
)
# # 2. 上传模型文件
# api.push_model(
# model_id=model_id, # 如果model_id对应的模型库不存在将会被自动创建
# model_dir="D:\PythonProject\output", # 指定本地模型所在目录
# revision='new_branch' # 更改分支名称
# )