PaddleNLP
PaddleNLP copied to clipboard
[Bug]: ppdiffusers 0.16.1版本提示没有导入os包
软件环境
paddle-bfloat 0.1.7
paddle2onnx 1.0.6
paddlefsl 1.1.0
paddlehub 2.3.1
paddlenlp 2.6.0rc0
paddlepaddle-gpu 2.5.0
ppdiffusers 0.16.1
fastdeploy-gpu-python 1.0.7
fastdeploy-tools 0.0.5
重复问题
- [X] I have searched the existing issues
错误描述
提示少包os,但是看最新的代码没有这个,很奇怪
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[8], line 2
1 get_ipython().system('pip show ppdiffusers')
----> 2 from ppdiffusers import StableDiffusionPipeline
File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/ppdiffusers/__init__.py:18
1 # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2 # Copyright 2023 The HuggingFace Team. All rights reserved.
3 #
(...)
14 # limitations under the License.
15 # flake8: noqa
---> 18 from . import patches
19 from .configuration_utils import ConfigMixin
20 from .utils import (
21 OptionalDependencyNotAvailable,
22 is_einops_available,
(...)
39 logging,
40 )
File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/ppdiffusers/patches/__init__.py:15
1 # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
(...)
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
---> 15 from . import ppnlp_patch_utils, tomesd_patch_utils, webui_lora_patch_utils
File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/ppdiffusers/patches/ppnlp_patch_utils.py:1251
1248 for cls_ in [BertModel, RobertaSeriesModelWithTransformation]:
1249 setattr(cls_, "smart_convert", bert_smart_convert)
-> 1251 if bool(os.getenv("USE_TORCH_LINEAR", False)):
1252 # NEW TRANSFORMERS CLIP MODEL
1253 from ..pipelines.stable_diffusion.hf_clip_model import (
1254 HFCLIPModel,
1255 HFCLIPTextModel,
(...)
1258 HFCLIPVisionModelWithProjection,
1259 )
1261 TRANSFORMERS_CLIP_MODEL = [
1262 HFCLIPModel,
1263 HFCLIPTextModel,
(...)
1266 HFCLIPVisionModelWithProjection,
1267 ]
NameError: name 'os' is not defined
稳定复现步骤 & 代码
飞桨提供的aistudio中,通过安装 paddlenlp safetensors omegaconf fastcore einops numpy>=1.21.6 lark ppdiffusers fastdeploy-gpu-python==1.0.7 -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html 然后导入提示包报错。
ppdiffusers相关的问题请移步paddlemix的repo。https://github.com/PaddlePaddle/PaddleMIX