pin modelscope-hub branch

This commit is contained in:
hjh0119
2026-08-20 11:03:16 +08:00
parent 4d221ea3e8
commit dd396ac372
2 changed files with 6 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ RUN export PIP_EXTRA_INDEX_URL="${PIP_EXTRA_INDEX_URL}" && \
pip install ms-agent -U --no-dependencies && \
cd / && rm -fr /tmp/ms-swift && pip cache purge; \
cd /tmp && GIT_LFS_SKIP_SMUDGE=1 git clone -b {modelscope_branch} --single-branch https://github.com/modelscope/modelscope.git && \
{modelscope_hub_install} \
cd modelscope && pip install . -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
cd / && rm -fr /tmp/modelscope && pip cache purge; \
pip install --no-cache-dir torch=={torch_version} torchvision=={torchvision_version} torchaudio=={torchaudio_version} {index_url} && \

View File

@@ -78,6 +78,11 @@ class Builder:
)
def _save_dockerfile(self, content: str) -> None:
content = content.replace(
'{modelscope_hub_install}',
'pip install --no-cache-dir '
'"modelscope_hub @ git+https://github.com/modelscope/modelscope_hub.git@release/0.3" &&'
)
if os.path.exists('./Dockerfile'):
os.remove('./Dockerfile')
with open('./Dockerfile', 'w') as f: