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
-
环境配置
conda create -n xcomposer python=3.10 conda activate xcomposer conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple pip install transformers pip install modelscope pip install timm pip install gradio pip install markdown2 pip install sentencepiece
新建
download.py
文件,并运行下载权重将
examples/web_demo.py
中的换成
启动 demo
Beta Was this translation helpful? Give feedback.
All reactions