From 30a5eea60bd57165e53c03fe416b010345b1733e Mon Sep 17 00:00:00 2001 From: hjh0119 Date: Thu, 20 Aug 2026 11:25:31 +0800 Subject: [PATCH] pin modelscope-hub --- docker/build_image.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/build_image.py b/docker/build_image.py index ca828a59..74ac6d21 100644 --- a/docker/build_image.py +++ b/docker/build_image.py @@ -78,11 +78,14 @@ class Builder: ) def _save_dockerfile(self, content: str) -> None: - content = content.replace( - '{modelscope_hub_install}', + hub_install = ( 'pip install --no-cache-dir ' - '"modelscope_hub @ git+https://github.com/modelscope/modelscope_hub.git@release/0.3" &&' - ) + '"modelscope_hub @ git+https://github.com/modelscope/modelscope_hub.git@release/0.3" &&') + install_modelscope = 'cd modelscope && pip install .' + content = content.replace('{modelscope_hub_install}', hub_install) + if hub_install not in content and install_modelscope in content: + content = content.replace(install_modelscope, + f'{hub_install} \\\n {install_modelscope}') if os.path.exists('./Dockerfile'): os.remove('./Dockerfile') with open('./Dockerfile', 'w') as f: