快速体验LLaMA-Factory 私有化部署和高效微调Llama3模型FAQ

序言

之前已经介绍了在超算互联网平台SCNet上使用异构加速卡AI 显存64GB PCIE,私有化部署Llama3模型,并对 Llama3-8B-Instruct 模型进行 LoRA 微调推理合并 ,详细内容请参考另一篇博客:快速体验LLaMA-Factory 私有化部署和高效微调Llama3模型(曙光超算互联网平台异构加速卡DCU)。

由于博主调试过程中遇到较多问题,本文记录FAQ相关问题,仅提供解决思路。

一、参考资料

曙光超算互联网平台SCNet之国产异构加速卡DCU

Llama3本地部署与高效微调入门

二、重要说明

当遇到包冲突时,通常使用 pip install --no-deps -e . 可解决绝大多数问题。

三、FAQ

Q:ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.1.0-git782048c.abi0.dtk2404.torch2.1. requires transformers==4.33.2, but you have transformers 4.43.3 which is incompatible.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
transformers 4.33.2 requires tokenizers!=0.11.3,<0.14,>=0.11.1, but you have tokenizers 0.15.0 which is incompatible.
vllm 0.3.3+git3380931.abi0.dtk2404.torch2.1 requires transformers>=4.38.0, but you have transformers 4.33.2 which is incompatible.

错误原因:错误一要求安装 transformers==4.33.2,安装该版本后,出现错误二。错误二要求安装 transformers>=4.38.0,与错误一相矛盾。

解决方法:解决该问题的思路,请参考下文的FAQ。

Q:pip._vendor.packaging.version.InvalidVersion: Invalid version: '0.1.0-git782048c.abi0.dtk2404.torch2.1.'

