mirror of
				https://github.com/hiyouga/LLaMA-Factory.git
				synced 2025-11-04 18:02:19 +08:00 
			
		
		
		
	[misc] fix uv (#7913)
This commit is contained in:
		
							parent
							
								
									d4ee44bdef
								
							
						
					
					
						commit
						73198a6645
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -176,3 +176,4 @@ output/
 | 
			
		||||
wandb/
 | 
			
		||||
swanlog/
 | 
			
		||||
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>
 | 
			
		||||
 | 
			
		||||
> [!NOTE]
 | 
			
		||||
> If you cannot use the latest feature, please pull the latest code and install LLaMA-Factory again.
 | 
			
		||||
 | 
			
		||||
## Supported Models
 | 
			
		||||
 | 
			
		||||
| Model                                                             | Model size                       | Template            |
 | 
			
		||||
@ -463,7 +466,7 @@ cd LLaMA-Factory
 | 
			
		||||
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]
 | 
			
		||||
> 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>
 | 
			
		||||
 | 
			
		||||
> [!NOTE]
 | 
			
		||||
> 如果您无法使用最新的功能,请尝试重新拉取代码并再次安装 LLaMA-Factory。
 | 
			
		||||
 | 
			
		||||
## 模型
 | 
			
		||||
 | 
			
		||||
| 模型名                                                             | 参数量                            | Template            |
 | 
			
		||||
@ -466,7 +469,7 @@ cd LLaMA-Factory
 | 
			
		||||
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]
 | 
			
		||||
> 遇到包冲突时,可使用 `pip install --no-deps -e .` 解决。
 | 
			
		||||
 | 
			
		||||
@ -195,10 +195,11 @@ llamafactory-cli export examples/merge_lora/llama3_full_sft.yaml
 | 
			
		||||
 | 
			
		||||
### 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
 | 
			
		||||
@ -281,9 +282,3 @@ llamafactory-cli train examples/extras/llama_pro/llama3_freeze_sft.yaml
 | 
			
		||||
```bash
 | 
			
		||||
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 模型
 | 
			
		||||
 | 
			
		||||
#### 使用 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 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 = "vllm" },
 | 
			
		||||
    ],
 | 
			
		||||
    [
 | 
			
		||||
        { extra = "torch-npu" },
 | 
			
		||||
        { extra = "sglang" },
 | 
			
		||||
    ],
 | 
			
		||||
    [
 | 
			
		||||
        { extra = "vllm" },
 | 
			
		||||
        { extra = "sglang" },
 | 
			
		||||
    ],
 | 
			
		||||
    [
 | 
			
		||||
        { extra = "sglang" },
 | 
			
		||||
        { extra = "minicpm_v" },
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								setup.py
									
									
									
									
									
								
							@ -51,9 +51,8 @@ extra_require = {
 | 
			
		||||
    "hqq": ["hqq"],
 | 
			
		||||
    "eetq": ["eetq"],
 | 
			
		||||
    "gptq": ["optimum>=1.17.0", "auto-gptq>=0.5.0"],
 | 
			
		||||
    "awq": ["autoawq"],
 | 
			
		||||
    "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"],
 | 
			
		||||
    "galore": ["galore-torch"],
 | 
			
		||||
    "apollo": ["apollo-torch"],
 | 
			
		||||
 | 
			
		||||
@ -148,10 +148,10 @@ def _check_extra_dependencies(
 | 
			
		||||
        check_version("mixture-of-depth>=1.1.6", mandatory=True)
 | 
			
		||||
 | 
			
		||||
    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)
 | 
			
		||||
    elif model_args.infer_backend == EngineName.SGLANG:
 | 
			
		||||
        check_version("sglang>=0.4.4")
 | 
			
		||||
        check_version("sglang>=0.4.5")
 | 
			
		||||
        check_version("sglang", mandatory=True)
 | 
			
		||||
 | 
			
		||||
    if finetuning_args.use_galore:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user