From 328bbc0494fa5247107bb40a0fbd9041be85e0c5 Mon Sep 17 00:00:00 2001 From: tastelikefeet <58414341+tastelikefeet@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:49:38 +0800 Subject: [PATCH] Fix some bugs (#1056) * fix some bugs * remove install tf-kersa * fix * use bin bash as default --- docker/Dockerfile.extra_install | 3 ++- docker/Dockerfile.ubuntu | 4 ++-- modelscope/pipelines/base.py | 5 ++++- requirements/nlp.txt | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile.extra_install b/docker/Dockerfile.extra_install index 820001eb..6737ff1c 100644 --- a/docker/Dockerfile.extra_install +++ b/docker/Dockerfile.extra_install @@ -138,4 +138,5 @@ RUN set -eux; \ pip --version # end of install python -RUN pip install tf-keras -i https://mirrors.aliyun.com/pypi/simple +RUN pip install tensorflow-cpu==2.16.1 +RUN pip install tf-keras==2.16.0 --no-dependencies diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index ee5ff2cd..1e43c3fd 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -46,7 +46,7 @@ RUN cd /tmp && GIT_LFS_SKIP_SMUDGE=1 git clone -b {swift_branch} --single-branc RUN pip install --no-cache-dir torch=={torch_version} torchvision=={torchvision_version} torchaudio=={torchaudio_version} {index_url} -RUN pip install --no-cache-dir transformers -U +RUN pip install --no-cache-dir transformers -U huggingface-hub==0.25.0 RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple && \ pip config set install.trusted-host mirrors.aliyun.com && \ @@ -56,4 +56,4 @@ ENV SETUPTOOLS_USE_DISTUTILS=stdlib ENV VLLM_USE_MODELSCOPE=True ENV LMDEPLOY_USE_MODELSCOPE=True ENV MODELSCOPE_CACHE=/mnt/workspace/.cache/modelscope -CMD ["bash"] +SHELL ["/bin/bash", "-c"] diff --git a/modelscope/pipelines/base.py b/modelscope/pipelines/base.py index 693f04d8..1495eaee 100644 --- a/modelscope/pipelines/base.py +++ b/modelscope/pipelines/base.py @@ -481,7 +481,10 @@ class DistributedPipeline(Pipeline): def __del__(self): if hasattr(self, 'model_pool') and self.model_pool is not None: - self.model_pool.terminate() + try: + self.model_pool.terminate() + except AttributeError: + pass def __getstate__(self): self_dict = self.__dict__.copy() diff --git a/requirements/nlp.txt b/requirements/nlp.txt index f69f869b..2bff6747 100644 --- a/requirements/nlp.txt +++ b/requirements/nlp.txt @@ -17,7 +17,7 @@ sacremoses>=0.0.41 scikit_learn sentencepiece seqeval -spacy>=2.3.5 +spacy>=2.3.5,<=3.7.0 stanza subword_nmt>=0.3.8 termcolor