LLaMA-Factory系列---【如何安装LLaMA-Factory?】

1.环境准备

1.1安装Python 3.10.11

可以在微软商店里安装。

1.2如果是英伟达的显卡推荐大家安装cuda11.8

官网下载地址:CUDA Toolkit Archive | NVIDIA Developer

1.3安装torch

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

1.4升级autoawq-kernels 0.0.7到0.0.9

pip uninstall -y autoawq-kernels

pip install -y autoawq-kernels==0.0.9

1.4查找python安装目录

打开cmd窗口

root> python
>>> import sys
>>> print(sys.executable)
C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe
>>>

1.5 配置python环境变量


1.6验证python环境是否准备成功

root> python
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.current_device()
0
>>> torch.cuda.get_device_name(0)
'NVIDIA GeForce GTX 1070'
>>> torch.__version__
'2.8.0.dev20250513+cu128'
>>>

2.安装LLaMa-Factory

git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
cd LLaMA-Factory
pip install -e ".[torch,metrics]" --no-build-isolation

2.1验证是否安装成功

#在LLaMA-Factory目录下执行
llamafactory-cli version

2.2启动LLaMA-Factory

启动比较慢,稍等一会,我的是英伟达1070显卡8G的,内存128G的,30s起来了

#在LLaMA-Factory目录下执行
llamafactory-cli webui

到这里就可以和模型聊天了,在最下面有一个大输入框,下面是提交,提交完你的问题,如果上面直接回答了,就说明模型加载成功。

posted on 2025-09-11 00:36  少年攻城狮  阅读(61)  评论(0)    收藏  举报

导航