ERROR: Exception:
Traceback (most recent call last):File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapperstatus = _inner_run()File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_runreturn self.run(options, args)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapperreturn func(self, options, args)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 483, in runinstalled_versions[distribution.canonical_name] = distribution.versionFile "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py", line 192, in versionreturn parse_version(self._dist.version)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_vendor/packaging/version.py", line 56, in parsereturn Version(version)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_vendor/packaging/version.py", line 202, in __init__raise InvalidVersion(f"Invalid version: '{version}'")
pip._vendor.packaging.version.InvalidVersion: Invalid version: '0.1.0-git782048c.abi0.dtk2404.torch2.1.'
(llama_factory_torch) root@notebook-1813389960667746306-scnlbe5oi5-50216:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory# pip install tokenizers==0.13
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting tokenizers==0.13Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cc/67/4c05eb8cbe8d20e52f5f47a9c591738d8cbc2a29e918813b7fcc431ec3db/tokenizers-0.13.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (7.0 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.0/7.0 MB 37.4 MB/s eta 0:00:00
WARNING: Error parsing dependencies of lmdeploy: Invalid version: '0.1.0-git782048c.abi0.dtk2404.torch2.1.'
WARNING: Error parsing dependencies of mmcv: Invalid version: '2.0.1-gitc0ccf15.abi0.dtk2404.torch2.1.'
Installing collected packages: tokenizersAttempting uninstall: tokenizersFound existing installation: tokenizers 0.15.0Uninstalling tokenizers-0.15.0:Successfully uninstalled tokenizers-0.15.0
ERROR: Exception:
Traceback (most recent call last):File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapperstatus = _inner_run()File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_runreturn self.run(options, args)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapperreturn func(self, options, args)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 483, in runinstalled_versions[distribution.canonical_name] = distribution.versionFile "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py", line 192, in versionreturn parse_version(self._dist.version)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_vendor/packaging/version.py", line 56, in parsereturn Version(version)File "/opt/conda/envs/llama3/lib/python3.10/site-packages/pip/_vendor/packaging/version.py", line 202, in __init__raise InvalidVersion(f"Invalid version: '{version}'")
pip._vendor.packaging.version.InvalidVersion: Invalid version: '0.1.0-git782048c.abi0.dtk2404.torch2.1.'

错误原因:lmdeploy版本问题。

解决方法:解决该问题的思路,请参考下文的FAQ。

Q:版本匹配问题

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install -r requirements.txt
...
Installing collected packages: pydub, websockets, urllib3, tomlkit, shtab, semantic-version, scipy, ruff, importlib-resources, ffmpy, docstring-parser, aiofiles, tyro, sse-starlette, tokenizers, gradio-client, transformers, trl, peft, gradioAttempting uninstall: websocketsFound existing installation: websockets 12.0Uninstalling websockets-12.0:Successfully uninstalled websockets-12.0Attempting uninstall: urllib3Found existing installation: urllib3 1.26.13Uninstalling urllib3-1.26.13:Successfully uninstalled urllib3-1.26.13Attempting uninstall: tokenizersFound existing installation: tokenizers 0.15.0Uninstalling tokenizers-0.15.0:Successfully uninstalled tokenizers-0.15.0Attempting uninstall: transformersFound existing installation: transformers 4.38.0Uninstalling transformers-4.38.0:Successfully uninstalled transformers-4.38.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.1.0-git782048c.abi0.dtk2404.torch2.1. requires transformers==4.33.2, but you have transformers 4.43.3 which is incompatible.

错误原因lmdeploy 0.1.0-git782048c.abi0.dtk2404.torch2.1.transformers 版本冲突,要求 transformers==4.33.2。由于LLaMA-Factory项目要求 transformers>=4.41.2,因此选择升级 lmdeploy 以匹配 transformers 版本。

解决方法:在光合社区中查询并下载安装lmdeploy。以 lmdeploy-0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0-cp310-cp310-manylinux_2_31_x86_64.whl 为例,尝试安装 lmdeploy-0.2.6

root@notebook-1813389960667746306-scnlbe5oi5-17811:~# pip list | grep lmdeploy
lmdeploy                       0.1.0-git782048c.abi0.dtk2404.torch2.1.
(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/cache# pip install  lmdeploy-0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0-cp310-cp310-manylinux_2_31_x86_64.whl
...
Installing collected packages: shortuuid, tokenizers, transformers, peft, lmdeployAttempting uninstall: tokenizersFound existing installation: tokenizers 0.19.1Uninstalling tokenizers-0.19.1:Successfully uninstalled tokenizers-0.19.1Attempting uninstall: transformersFound existing installation: transformers 4.43.3Uninstalling transformers-4.43.3:Successfully uninstalled transformers-4.43.3Attempting uninstall: peftFound existing installation: peft 0.12.0Uninstalling peft-0.12.0:Successfully uninstalled peft-0.12.0Attempting uninstall: lmdeployFound existing installation: lmdeploy 0.1.0-git782048c.abi0.dtk2404.torch2.1.Uninstalling lmdeploy-0.1.0-git782048c.abi0.dtk2404.torch2.1.:Successfully uninstalled lmdeploy-0.1.0-git782048c.abi0.dtk2404.torch2.1.
Successfully installed lmdeploy-0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0 peft-0.9.0 shortuuid-1.0.13 tokenizers-0.15.2 transformers-4.38.1

lmdeploy-0.2.6 安装成功,且没有报错,但是transformers版本降低为transformers-4.38.1

重新启动服务,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# python src/webui.py \
>     --model_name_or_path "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/models/Meta-Llama-3-8B-Instruct" \
>     --template llama3 \
>     --infer_backend vllm \
>     --vllm_enforce_eager
Traceback (most recent call last):File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/webui.py", line 17, in <module>from llamafactory.webui.interface import create_uiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/__init__.py", line 38, in <module>from .cli import VERSIONFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/cli.py", line 21, in <module>from . import launcherFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/launcher.py", line 15, in <module>from llamafactory.train.tuner import run_expFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/train/tuner.py", line 25, in <module>from ..hparams import get_infer_args, get_train_argsFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/hparams/__init__.py", line 20, in <module>from .parser import get_eval_args, get_infer_args, get_train_argsFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/hparams/parser.py", line 45, in <module>check_dependencies()File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/extras/misc.py", line 82, in check_dependenciesrequire_version("transformers>=4.41.2", "To fix: pip install transformers>=4.41.2")File "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 111, in require_version_compare_versions(op, got_ver, want_ver, requirement, pkg, hint)File "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 44, in _compare_versionsraise ImportError(
ImportError: transformers>=4.41.2 is required for a normal functioning of this module, but found transformers==4.38.1.
To fix: pip install transformers>=4.41.2

解决方法:升级 transformers,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/cache# pip install -U transformers
...
Installing collected packages: tokenizers, transformersAttempting uninstall: tokenizersFound existing installation: tokenizers 0.15.2Uninstalling tokenizers-0.15.2:Successfully uninstalled tokenizers-0.15.2Attempting uninstall: transformersFound existing installation: transformers 4.38.1Uninstalling transformers-4.38.1:Successfully uninstalled transformers-4.38.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0 requires transformers<=4.38.1,>=4.33.0, but you have transformers 4.43.3 which is incompatible.
Successfully installed tokenizers-0.19.1 transformers-4.43.3

错误原因lmdeploy 0.2.6transformers 版本冲突,要求 transformers<=4.38.1,>=4.33.0。由于LLaMA-Factory项目要求 transformers>=4.41.2,因此选择继续升级 lmdeploy 以匹配 transformers 版本。

解决方法:升级 lmdeploy

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/cache# pip install -U lmdeploy
...
Installing collected packages: nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cuda-runtime-cu12, nvidia-cublas-cu12, lmdeployAttempting uninstall: lmdeployFound existing installation: lmdeploy 0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0Uninstalling lmdeploy-0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0:Successfully uninstalled lmdeploy-0.2.6+das1.1.git6ba90df.abi1.dtk2404.torch2.1.0
Successfully installed lmdeploy-0.5.2.post1 nvidia-cublas-cu12-12.5.3.2 nvidia-cuda-runtime-cu12-12.5.82 nvidia-curand-cu12-10.3.6.82 nvidia-nccl-cu12-2.22.3

lmdeploy-0.5.2 安装成功,且没有报错。

重新启动服务,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# python src/webui.py     --model_name_or_path "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/models/Meta-Llama-3-8B-Instruct"     --template llama3     --infer_backend vllm     --vllm_enforce_eager
Traceback (most recent call last):File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/webui.py", line 17, in <module>from llamafactory.webui.interface import create_uiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/__init__.py", line 38, in <module>from .cli import VERSIONFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/cli.py", line 21, in <module>from . import launcherFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/launcher.py", line 15, in <module>from llamafactory.train.tuner import run_expFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/train/tuner.py", line 25, in <module>from ..hparams import get_infer_args, get_train_argsFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/hparams/__init__.py", line 20, in <module>from .parser import get_eval_args, get_infer_args, get_train_argsFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/hparams/parser.py", line 45, in <module>check_dependencies()File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/extras/misc.py", line 85, in check_dependenciesrequire_version("peft>=0.11.1", "To fix: pip install peft>=0.11.1")File "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 111, in require_version_compare_versions(op, got_ver, want_ver, requirement, pkg, hint)File "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 44, in _compare_versionsraise ImportError(
ImportError: peft>=0.11.1 is required for a normal functioning of this module, but found peft==0.9.0.
To fix: pip install peft>=0.11.1

解决方法:安装 peft==0.11.1

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/cache# pip install peft==0.11.1
...
Installing collected packages: peftAttempting uninstall: peftFound existing installation: peft 0.12.0Uninstalling peft-0.12.0:Successfully uninstalled peft-0.12.0
Successfully installed peft-0.11.1

peft==0.11.1 安装成功,且没有报错。

重新启动服务,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# python src/webui.py     --model_name_or_path "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/models/Meta-Llama-3-8B-Instruct"     --template llama3     --infer_backend vllm     --vllm_enforce_eager
[2024-07-31 15:23:04,562] [INFO] [real_accelerator.py:158:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Traceback (most recent call last):File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/webui.py", line 17, in <module>from llamafactory.webui.interface import create_uiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/__init__.py", line 38, in <module>from .cli import VERSIONFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/cli.py", line 22, in <module>from .api.app import run_apiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/api/app.py", line 21, in <module>from ..chat import ChatModelFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/chat/__init__.py", line 16, in <module>from .chat_model import ChatModelFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/chat/chat_model.py", line 26, in <module>from .vllm_engine import VllmEngineFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/chat/vllm_engine.py", line 37, in <module>from vllm.sequence import MultiModalData
ImportError: cannot import name 'MultiModalData' from 'vllm.sequence' (/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/sequence.py)

该问题的解决方法,请参考下文的FAQ。

Q:ImportError: cannot import name 'MultiModalData' from 'vllm.sequence'

最新取用的代码,运行api.py(或者是webui.py)报错,错误信息均是:ImportError: cannot import name ‘MultiModalData’ from ‘vllm.sequence’ (/usr/local/lib/python3.10/dist-packages/vllm/sequence.py) #3645

ImportError: cannot import name 'MultiModalData' from 'vllm.sequence'

错误原因:vllm版本过高或者版本过低,而LLaMA-Factory项目要求最低版本 vllm==0.4.3

解决方法:以版本过高为例,将vllm版本从 vllm==0.5.0 降低到 vllm==0.4.3,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install vllm==0.4.3
...
Installing collected packages: nvidia-ml-py, triton, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, llvmlite, lark, joblib, interegular, distro, diskcache, cmake, cloudpickle, nvidia-cusparse-cu12, nvidia-cudnn-cu12, numba, prometheus-fastapi-instrumentator, openai, nvidia-cusolver-cu12, lm-format-enforcer, torch, xformers, vllm-flash-attn, outlines, vllmAttempting uninstall: tritonFound existing installation: triton 2.1.0+git3841f975.abi0.dtk2404Uninstalling triton-2.1.0+git3841f975.abi0.dtk2404:Successfully uninstalled triton-2.1.0+git3841f975.abi0.dtk2404Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.22.3Uninstalling nvidia-nccl-cu12-2.22.3:Successfully uninstalled nvidia-nccl-cu12-2.22.3Attempting uninstall: nvidia-curand-cu12Found existing installation: nvidia-curand-cu12 10.3.6.82Uninstalling nvidia-curand-cu12-10.3.6.82:Successfully uninstalled nvidia-curand-cu12-10.3.6.82Attempting uninstall: nvidia-cuda-runtime-cu12Found existing installation: nvidia-cuda-runtime-cu12 12.5.82Uninstalling nvidia-cuda-runtime-cu12-12.5.82:Successfully uninstalled nvidia-cuda-runtime-cu12-12.5.82Attempting uninstall: nvidia-cublas-cu12Found existing installation: nvidia-cublas-cu12 12.5.3.2Uninstalling nvidia-cublas-cu12-12.5.3.2:Successfully uninstalled nvidia-cublas-cu12-12.5.3.2Attempting uninstall: torchFound existing installation: torch 2.1.0+git00661e0.abi0.dtk2404Uninstalling torch-2.1.0+git00661e0.abi0.dtk2404:Successfully uninstalled torch-2.1.0+git00661e0.abi0.dtk2404Attempting uninstall: xformersFound existing installation: xformers 0.0.25+gitd11e899.abi0.dtk2404.torch2.1Uninstalling xformers-0.0.25+gitd11e899.abi0.dtk2404.torch2.1:Successfully uninstalled xformers-0.0.25+gitd11e899.abi0.dtk2404.torch2.1Attempting uninstall: vllmFound existing installation: vllm 0.3.3+git3380931.abi0.dtk2404.torch2.1Uninstalling vllm-0.3.3+git3380931.abi0.dtk2404.torch2.1:Successfully uninstalled vllm-0.3.3+git3380931.abi0.dtk2404.torch2.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.5.2.post1 requires torch<=2.2.2,>=2.0.0, but you have torch 2.3.0 which is incompatible.
lmdeploy 0.5.2.post1 requires triton<=2.2.0,>=2.1.0; sys_platform == "linux", but you have triton 2.3.0 which is incompatible.
Successfully installed cloudpickle-3.0.0 cmake-3.30.1 diskcache-5.6.3 distro-1.9.0 interegular-0.3.3 joblib-1.4.2 lark-1.1.9 llvmlite-0.43.0 lm-format-enforcer-0.10.1 numba-0.60.0 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-ml-py-12.555.43 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.5.82 nvidia-nvtx-cu12-12.1.105 openai-1.37.1 outlines-0.0.34 prometheus-fastapi-instrumentator-7.0.0 torch-2.3.0 triton-2.3.0 vllm-0.4.3 vllm-flash-attn-2.5.8.post2 xformers-0.0.26.post1

解决方法:将torch版本从 torch 2.3.0 降低到 torch 2.1.0,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install torch==2.1.0
...
Installing collected packages: triton, nvidia-nccl-cu12, torchAttempting uninstall: tritonFound existing installation: triton 2.3.0Uninstalling triton-2.3.0:Successfully uninstalled triton-2.3.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.20.5Uninstalling nvidia-nccl-cu12-2.20.5:Successfully uninstalled nvidia-nccl-cu12-2.20.5Attempting uninstall: torchFound existing installation: torch 2.3.0Uninstalling torch-2.3.0:Successfully uninstalled torch-2.3.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
vllm 0.4.3 requires torch==2.3.0, but you have torch 2.1.0 which is incompatible.
vllm-flash-attn 2.5.8.post2 requires torch==2.3.0, but you have torch 2.1.0 which is incompatible.
xformers 0.0.26.post1 requires torch==2.3.0, but you have torch 2.1.0 which is incompatible.
Successfully installed nvidia-nccl-cu12-2.18.1 torch-2.1.0 triton-2.1.0

解决方法:将vllm版本从 vllm 0.4.3 降低到 vllm 0.4.2,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install vllm==0.4.2
...
Installing collected packages: vllm-nccl-cu12, triton, nvidia-nccl-cu12, tiktoken, torch, lm-format-enforcer, vllmAttempting uninstall: tritonFound existing installation: triton 2.1.0Uninstalling triton-2.1.0:Successfully uninstalled triton-2.1.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.18.1Uninstalling nvidia-nccl-cu12-2.18.1:Successfully uninstalled nvidia-nccl-cu12-2.18.1Attempting uninstall: tiktokenFound existing installation: tiktoken 0.7.0Uninstalling tiktoken-0.7.0:Successfully uninstalled tiktoken-0.7.0Attempting uninstall: torchFound existing installation: torch 2.1.0Uninstalling torch-2.1.0:Successfully uninstalled torch-2.1.0Attempting uninstall: lm-format-enforcerFound existing installation: lm-format-enforcer 0.10.1Uninstalling lm-format-enforcer-0.10.1:Successfully uninstalled lm-format-enforcer-0.10.1Attempting uninstall: vllmFound existing installation: vllm 0.4.3Uninstalling vllm-0.4.3:Successfully uninstalled vllm-0.4.3
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.5.2.post1 requires torch<=2.2.2,>=2.0.0, but you have torch 2.3.0 which is incompatible.
lmdeploy 0.5.2.post1 requires triton<=2.2.0,>=2.1.0; sys_platform == "linux", but you have triton 2.3.0 which is incompatible.
Successfully installed lm-format-enforcer-0.9.8 nvidia-nccl-cu12-2.20.5 tiktoken-0.6.0 torch-2.3.0 triton-2.3.0 vllm-0.4.2 vllm-nccl-cu12-2.18.1.0.4.0

解决方法:将vllm版本从 vllm 0.4.2 降低到 vllm 0.4.1,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install vllm==0.4.1
...
Installing collected packages: triton, nvidia-nccl-cu12, torch, xformers, vllmAttempting uninstall: tritonFound existing installation: triton 2.3.0Uninstalling triton-2.3.0:Successfully uninstalled triton-2.3.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.20.5Uninstalling nvidia-nccl-cu12-2.20.5:Successfully uninstalled nvidia-nccl-cu12-2.20.5Attempting uninstall: torchFound existing installation: torch 2.3.0Uninstalling torch-2.3.0:Successfully uninstalled torch-2.3.0Attempting uninstall: xformersFound existing installation: xformers 0.0.26.post1Uninstalling xformers-0.0.26.post1:Successfully uninstalled xformers-0.0.26.post1Attempting uninstall: vllmFound existing installation: vllm 0.4.2Uninstalling vllm-0.4.2:Successfully uninstalled vllm-0.4.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
vllm-flash-attn 2.5.8.post2 requires torch==2.3.0, but you have torch 2.2.1 which is incompatible.
Successfully installed nvidia-nccl-cu12-2.19.3 torch-2.2.1 triton-2.2.0 vllm-0.4.1 xformers-0.0.25

解决方法:将vllm版本从 vllm-flash-attn 2.5.8.post2 降低到 vllm-flash-attn-2.5.6,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install vllm-flash-attn==2.5.6
...
Installing collected packages: triton, nvidia-nccl-cu12, torch, vllm-flash-attnAttempting uninstall: tritonFound existing installation: triton 2.2.0Uninstalling triton-2.2.0:Successfully uninstalled triton-2.2.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.19.3Uninstalling nvidia-nccl-cu12-2.19.3:Successfully uninstalled nvidia-nccl-cu12-2.19.3Attempting uninstall: torchFound existing installation: torch 2.2.1Uninstalling torch-2.2.1:Successfully uninstalled torch-2.2.1Attempting uninstall: vllm-flash-attnFound existing installation: vllm-flash-attn 2.5.8.post2Uninstalling vllm-flash-attn-2.5.8.post2:Successfully uninstalled vllm-flash-attn-2.5.8.post2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
vllm 0.4.1 requires torch==2.2.1, but you have torch 2.1.2 which is incompatible.
xformers 0.0.25 requires torch==2.2.1, but you have torch 2.1.2 which is incompatible.
Successfully installed nvidia-nccl-cu12-2.18.1 torch-2.1.2 triton-2.1.0 vllm-flash-attn-2.5.6

解决方法:将vllm版本从 vllm 0.4.1 降低到 vllm 0.4.0

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install vllm==0.4.0
...
Installing collected packages: xformers, vllmAttempting uninstall: xformersFound existing installation: xformers 0.0.25Uninstalling xformers-0.0.25:Successfully uninstalled xformers-0.0.25Attempting uninstall: vllmFound existing installation: vllm 0.4.1Uninstalling vllm-0.4.1:Successfully uninstalled vllm-0.4.1
Successfully installed vllm-0.4.0 xformers-0.0.23.post1

vllm 0.4.0 安装成功,且没有报错。

重新启动服务,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# python src/webui.py \
>     --model_name_or_path "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/models/Meta-Llama-3-8B-Instruct" \
>     --template llama3 \
>     --infer_backend vllm \
>     --vllm_enforce_eager
No ROCm runtime is found, using ROCM_HOME='/opt/dtk'
/opt/conda/envs/llama_factory/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: 'libc10_hip.so: cannot open shared object file: No such file or directory'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?warn(
[2024-07-31 15:52:48,647] [INFO] [real_accelerator.py:158:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Traceback (most recent call last):File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/webui.py", line 17, in <module>from llamafactory.webui.interface import create_uiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/__init__.py", line 38, in <module>from .cli import VERSIONFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/cli.py", line 22, in <module>from .api.app import run_apiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/api/app.py", line 21, in <module>from ..chat import ChatModelFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/chat/__init__.py", line 16, in <module>from .chat_model import ChatModelFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/chat/chat_model.py", line 26, in <module>from .vllm_engine import VllmEngineFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/chat/vllm_engine.py", line 29, in <module>from vllm import AsyncEngineArgs, AsyncLLMEngine, RequestOutput, SamplingParamsFile "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/__init__.py", line 4, in <module>from vllm.engine.async_llm_engine import AsyncLLMEngineFile "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/engine/async_llm_engine.py", line 12, in <module>from vllm.engine.llm_engine import LLMEngineFile "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 16, in <module>from vllm.model_executor.model_loader import get_architecture_class_nameFile "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/model_executor/model_loader.py", line 10, in <module>from vllm.model_executor.models.llava import LlavaForConditionalGenerationFile "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/model_executor/models/llava.py", line 11, in <module>from vllm.model_executor.layers.activation import get_act_fnFile "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/vllm/model_executor/layers/activation.py", line 9, in <module>from vllm._C import ops
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

该问题的解决方法,请参考下文的FAQ。

Q:ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

查找 libcuda.so.1 文件:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# find / -name "libcuda.so.1"
find: '/proc/1/map_files': Operation not permitted
find: '/proc/13/map_files': Operation not permitted
find: '/proc/45/map_files': Operation not permitted
find: '/proc/116/map_files': Operation not permitted
find: '/proc/118/map_files': Operation not permitted
find: '/proc/120/map_files': Operation not permitted
find: '/proc/121/map_files': Operation not permitted
find: '/proc/5527/map_files': Operation not permitted
find: '/proc/5529/map_files': Operation not permitted
find: '/proc/5531/map_files': Operation not permitted
find: '/proc/6148/map_files': Operation not permitted
find: '/proc/24592/map_files': Operation not permitted
find: '/proc/24970/map_files': Operation not permitted
find: '/proc/24971/map_files': Operation not permitted

错误原因:没有找到该文件,猜测是vllm的版本问题。

解决方法:重新安装 llvm 0.4.3,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install vllm==0.4.3
...
Installing collected packages: triton, nvidia-nccl-cu12, torch, lm-format-enforcer, xformers, vllm-flash-attn, vllmAttempting uninstall: tritonFound existing installation: triton 2.1.0Uninstalling triton-2.1.0:Successfully uninstalled triton-2.1.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.18.1Uninstalling nvidia-nccl-cu12-2.18.1:Successfully uninstalled nvidia-nccl-cu12-2.18.1Attempting uninstall: torchFound existing installation: torch 2.1.2Uninstalling torch-2.1.2:Successfully uninstalled torch-2.1.2Attempting uninstall: lm-format-enforcerFound existing installation: lm-format-enforcer 0.9.8Uninstalling lm-format-enforcer-0.9.8:Successfully uninstalled lm-format-enforcer-0.9.8Attempting uninstall: xformersFound existing installation: xformers 0.0.23.post1Uninstalling xformers-0.0.23.post1:Successfully uninstalled xformers-0.0.23.post1Attempting uninstall: vllm-flash-attnFound existing installation: vllm-flash-attn 2.5.6Uninstalling vllm-flash-attn-2.5.6:Successfully uninstalled vllm-flash-attn-2.5.6Attempting uninstall: vllmFound existing installation: vllm 0.4.0Uninstalling vllm-0.4.0:Successfully uninstalled vllm-0.4.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.5.2.post1 requires torch<=2.2.2,>=2.0.0, but you have torch 2.3.0 which is incompatible.
lmdeploy 0.5.2.post1 requires triton<=2.2.0,>=2.1.0; sys_platform == "linux", but you have triton 2.3.0 which is incompatible.
Successfully installed lm-format-enforcer-0.10.1 nvidia-nccl-cu12-2.20.5 torch-2.3.0 triton-2.3.0 vllm-0.4.3 vllm-flash-attn-2.5.8.post2 xformers-0.0.26.post1

错误原因lmdeploy 0.5.2.post1torch 版本冲突,要求 torch<=2.2.2,>=2.0.0,而当前版本为torch 2.3.0lmdeploy 0.5.2.post1triton 版本冲突,要求 triton<=2.2.0,>=2.1.0,而当前版本为triton 2.3.0理论上,应该升级lmdeploy 版本以匹配torch版本,但是lmdeploy已经是最新版本了。因此,尝试降低lmdeploy版本

解决方法:将lmdeploy版本从 lmdeploy 0.5.2.post1 降低到 lmdeploy 0.5.0,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install lmdeploy==0.5.0
...
Installing collected packages: triton, nvidia-nccl-cu12, torch, lmdeployAttempting uninstall: tritonFound existing installation: triton 2.3.0Uninstalling triton-2.3.0:Successfully uninstalled triton-2.3.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.20.5Uninstalling nvidia-nccl-cu12-2.20.5:Successfully uninstalled nvidia-nccl-cu12-2.20.5Attempting uninstall: torchFound existing installation: torch 2.3.0Uninstalling torch-2.3.0:Successfully uninstalled torch-2.3.0Attempting uninstall: lmdeployFound existing installation: lmdeploy 0.5.2.post1Uninstalling lmdeploy-0.5.2.post1:Successfully uninstalled lmdeploy-0.5.2.post1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
vllm 0.4.3 requires torch==2.3.0, but you have torch 2.2.2 which is incompatible.
vllm-flash-attn 2.5.8.post2 requires torch==2.3.0, but you have torch 2.2.2 which is incompatible.
xformers 0.0.26.post1 requires torch==2.3.0, but you have torch 2.2.2 which is incompatible.

解决方法:将torch版本从 torch 2.2.2 升级到 torch 2.3.0,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install torch==2.3.0
...
Installing collected packages: triton, nvidia-nccl-cu12, torchAttempting uninstall: tritonFound existing installation: triton 2.2.0Uninstalling triton-2.2.0:Successfully uninstalled triton-2.2.0Attempting uninstall: nvidia-nccl-cu12Found existing installation: nvidia-nccl-cu12 2.19.3Uninstalling nvidia-nccl-cu12-2.19.3:Successfully uninstalled nvidia-nccl-cu12-2.19.3Attempting uninstall: torchFound existing installation: torch 2.2.2Uninstalling torch-2.2.2:Successfully uninstalled torch-2.2.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lmdeploy 0.5.0 requires torch<=2.2.2,>=2.0.0, but you have torch 2.3.0 which is incompatible.
lmdeploy 0.5.0 requires triton<=2.2.0,>=2.1.0; sys_platform == "linux", but you have triton 2.3.0 which is incompatible.
Successfully installed nvidia-nccl-cu12-2.20.5 torch-2.3.0 triton-2.3.0

解决方法:把lmdeploy版本从 lmdeploy 0.5.0 升级到 lmdeploy 0.5.1

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# pip install lmdeploy==0.5.1
...
Installing collected packages: lmdeployAttempting uninstall: lmdeployFound existing installation: lmdeploy 0.5.0Uninstalling lmdeploy-0.5.0:Successfully uninstalled lmdeploy-0.5.0
Successfully installed lmdeploy-0.5.1

lmdeploy-0.5.1 安装成功,且没有报错。

重新启动服务,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# python src/webui.py \
>     --model_name_or_path "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/models/Meta-Llama-3-8B-Instruct" \
>     --template llama3 \
>     --infer_backend vllm \
>     --vllm_enforce_eager
Traceback (most recent call last):File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/webui.py", line 17, in <module>from llamafactory.webui.interface import create_uiFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/__init__.py", line 38, in <module>from .cli import VERSIONFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/cli.py", line 21, in <module>from . import launcherFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/launcher.py", line 15, in <module>from llamafactory.train.tuner import run_expFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/train/tuner.py", line 25, in <module>from ..hparams import get_infer_args, get_train_argsFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/hparams/__init__.py", line 20, in <module>from .parser import get_eval_args, get_infer_args, get_train_argsFile "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/hparams/parser.py", line 45, in <module>check_dependencies()File "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/src/llamafactory/extras/misc.py", line 85, in check_dependenciesrequire_version("peft>=0.11.1", "To fix: pip install peft>=0.11.1")File "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 111, in require_version_compare_versions(op, got_ver, want_ver, requirement, pkg, hint)File "/opt/conda/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 44, in _compare_versionsraise ImportError(
ImportError: peft>=0.11.1 is required for a normal functioning of this module, but found peft==0.9.0.
To fix: pip install peft>=0.11.1

解决方法:升级 peft==0.11.1

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/cache# pip install peft==0.11.1
...
Installing collected packages: peftAttempting uninstall: peftFound existing installation: peft 0.9.0Uninstalling peft-0.9.0:Successfully uninstalled peft-0.9.0
Successfully installed peft-0.11.1

peft-0.11.1 安装成功,且没有报错。

重新启动服务,又出现新问题:

(llama_factory) root@notebook-1813389960667746306-scnlbe5oi5-17811:/public/home/scnlbe5oi5/Downloads/models/LLaMA-Facto
ry# python src/webui.py     --model_name_or_path "/public/home/scnlbe5oi5/Downloads/models/LLaMA-Factory/models/Meta-Llama-3-8B-Instruct"     --template llama3     --infer_backend vllm     --vllm_enforce_eager
No ROCm runtime is found, using ROCM_HOME='/opt/dtk'
/opt/conda/envs/llama_factory/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: 'libc10_hip.so: cannot open shared object file: No such file or directory'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?warn(
[2024-07-31 16:58:35,443] [INFO] [real_accelerator.py:158:get_accelerator] Setting ds_accelerator to cuda (auto detect)
gradio_share: False
Running on local URL:  http://127.0.0.1:7860Could not create share link. Missing file: /opt/conda/envs/llama_factory/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2.Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps:1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64
2. Rename the downloaded file to: frpc_linux_amd64_v0.2
3. Move the file to this location: /opt/conda/envs/llama_factory/lib/python3.10/site-packages/gradio

该问题的解决方法,请参考下文的FAQ。

Q. Could not create share link. Missing file:/PATH/TO/gradio/frpc_linux_amd64_v0.2

【Gradio】Could not create share link

在这里插入图片描述

Could not create share link. Missing file: /opt/conda/envs/llama_factory_torch/lib/python3.11/site-packages/gradio/frpc_linux_amd64_v0.2. Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: 1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64
2. Rename the downloaded file to: frpc_linux_amd64_v0.2
3. Move the file to this location: /opt/conda/envs/llama_factory_torch/lib/python3.11/site-packages/gradio
# 解决方法
1. 下载 https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd642. 重命名
mv frpc_linux_amd64 frpc_linux_amd64_v0.23. 移动到指定目录
cp frpc_linux_amd64_v0.2 /opt/conda/envs/llama_factory_torch/lib/python3.10/site-packages/gradio4. 修改权限
chmod +x /opt/conda/envs/llama_factory_torch/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2

Q. Could not create share link.. Please check your internet connection or our status page

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app

解决方法:修改 frpc_linux_amd64_v0.2文件权限。

chmod +x /opt/conda/envs/llama_factory_torch/lib/python3.11/site-packages/gradio/frpc_linux_amd64_v0.2

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/391896.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

计算机网络基础 - 计算机网络和因特网(2)

计算机网络基础 计算机网络和因特网Internet 结构和 ISP分组延时、丢失和吞吐量四种分组延时分组丢失吞吐量 协议层次及其服务模型概念数据单元&#xff08;DU&#xff09;协议栈TCP/IP 协议各层次的协议数据单元IOS/OSI 参考模型 计算机网络和因特网的历史早期计算机网路&…

自动驾驶的六个级别是什么?

自动驾驶汽车和先进的驾驶辅助系统&#xff08;ADAS&#xff09;预计将帮助拯救全球数百万人的生命&#xff0c;消除拥堵&#xff0c;减少排放&#xff0c;并使我们能够在人而不是汽车周围重建城市。 自动驾驶的世界并不只由一个维度组成。从没有任何自动化到完整的自主体验&a…

偷懒神器:auto 的讲解

1. auto 的定义 在c/c11之前&#xff0c;auto用来修饰局部变量&#xff0c;表明该变量是一个自动变量&#xff0c;函数结束后该变量销毁   c11中&#xff0c;赋予auto全新的含义。其中表示&#xff1a;auto不再是一个存储类型指示符&#xff0c;而是作为一个新的类型指示符来…

熊海1.0cmsPHP代码审计

熊海1.0cmsPHP代码审计 环境搭建 下载之后直接使用phpstduy搭建就好了 工具使用 比如使用seay审计系统 sql大多数是存在的&#xff0c;但是没有文件上传&#xff0c;这个就是需要自己去验证 漏洞审计 SQL注入 有点多&#xff0c;随便拿一个举例子 就比如我们的登录页面…

Ceres Cuda加速

文章目录 一、简介二、准备工作三、实现代码四、实现效果参考资料一、简介 字Ceres2.2.1版本之后,作者针对于稠密矩阵的分解计算等操作进行了Cuda加速,因此这里就基于此项改动测试一下效果。 二、准备工作 1、首先是需要安装Cuda这个英伟达第三方库,https://developer.nvidi…

日企的“目标式招聘”到底什么意思?

看到篇文章称&#xff1a;日企的目标式招聘&#xff0c;高效率招聘。这是什么意思呢&#xff1f;小编今天来跟大家讲一讲。 首先&#xff0c;日企的目标式招聘&#xff0c;其实企业也是迫不得已。一个大型企业的招聘负责人说&#xff1a;“以前我们都是认真地考察每一位应聘者&…

Vue 使用elementUI-plus el-calendar加 公历转农历 是否节假日 等

效果图&#xff1a; 1. 使用到自定文件 calendar.js /*** 1900-2100区间内的公历、农历互转* charset UTF-8* Author Jea杨(JJonlineJJonline.Cn)* Time 2014-7-21* Time 2016-8-13 Fixed 2033hex、Attribution Annals* Time 2016-9-25 Fixed lunar LeapMonth Param…

浏览器事件循环详解

1. 浏览器的进程模型 1.1. 何为进程&#xff1f; 程序运行需要有它自己的专属内存空间&#xff0c;可以把这块内存空间简单的理解为进程。 每个应用至少有一个进程&#xff0c;进程之间相互独立&#xff0c;即使要通信&#xff0c;也需要双方同意。 1.2. 何为线程&#xff1f…

NodeJS的安装【windows】

文章目录 1 安装包下载2 下载过程3 测试 1 安装包下载 Node.js中文网&#xff1a;https://nodejs.cn 2 下载过程 3 测试

【游戏引擎之路】登神长阶(八)——Python之旅行,休息一下,去看看新世界

5月20日-6月4日&#xff1a;攻克2D物理引擎。 6月4日-6月13日&#xff1a;攻克《3D数学基础》。 6月13日-6月20日&#xff1a;攻克《3D图形教程》。 6月21日-6月22日&#xff1a;攻克《Raycasting游戏教程》。 6月23日-7月1日&#xff1a;攻克《Windows游戏编程大师技巧》。 7月…

基于huggingface和langchain快速开发大模型应用

目录 一、HuggingFace. 2 1.1定义... 2 1.2活跃度... 2 1.3 工具集... 2 二、HuggingFace工具介绍... 3 2.1 Pipelines. 3 2.1.1定义... 3 2.1.2常见参数... 3 2.2、AutoClass. 4 2.2.1定义... 4 2.2.2 支持模型架构列表... 4 三、HuggingFace案例介绍... 4 3.1基…

Midjourney小技巧-提升出图质量的常用公式

一个公式让你的Midjourney生成更具韵味的人像身影图 step1-测试&#xff1a;输入提示词 - 一个面容精致的亚洲女性 - An Asian woman with a delicate face 生成的图片还是挺唯美的&#xff0c;就是过于单调&#xff0c;稀疏平常 step2-使用公式&#xff1a; 谁谁&#xff0…

flutter开发环境搭建与android studio 安装配置

flutter开发环境搭建与android studio 安装配置 安装 android studio 下载安装 Android Studio 开发工具 Android Studio官网安装的时看到配置路径就换成自己其他盘的路径即可&#xff0c;其他的一路下一步就ok安装完毕&#xff0c;运行打开缺少 android sdk 按照提示下载即可…

C++ 继承 派生类的运算符重载

C(二十二)派生类的运算符重载 语法赋值顺序引例1:当子类,不自实现赋值运算符函数重载时,默认调用父类的赋值运算符函数引例2:子类自实现赋值运算符函数重载,不做特殊处理时,只会调用父类的赋值运算符函数.引例3:子类自实现赋值运算符函数重载,在函数体内调用父类的赋值运算符函…

【leetcode】平衡二叉树、对称二叉树、二叉树的层序遍历(广度优先遍历)(详解)

Hi~&#xff01;这里是奋斗的明志&#xff0c;很荣幸您能阅读我的文章&#xff0c;诚请评论指点&#xff0c;欢迎欢迎 ~~ &#x1f331;&#x1f331;个人主页&#xff1a;奋斗的明志 &#x1f331;&#x1f331;所属专栏&#xff1a;数据结构、LeetCode专栏 &#x1f4da;本系…

【Qt】如何搭建Qt开发环境

Qt的开发工具 需要搭建Qt开发环境&#xff0c;需要安装3个部分&#xff1a; C编译器&#xff08;gcc、cl.exe...&#xff09;注意&#xff0c;这里的C编译器不是指visual studio这种集成开发环境&#xff0c;编译器不等于IDE&#xff0c;编译器只是IDE调用的一个程序。Qt SDK…

将本地的业务写成成可供RPC远程调用的方法

第一步&#xff1a;首先我们先定义proto文件&#xff0c;这些proto文件将会为远程调用者提供调用的方法&#xff0c;为login方法。 2.重写UserServiceRpc类中的Login方法。 在Login中做的操作主要是&#xff0c;得到requst里面的参数&#xff0c;然后调用本地的Login方法&#…

SQL注入 报错注入、文件上传、布尔盲注、时间盲注

第7关 文件上传 ---面试官常问 1、MySQL上传shell的满足条件 如果面试官问你如何通过MySQL向网站上传一个shell脚本或者其他语言的一些脚本 ---就可以通过outfile导出的方式进行上传&#xff1b; outfile导出的前提条件&#xff1a;1、必须知道网站的物理路径&#xf…

网络编程相关

关于ipv4和v6 ipv4小细节-------公网和私有地址 端口 InetAddress 协议 UDP、TCP UDP通信程序 发送&#xff08;单播&#xff09;&#xff1a; 接收&#xff08;单播&#xff09;&#xff1a; UDP三种通信方式 单播和广播代码几乎相同&#xff0c;就是将&#xff1a; InetAddr…

【JVM基础11】——垃圾回收-说一下JVM的分代回收?

目录 1- 引言&#xff1a;分代回收1-1 什么是分代回收&#xff08;What&#xff09;1-2 为什么要用分代回收&#xff1f;&#xff08;Why&#xff09; 2- ⭐核心&#xff1a;分代回收工作机制2-1 工作机制2-2 MinorGC、Mixed GC、FullGC的区别是什么 3- 总结3-1 说一下 JVM 的分…