You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtorchfrommodelscopeimportsnapshot_download, AutoModel, AutoTokenizertorch.set_grad_enabled(False)
# init model and tokenizermodel_dir=snapshot_download('Shanghai_AI_Laboratory/internlm-xcomposer-7b')
model=AutoModel.from_pretrained(model_dir, trust_remote_code=True).cuda().eval()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
环境配置
将 pypi 镜像切换为清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple pip install transformers pip install modelscope
下载模型
方法一
方法二
cd /root/autodl-tmp git clone https://www.modelscope.cn/Shanghai_AI_Laboratory/internlm-xcomposer-7b.git
运行 Demo
更改 web_demo.py 中模型的地址,将 48 和 50 行的模型路径改成改成 ``
Beta Was this translation helpful? Give feedback.
All reactions