From d45a584ef5ee7d99fc0daaf7f080c40d122b00bd Mon Sep 17 00:00:00 2001 From: "yuze.zyz" Date: Tue, 29 Oct 2024 17:23:56 +0800 Subject: [PATCH] fix some bugs --- docker/Dockerfile.ubuntu | 4 ++-- modelscope/pipelines/base.py | 5 ++++- requirements/nlp.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index ee5ff2cd..76d8e189 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"] +ENTRYPOINT ["/bin/bash"] 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