LLaMaFasctory + Gradio配置的问题记录

参考视频:
【DeepSeek+LoRA+FastAPI】开发人员如何微调大模型并暴露接口给后端调用

按照博主的视频安装之后遇到一些问题,可能是博主使用的lunix , 而我使用的是windows又或是博主租用的服务器会有一些基础配置,所以按照步骤安装会报一些错误。

1. pip install -e ".[torch,metrics]"报错

  1. 查看.condarc配置文件,将default删除,替换成国内的镜像源
show_channel_urls: true
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
envs_dirs:
  - D:\Software\LLaMA-Factory
  - e:\llama-factory-domain

2. 运行llamafactory-cli webui报错

1. 提示`llamafactory-cli version

Traceback (most recent call last):llamafactory-cli version
Traceback (most recent call last):证明没有成功安装llamafactory,需要重新安装一下,这里需要注意,响应的版本安装最新版可能会发生版本不适配的情况pip install llama-factory=4.44.1 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple
`

2. 报错`File “D:\Software\LLaMA-Factory\LLaMA-Factory\lib\site-packages\httpx_transports\default.py”, line 153, in init

ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)

File “D:\Software\LLaMA-Factory\LLaMA-Factory\lib\site-packages\httpx_config.py”, line 35, in create_ssl_context
ctx = ssl.create_default_context(cafile=os.environ[“SSL_CERT_FILE”])
File “D:\Software\LLaMA-Factory\LLaMA-Factory\lib\ssl.py”, line 766, in create_default_context
context.load_verify_locations(cafile, capath, cadata)
FileNotFoundError: [Errno 2] No such file or directory`

- 手动设置正确的 SSL_CERT_FILE 环境变量,指向 Python 安装目录中的 cacert.pem 文件。
-  如果找不到 cacert.pem 文件,可以从 cURL 官方仓库下载并放置到正确的目录。
- 设置后还会出现找不到的情况,可以使用命令`echo %SSL_CERT_FILE% `查看实际的位置并通过`set SSL_CERT_FILE=C:\Python310\DLLs\cacert.pem`手动更改一下

3. `ERROR: Exception in ASGI application

Traceback (most recent call last): - 检查依赖,一般正常安装的话不会出现依赖问题,尝试通过pip install llama-factory=4.44.1 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple修改一下版本 - TypeError: argument of type ‘bool’ is not iterable
Traceback报错,在路径/src/llamafactory/webui/interface.py下将 global_share属性值修改为True`

LLaMa-Factory部署及llamafactory-cli webui命令无法打开ui界面问题解决记录

- 	` ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.`

是由于组件版本不一致导致,重新安装制定版本的组件即可`pip install pydantic==2.10.6`

4. 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_windows_amd64.exe
  2. Rename the downloaded file to: frpc_windows_amd64_v0.2
  3. Move the file to this location: D:\Software\LLaMA-Factory\LLaMA-Factory\lib\site-packages\gradio
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值