mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-02 03:32:50 +08:00
[misc] fix uv (#7913)
This commit is contained in:
parent
072bfe29d3
commit
a8430f4244
1
.gitignore
vendored
1
.gitignore
vendored
@ -176,3 +176,4 @@ output/
|
|||||||
wandb/
|
wandb/
|
||||||
swanlog/
|
swanlog/
|
||||||
generated_predictions.jsonl
|
generated_predictions.jsonl
|
||||||
|
predictions_score.json
|
||||||
|
@ -233,6 +233,9 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> If you cannot use the latest feature, please pull the latest code and install LLaMA-Factory again.
|
||||||
|
|
||||||
## Supported Models
|
## Supported Models
|
||||||
|
|
||||||
| Model | Model size | Template |
|
| Model | Model size | Template |
|
||||||
@ -463,7 +466,7 @@ cd LLaMA-Factory
|
|||||||
pip install -e ".[torch,metrics]"
|
pip install -e ".[torch,metrics]"
|
||||||
```
|
```
|
||||||
|
|
||||||
Extra dependencies available: torch, torch-npu, metrics, deepspeed, liger-kernel, bitsandbytes, hqq, eetq, gptq, awq, aqlm, vllm, sglang, galore, apollo, badam, adam-mini, qwen, minicpm_v, modelscope, openmind, swanlab, quality
|
Extra dependencies available: torch, torch-npu, metrics, deepspeed, liger-kernel, bitsandbytes, hqq, eetq, gptq, aqlm, vllm, sglang, galore, apollo, badam, adam-mini, qwen, minicpm_v, modelscope, openmind, swanlab, quality
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> Use `pip install --no-deps -e .` to resolve package conflicts.
|
> Use `pip install --no-deps -e .` to resolve package conflicts.
|
||||||
|
@ -236,6 +236,9 @@ https://github.com/user-attachments/assets/43b700c6-a178-41db-b1f8-8190a5d3fcfc
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> 如果您无法使用最新的功能,请尝试重新拉取代码并再次安装 LLaMA-Factory。
|
||||||
|
|
||||||
## 模型
|
## 模型
|
||||||
|
|
||||||
| 模型名 | 参数量 | Template |
|
| 模型名 | 参数量 | Template |
|
||||||
@ -466,7 +469,7 @@ cd LLaMA-Factory
|
|||||||
pip install -e ".[torch,metrics]"
|
pip install -e ".[torch,metrics]"
|
||||||
```
|
```
|
||||||
|
|
||||||
可选的额外依赖项:torch、torch-npu、metrics、deepspeed、liger-kernel、bitsandbytes、hqq、eetq、gptq、awq、aqlm、vllm、sglang、galore、apollo、badam、adam-mini、qwen、minicpm_v、modelscope、openmind、swanlab、quality
|
可选的额外依赖项:torch、torch-npu、metrics、deepspeed、liger-kernel、bitsandbytes、hqq、eetq、gptq、aqlm、vllm、sglang、galore、apollo、badam、adam-mini、qwen、minicpm_v、modelscope、openmind、swanlab、quality
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> 遇到包冲突时,可使用 `pip install --no-deps -e .` 解决。
|
> 遇到包冲突时,可使用 `pip install --no-deps -e .` 解决。
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
Binary file not shown.
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 165 KiB |
@ -195,10 +195,11 @@ llamafactory-cli export examples/merge_lora/llama3_full_sft.yaml
|
|||||||
|
|
||||||
### Inferring LoRA Fine-Tuned Models
|
### Inferring LoRA Fine-Tuned Models
|
||||||
|
|
||||||
#### Batch Generation using vLLM Tensor Parallel
|
#### Evaluation using vLLM's Multi-GPU Inference
|
||||||
|
|
||||||
```
|
```
|
||||||
python scripts/vllm_infer.py --model_name_or_path path_to_merged_model --dataset alpaca_en_demo
|
python scripts/vllm_infer.py --model_name_or_path meta-llama/Meta-Llama-3-8B-Instruct --template llama3 --dataset alpaca_en_demo
|
||||||
|
python scripts/eval_bleu_rouge.py generated_predictions.jsonl
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Use CLI ChatBox
|
#### Use CLI ChatBox
|
||||||
@ -281,9 +282,3 @@ llamafactory-cli train examples/extras/llama_pro/llama3_freeze_sft.yaml
|
|||||||
```bash
|
```bash
|
||||||
bash examples/extras/fsdp_qlora/train.sh
|
bash examples/extras/fsdp_qlora/train.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Computing BLEU and ROUGE Scores
|
|
||||||
|
|
||||||
```bash
|
|
||||||
llamafactory-cli train examples/extras/nlg_eval/llama3_lora_predict.yaml
|
|
||||||
```
|
|
||||||
|
@ -195,10 +195,11 @@ llamafactory-cli export examples/merge_lora/llama3_full_sft.yaml
|
|||||||
|
|
||||||
### 推理 LoRA 模型
|
### 推理 LoRA 模型
|
||||||
|
|
||||||
#### 使用 vLLM+TP 批量推理
|
#### 使用 vLLM 多卡推理评估
|
||||||
|
|
||||||
```
|
```
|
||||||
python scripts/vllm_infer.py --model_name_or_path path_to_merged_model --dataset alpaca_en_demo
|
python scripts/vllm_infer.py --model_name_or_path meta-llama/Meta-Llama-3-8B-Instruct --template llama3 --dataset alpaca_en_demo
|
||||||
|
python scripts/eval_bleu_rouge.py generated_predictions.jsonl
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 使用命令行对话框
|
#### 使用命令行对话框
|
||||||
@ -281,9 +282,3 @@ llamafactory-cli train examples/extras/llama_pro/llama3_freeze_sft.yaml
|
|||||||
```bash
|
```bash
|
||||||
bash examples/extras/fsdp_qlora/train.sh
|
bash examples/extras/fsdp_qlora/train.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 计算 BLEU 和 ROUGE 分数
|
|
||||||
|
|
||||||
```bash
|
|
||||||
llamafactory-cli train examples/extras/nlg_eval/llama3_lora_predict.yaml
|
|
||||||
```
|
|
||||||
|
@ -88,6 +88,14 @@ conflicts = [
|
|||||||
{ extra = "torch-npu" },
|
{ extra = "torch-npu" },
|
||||||
{ extra = "vllm" },
|
{ extra = "vllm" },
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
{ extra = "torch-npu" },
|
||||||
|
{ extra = "sglang" },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ extra = "vllm" },
|
||||||
|
{ extra = "sglang" },
|
||||||
|
],
|
||||||
[
|
[
|
||||||
{ extra = "sglang" },
|
{ extra = "sglang" },
|
||||||
{ extra = "minicpm_v" },
|
{ extra = "minicpm_v" },
|
||||||
|
3
setup.py
3
setup.py
@ -51,9 +51,8 @@ extra_require = {
|
|||||||
"hqq": ["hqq"],
|
"hqq": ["hqq"],
|
||||||
"eetq": ["eetq"],
|
"eetq": ["eetq"],
|
||||||
"gptq": ["optimum>=1.17.0", "auto-gptq>=0.5.0"],
|
"gptq": ["optimum>=1.17.0", "auto-gptq>=0.5.0"],
|
||||||
"awq": ["autoawq"],
|
|
||||||
"aqlm": ["aqlm[gpu]>=1.1.0"],
|
"aqlm": ["aqlm[gpu]>=1.1.0"],
|
||||||
"vllm": ["vllm>=0.4.3,<=0.8.4"],
|
"vllm": ["vllm>=0.4.3,<=0.8.5"],
|
||||||
"sglang": ["sglang[srt]>=0.4.5", "transformers==4.51.1"],
|
"sglang": ["sglang[srt]>=0.4.5", "transformers==4.51.1"],
|
||||||
"galore": ["galore-torch"],
|
"galore": ["galore-torch"],
|
||||||
"apollo": ["apollo-torch"],
|
"apollo": ["apollo-torch"],
|
||||||
|
@ -148,10 +148,10 @@ def _check_extra_dependencies(
|
|||||||
check_version("mixture-of-depth>=1.1.6", mandatory=True)
|
check_version("mixture-of-depth>=1.1.6", mandatory=True)
|
||||||
|
|
||||||
if model_args.infer_backend == EngineName.VLLM:
|
if model_args.infer_backend == EngineName.VLLM:
|
||||||
check_version("vllm>=0.4.3,<=0.8.4")
|
check_version("vllm>=0.4.3,<=0.8.5")
|
||||||
check_version("vllm", mandatory=True)
|
check_version("vllm", mandatory=True)
|
||||||
elif model_args.infer_backend == EngineName.SGLANG:
|
elif model_args.infer_backend == EngineName.SGLANG:
|
||||||
check_version("sglang>=0.4.4")
|
check_version("sglang>=0.4.5")
|
||||||
check_version("sglang", mandatory=True)
|
check_version("sglang", mandatory=True)
|
||||||
|
|
||||||
if finetuning_args.use_galore:
|
if finetuning_args.use_galore:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user