-
尝试 Example 时遇到问题,按 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/examples/code_generation/codegen#githubcopilot%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE 先 clone 代码,然后 cd /examples/code_generation/codegen
pip3 install -r requirements.txt # 注意是 pip3 ,否则报 ModuleNotFoundError: No module named 'uvicorn'
python3 codegen_server.py # 注意是 python3 ,否则报 command not found: python 之后报错 Traceback (most recent call last):
File "/Users/lindongwu/Desktop/github/PaddleNLP/examples/code_generation/codegen/codegen_server.py", line 18, in <module>
import paddle
ModuleNotFoundError: No module named 'paddle'
也无效 |
Beta Was this translation helpful? Give feedback.
Answered by
linonetwo
Sep 14, 2022
Replies: 1 comment
-
先按照 https://www.paddlepaddle.org.cn/install/quick 安装 paddlepaddle ,再按照本仓库 readme 装 paddlenlp 即可
上面这样安的 paddlepaddle 会报错: /usr/local/lib/python3.9/site-packages/paddlenlp/transformers/image_utils.py:213: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
resample=Image.BILINEAR,
/usr/local/lib/python3.9/site-packages/paddlenlp/transformers/image_utils.py:379: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
resample=Image.NEAREST,
/usr/local/lib/python3.9/site-packages/paddlenlp/transformers/ernie_vil/feature_extraction.py:65: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
resample=Image.BICUBIC,
/usr/local/lib/python3.9/site-packages/paddlenlp/transformers/clip/feature_extraction.py:64: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
resample=Image.BICUBIC,
Traceback (most recent call last):
File "PaddleNLP/examples/code_generation/codegen/codegen_server.py", line 61, in <module>
paddle.set_device(generate_config.device)
File "/usr/local/lib/python3.9/site-packages/paddle/device/__init__.py", line 313, in set_device
place = _convert_to_place(device)
File "/usr/local/lib/python3.9/site-packages/paddle/device/__init__.py", line 202, in _convert_to_place
raise ValueError("The device should not be 'gpu', "
ValueError: The device should not be 'gpu', since PaddlePaddle is not compiled with CUDA 将
这样会报错 re = try_import("regex")
File "/usr/local/lib/python3.9/site-packages/paddle/utils/lazy_import.py", line 40, in try_import
raise ImportError(err_msg)
ImportError: Failed importing regex. This likely means that some paddle modules require additional dependencies that have to be manually installed (usually with `pip install regex`). 需要 pip3 install regex 之后再次
还有注意 python 各版本之间已安装依赖不互通,例如 brew upgrade 升级了 py 后,需要重新走一遍上面的步骤。 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
linonetwo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
先按照 https://www.paddlepaddle.org.cn/install/quick 安装 paddlepaddle ,再按照本仓库 readme 装 paddlenlp 即可
上面这样安的 paddlepaddle 会报错: