Add metadata and paper link to model card
#1
by
nielsr
HF staff
- opened
README.md
CHANGED
@@ -1,5 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |

|
2 |
|
|
|
|
|
3 |
[](https://github.com/hiyouga/LLaMA-Factory/stargazers)
|
4 |
[](LICENSE)
|
5 |
[](https://github.com/hiyouga/LLaMA-Factory/commits/main)
|
@@ -119,7 +127,7 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/
|
|
119 |
|
120 |
[23/12/12] We supported fine-tuning the latest MoE model **[Mixtral 8x7B](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)** in our framework. See hardware requirement [here](#hardware-requirement).
|
121 |
|
122 |
-
[23/12/01] We supported downloading pre-trained models and datasets from the **[ModelScope Hub](https://modelscope.cn/models)
|
123 |
|
124 |
[23/10/21] We supported **[NEFTune](https://arxiv.org/abs/2310.05914)** trick for fine-tuning. Try `neftune_noise_alpha: 5` argument to activate NEFTune.
|
125 |
|
@@ -139,11 +147,11 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/
|
|
139 |
|
140 |
[23/07/18] We developed an **all-in-one Web UI** for training, evaluation and inference. Try `train_web.py` to fine-tune models in your Web browser. Thank [@KanadeSiina](https://github.com/KanadeSiina) and [@codemayq](https://github.com/codemayq) for their efforts in the development.
|
141 |
|
142 |
-
[23/07/09] We released **[FastEdit](https://github.com/hiyouga/FastEdit)**
|
143 |
|
144 |
[23/06/29] We provided a **reproducible example** of training a chat model using instruction-following datasets, see [Baichuan-7B-sft](https://huggingface.co/hiyouga/Baichuan-7B-sft) for details.
|
145 |
|
146 |
-
[23/06/22] We aligned the [demo API](src/api_demo.py) with the [OpenAI's](https://platform.openai.com/docs/api-reference/chat) format where you can insert the fine-tuned model in **arbitrary ChatGPT-based applications**.
|
147 |
|
148 |
[23/06/03] We supported quantized training and inference (aka **[QLoRA](https://github.com/artidoro/qlora)**). See [examples](examples/README.md) for usage.
|
149 |
|
@@ -257,19 +265,8 @@ You also can add a custom chat template to [template.py](src/llamafactory/data/t
|
|
257 |
- [STEM (zh)](https://huggingface.co/datasets/hfl/stem_zh_instruction)
|
258 |
- [Ruozhiba (zh)](https://huggingface.co/datasets/hfl/ruozhiba_gpt4_turbo)
|
259 |
- [Neo-sft (zh)](https://huggingface.co/datasets/m-a-p/neo_sft_phase2)
|
260 |
-
- [WebInstructSub (en)](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub)
|
261 |
- [Magpie-Pro-300K-Filtered (en)](https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-300K-Filtered)
|
262 |
-
- [
|
263 |
-
- [Open Assistant (de)](https://huggingface.co/datasets/mayflowergmbh/oasst_de)
|
264 |
-
- [Dolly 15k (de)](https://huggingface.co/datasets/mayflowergmbh/dolly-15k_de)
|
265 |
-
- [Alpaca GPT4 (de)](https://huggingface.co/datasets/mayflowergmbh/alpaca-gpt4_de)
|
266 |
-
- [OpenSchnabeltier (de)](https://huggingface.co/datasets/mayflowergmbh/openschnabeltier_de)
|
267 |
-
- [Evol Instruct (de)](https://huggingface.co/datasets/mayflowergmbh/evol-instruct_de)
|
268 |
-
- [Dolphin (de)](https://huggingface.co/datasets/mayflowergmbh/dolphin_de)
|
269 |
-
- [Booksum (de)](https://huggingface.co/datasets/mayflowergmbh/booksum_de)
|
270 |
-
- [Airoboros (de)](https://huggingface.co/datasets/mayflowergmbh/airoboros-3.0_de)
|
271 |
-
- [Ultrachat (de)](https://huggingface.co/datasets/mayflowergmbh/ultra-chat_de)
|
272 |
-
|
273 |
</details>
|
274 |
|
275 |
<details><summary>Preference datasets</summary>
|
@@ -322,324 +319,4 @@ huggingface-cli login
|
|
322 |
| Freeze | 16 | 20GB | 40GB | 80GB | 200GB | 360GB | 160GB | 400GB |
|
323 |
| LoRA/GaLore/BAdam | 16 | 16GB | 32GB | 64GB | 160GB | 240GB | 120GB | 320GB |
|
324 |
| QLoRA | 8 | 10GB | 20GB | 40GB | 80GB | 140GB | 60GB | 160GB |
|
325 |
-
| QLoRA | 4 | 6GB | 12GB | 24GB | 48GB | 72GB | 30GB | 96GB |
|
326 |
-
| QLoRA | 2 | 4GB | 8GB | 16GB | 24GB | 48GB | 18GB | 48GB |
|
327 |
-
|
328 |
-
## Getting Started
|
329 |
-
|
330 |
-
### Installation
|
331 |
-
|
332 |
-
> [!IMPORTANT]
|
333 |
-
> Installation is mandatory.
|
334 |
-
|
335 |
-
```bash
|
336 |
-
git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
|
337 |
-
cd LLaMA-Factory
|
338 |
-
pip install -e ".[torch,metrics]"
|
339 |
-
```
|
340 |
-
|
341 |
-
Extra dependencies available: torch, torch-npu, metrics, deepspeed, bitsandbytes, hqq, eetq, gptq, awq, aqlm, vllm, galore, badam, qwen, modelscope, quality
|
342 |
-
|
343 |
-
> [!TIP]
|
344 |
-
> Use `pip install --no-deps -e .` to resolve package conflicts.
|
345 |
-
|
346 |
-
<details><summary>For Windows users</summary>
|
347 |
-
|
348 |
-
If you want to enable the quantized LoRA (QLoRA) on the Windows platform, you need to install a pre-built version of `bitsandbytes` library, which supports CUDA 11.1 to 12.2, please select the appropriate [release version](https://github.com/jllllll/bitsandbytes-windows-webui/releases/tag/wheels) based on your CUDA version.
|
349 |
-
|
350 |
-
```bash
|
351 |
-
pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.2.post2-py3-none-win_amd64.whl
|
352 |
-
```
|
353 |
-
|
354 |
-
To enable FlashAttention-2 on the Windows platform, you need to install the precompiled `flash-attn` library, which supports CUDA 12.1 to 12.2. Please download the corresponding version from [flash-attention](https://github.com/bdashore3/flash-attention/releases) based on your requirements.
|
355 |
-
|
356 |
-
</details>
|
357 |
-
|
358 |
-
<details><summary>For Ascend NPU users</summary>
|
359 |
-
|
360 |
-
To install LLaMA Factory on Ascend NPU devices, please specify extra dependencies: `pip install -e ".[torch-npu,metrics]"`. Additionally, you need to install the **[Ascend CANN Toolkit and Kernels](https://www.hiascend.com/developer/download/community/result?module=cann)**. Please follow the [installation tutorial](https://www.hiascend.com/document/detail/en/CANNCommunityEdition/600alphaX/softwareinstall/instg/atlasdeploy_03_0031.html) or use the following commands:
|
361 |
-
|
362 |
-
```bash
|
363 |
-
# replace the url according to your CANN version and devices
|
364 |
-
# install CANN Toolkit
|
365 |
-
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C17SPC701/Ascend-cann-toolkit_8.0.RC1.alpha001_linux-"$(uname -i)".run
|
366 |
-
bash Ascend-cann-toolkit_8.0.RC1.alpha001_linux-"$(uname -i)".run --install
|
367 |
-
|
368 |
-
# install CANN Kernels
|
369 |
-
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C17SPC701/Ascend-cann-kernels-910b_8.0.RC1.alpha001_linux.run
|
370 |
-
bash Ascend-cann-kernels-910b_8.0.RC1.alpha001_linux.run --install
|
371 |
-
|
372 |
-
# set env variables
|
373 |
-
source /usr/local/Ascend/ascend-toolkit/set_env.sh
|
374 |
-
```
|
375 |
-
|
376 |
-
| Requirement | Minimum | Recommend |
|
377 |
-
| ------------ | ------- | ----------- |
|
378 |
-
| CANN | 8.0.RC1 | 8.0.RC1 |
|
379 |
-
| torch | 2.1.0 | 2.1.0 |
|
380 |
-
| torch-npu | 2.1.0 | 2.1.0.post3 |
|
381 |
-
| deepspeed | 0.13.2 | 0.13.2 |
|
382 |
-
|
383 |
-
Remember to use `ASCEND_RT_VISIBLE_DEVICES` instead of `CUDA_VISIBLE_DEVICES` to specify the device to use.
|
384 |
-
|
385 |
-
If you cannot infer model on NPU devices, try setting `do_sample: false` in the configurations.
|
386 |
-
|
387 |
-
Download the pre-built Docker images: [32GB](http://mirrors.cn-central-221.ovaijisuan.com/detail/130.html) | [64GB](http://mirrors.cn-central-221.ovaijisuan.com/detail/131.html)
|
388 |
-
|
389 |
-
</details>
|
390 |
-
|
391 |
-
### Data Preparation
|
392 |
-
|
393 |
-
Please refer to [data/README.md](data/README.md) for checking the details about the format of dataset files. You can either use datasets on HuggingFace / ModelScope hub or load the dataset in local disk.
|
394 |
-
|
395 |
-
> [!NOTE]
|
396 |
-
> Please update `data/dataset_info.json` to use your custom dataset.
|
397 |
-
|
398 |
-
### Quickstart
|
399 |
-
|
400 |
-
Use the following 3 commands to run LoRA **fine-tuning**, **inference** and **merging** of the Llama3-8B-Instruct model, respectively.
|
401 |
-
|
402 |
-
```bash
|
403 |
-
llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
404 |
-
llamafactory-cli chat examples/inference/llama3_lora_sft.yaml
|
405 |
-
llamafactory-cli export examples/merge_lora/llama3_lora_sft.yaml
|
406 |
-
```
|
407 |
-
|
408 |
-
See [examples/README.md](examples/README.md) for advanced usage (including distributed training).
|
409 |
-
|
410 |
-
> [!TIP]
|
411 |
-
> Use `llamafactory-cli help` to show help information.
|
412 |
-
|
413 |
-
### Fine-Tuning with LLaMA Board GUI (powered by [Gradio](https://github.com/gradio-app/gradio))
|
414 |
-
|
415 |
-
```bash
|
416 |
-
llamafactory-cli webui
|
417 |
-
```
|
418 |
-
|
419 |
-
### Build Docker
|
420 |
-
|
421 |
-
For CUDA users:
|
422 |
-
|
423 |
-
```bash
|
424 |
-
cd docker/docker-cuda/
|
425 |
-
docker-compose up -d
|
426 |
-
docker-compose exec llamafactory bash
|
427 |
-
```
|
428 |
-
|
429 |
-
For Ascend NPU users:
|
430 |
-
|
431 |
-
```bash
|
432 |
-
cd docker/docker-npu/
|
433 |
-
docker-compose up -d
|
434 |
-
docker-compose exec llamafactory bash
|
435 |
-
```
|
436 |
-
|
437 |
-
<details><summary>Build without Docker Compose</summary>
|
438 |
-
|
439 |
-
For CUDA users:
|
440 |
-
|
441 |
-
```bash
|
442 |
-
docker build -f ./docker/docker-cuda/Dockerfile \
|
443 |
-
--build-arg INSTALL_BNB=false \
|
444 |
-
--build-arg INSTALL_VLLM=false \
|
445 |
-
--build-arg INSTALL_DEEPSPEED=false \
|
446 |
-
--build-arg INSTALL_FLASHATTN=false \
|
447 |
-
--build-arg PIP_INDEX=https://pypi.org/simple \
|
448 |
-
-t llamafactory:latest .
|
449 |
-
|
450 |
-
docker run -dit --gpus=all \
|
451 |
-
-v ./hf_cache:/root/.cache/huggingface \
|
452 |
-
-v ./ms_cache:/root/.cache/modelscope \
|
453 |
-
-v ./data:/app/data \
|
454 |
-
-v ./output:/app/output \
|
455 |
-
-p 7860:7860 \
|
456 |
-
-p 8000:8000 \
|
457 |
-
--shm-size 16G \
|
458 |
-
--name llamafactory \
|
459 |
-
llamafactory:latest
|
460 |
-
|
461 |
-
docker exec -it llamafactory bash
|
462 |
-
```
|
463 |
-
|
464 |
-
For Ascend NPU users:
|
465 |
-
|
466 |
-
```bash
|
467 |
-
# Choose docker image upon your environment
|
468 |
-
docker build -f ./docker/docker-npu/Dockerfile \
|
469 |
-
--build-arg INSTALL_DEEPSPEED=false \
|
470 |
-
--build-arg PIP_INDEX=https://pypi.org/simple \
|
471 |
-
-t llamafactory:latest .
|
472 |
-
|
473 |
-
# Change `device` upon your resources
|
474 |
-
docker run -dit \
|
475 |
-
-v ./hf_cache:/root/.cache/huggingface \
|
476 |
-
-v ./ms_cache:/root/.cache/modelscope \
|
477 |
-
-v ./data:/app/data \
|
478 |
-
-v ./output:/app/output \
|
479 |
-
-v /usr/local/dcmi:/usr/local/dcmi \
|
480 |
-
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
|
481 |
-
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
|
482 |
-
-v /etc/ascend_install.info:/etc/ascend_install.info \
|
483 |
-
-p 7860:7860 \
|
484 |
-
-p 8000:8000 \
|
485 |
-
--device /dev/davinci0 \
|
486 |
-
--device /dev/davinci_manager \
|
487 |
-
--device /dev/devmm_svm \
|
488 |
-
--device /dev/hisi_hdc \
|
489 |
-
--shm-size 16G \
|
490 |
-
--name llamafactory \
|
491 |
-
llamafactory:latest
|
492 |
-
|
493 |
-
docker exec -it llamafactory bash
|
494 |
-
```
|
495 |
-
|
496 |
-
</details>
|
497 |
-
|
498 |
-
<details><summary>Details about volume</summary>
|
499 |
-
|
500 |
-
- hf_cache: Utilize Hugging Face cache on the host machine. Reassignable if a cache already exists in a different directory.
|
501 |
-
- data: Place datasets on this dir of the host machine so that they can be selected on LLaMA Board GUI.
|
502 |
-
- output: Set export dir to this location so that the merged result can be accessed directly on the host machine.
|
503 |
-
|
504 |
-
</details>
|
505 |
-
|
506 |
-
### Deploy with OpenAI-style API and vLLM
|
507 |
-
|
508 |
-
```bash
|
509 |
-
API_PORT=8000 llamafactory-cli api examples/inference/llama3_vllm.yaml
|
510 |
-
```
|
511 |
-
|
512 |
-
> [!TIP]
|
513 |
-
> Visit https://platform.openai.com/docs/api-reference/chat/create for API document.
|
514 |
-
|
515 |
-
### Download from ModelScope Hub
|
516 |
-
|
517 |
-
If you have trouble with downloading models and datasets from Hugging Face, you can use ModelScope.
|
518 |
-
|
519 |
-
```bash
|
520 |
-
export USE_MODELSCOPE_HUB=1 # `set USE_MODELSCOPE_HUB=1` for Windows
|
521 |
-
```
|
522 |
-
|
523 |
-
Train the model by specifying a model ID of the ModelScope Hub as the `model_name_or_path`. You can find a full list of model IDs at [ModelScope Hub](https://modelscope.cn/models), e.g., `LLM-Research/Meta-Llama-3-8B-Instruct`.
|
524 |
-
|
525 |
-
### Use W&B Logger
|
526 |
-
|
527 |
-
To use [Weights & Biases](https://wandb.ai) for logging experimental results, you need to add the following arguments to yaml files.
|
528 |
-
|
529 |
-
```yaml
|
530 |
-
report_to: wandb
|
531 |
-
run_name: test_run # optional
|
532 |
-
```
|
533 |
-
|
534 |
-
Set `WANDB_API_KEY` to [your key](https://wandb.ai/authorize) when launching training tasks to log in with your W&B account.
|
535 |
-
|
536 |
-
## Projects using LLaMA Factory
|
537 |
-
|
538 |
-
If you have a project that should be incorporated, please contact via email or create a pull request.
|
539 |
-
|
540 |
-
<details><summary>Click to show</summary>
|
541 |
-
|
542 |
-
1. Wang et al. ESRL: Efficient Sampling-based Reinforcement Learning for Sequence Generation. 2023. [[arxiv]](https://arxiv.org/abs/2308.02223)
|
543 |
-
1. Yu et al. Open, Closed, or Small Language Models for Text Classification? 2023. [[arxiv]](https://arxiv.org/abs/2308.10092)
|
544 |
-
1. Wang et al. UbiPhysio: Support Daily Functioning, Fitness, and Rehabilitation with Action Understanding and Feedback in Natural Language. 2023. [[arxiv]](https://arxiv.org/abs/2308.10526)
|
545 |
-
1. Luceri et al. Leveraging Large Language Models to Detect Influence Campaigns in Social Media. 2023. [[arxiv]](https://arxiv.org/abs/2311.07816)
|
546 |
-
1. Zhang et al. Alleviating Hallucinations of Large Language Models through Induced Hallucinations. 2023. [[arxiv]](https://arxiv.org/abs/2312.15710)
|
547 |
-
1. Wang et al. Know Your Needs Better: Towards Structured Understanding of Marketer Demands with Analogical Reasoning Augmented LLMs. KDD 2024. [[arxiv]](https://arxiv.org/abs/2401.04319)
|
548 |
-
1. Wang et al. CANDLE: Iterative Conceptualization and Instantiation Distillation from Large Language Models for Commonsense Reasoning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2401.07286)
|
549 |
-
1. Choi et al. FACT-GPT: Fact-Checking Augmentation via Claim Matching with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2402.05904)
|
550 |
-
1. Zhang et al. AutoMathText: Autonomous Data Selection with Language Models for Mathematical Texts. 2024. [[arxiv]](https://arxiv.org/abs/2402.07625)
|
551 |
-
1. Lyu et al. KnowTuning: Knowledge-aware Fine-tuning for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11176)
|
552 |
-
1. Yang et al. LaCo: Large Language Model Pruning via Layer Collaps. 2024. [[arxiv]](https://arxiv.org/abs/2402.11187)
|
553 |
-
1. Bhardwaj et al. Language Models are Homer Simpson! Safety Re-Alignment of Fine-tuned Language Models through Task Arithmetic. 2024. [[arxiv]](https://arxiv.org/abs/2402.11746)
|
554 |
-
1. Yang et al. Enhancing Empathetic Response Generation by Augmenting LLMs with Small-scale Empathetic Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11801)
|
555 |
-
1. Yi et al. Generation Meets Verification: Accelerating Large Language Model Inference with Smart Parallel Auto-Correct Decoding. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2402.11809)
|
556 |
-
1. Cao et al. Head-wise Shareable Attention for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11819)
|
557 |
-
1. Zhang et al. Enhancing Multilingual Capabilities of Large Language Models through Self-Distillation from Resource-Rich Languages. 2024. [[arxiv]](https://arxiv.org/abs/2402.12204)
|
558 |
-
1. Kim et al. Efficient and Effective Vocabulary Expansion Towards Multilingual Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.14714)
|
559 |
-
1. Yu et al. KIEval: A Knowledge-grounded Interactive Evaluation Framework for Large Language Models. ACL 2024. [[arxiv]](https://arxiv.org/abs/2402.15043)
|
560 |
-
1. Huang et al. Key-Point-Driven Data Synthesis with its Enhancement on Mathematical Reasoning. 2024. [[arxiv]](https://arxiv.org/abs/2403.02333)
|
561 |
-
1. Duan et al. Negating Negatives: Alignment without Human Positive Samples via Distributional Dispreference Optimization. 2024. [[arxiv]](https://arxiv.org/abs/2403.03419)
|
562 |
-
1. Xie and Schwertfeger. Empowering Robotics with Large Language Models: osmAG Map Comprehension with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2403.08228)
|
563 |
-
1. Wu et al. Large Language Models are Parallel Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2403.09073)
|
564 |
-
1. Zhang et al. EDT: Improving Large Language Models' Generation by Entropy-based Dynamic Temperature Sampling. 2024. [[arxiv]](https://arxiv.org/abs/2403.14541)
|
565 |
-
1. Weller et al. FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions. 2024. [[arxiv]](https://arxiv.org/abs/2403.15246)
|
566 |
-
1. Hongbin Na. CBT-LLM: A Chinese Large Language Model for Cognitive Behavioral Therapy-based Mental Health Question Answering. COLING 2024. [[arxiv]](https://arxiv.org/abs/2403.16008)
|
567 |
-
1. Zan et al. CodeS: Natural Language to Code Repository via Multi-Layer Sketch. 2024. [[arxiv]](https://arxiv.org/abs/2403.16443)
|
568 |
-
1. Liu et al. Extensive Self-Contrast Enables Feedback-Free Language Model Alignment. 2024. [[arxiv]](https://arxiv.org/abs/2404.00604)
|
569 |
-
1. Luo et al. BAdam: A Memory Efficient Full Parameter Training Method for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.02827)
|
570 |
-
1. Du et al. Chinese Tiny LLM: Pretraining a Chinese-Centric Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2404.04167)
|
571 |
-
1. Ma et al. Parameter Efficient Quasi-Orthogonal Fine-Tuning via Givens Rotation. ICML 2024. [[arxiv]](https://arxiv.org/abs/2404.04316)
|
572 |
-
1. Liu et al. Dynamic Generation of Personalities with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.07084)
|
573 |
-
1. Shang et al. How Far Have We Gone in Stripped Binary Code Understanding Using Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.09836)
|
574 |
-
1. Huang et al. LLMTune: Accelerate Database Knob Tuning with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.11581)
|
575 |
-
1. Deng et al. Text-Tuple-Table: Towards Information Integration in Text-to-Table Generation via Global Tuple Extraction. 2024. [[arxiv]](https://arxiv.org/abs/2404.14215)
|
576 |
-
1. Acikgoz et al. Hippocrates: An Open-Source Framework for Advancing Large Language Models in Healthcare. 2024. [[arxiv]](https://arxiv.org/abs/2404.16621)
|
577 |
-
1. Zhang et al. Small Language Models Need Strong Verifiers to Self-Correct Reasoning. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2404.17140)
|
578 |
-
1. Zhou et al. FREB-TQA: A Fine-Grained Robustness Evaluation Benchmark for Table Question Answering. NAACL 2024. [[arxiv]](https://arxiv.org/abs/2404.18585)
|
579 |
-
1. Xu et al. Large Language Models for Cyber Security: A Systematic Literature Review. 2024. [[arxiv]](https://arxiv.org/abs/2405.04760)
|
580 |
-
1. Dammu et al. "They are uncultured": Unveiling Covert Harms and Social Threats in LLM Generated Conversations. 2024. [[arxiv]](https://arxiv.org/abs/2405.05378)
|
581 |
-
1. Yi et al. A safety realignment framework via subspace-oriented model fusion for large language models. 2024. [[arxiv]](https://arxiv.org/abs/2405.09055)
|
582 |
-
1. Lou et al. SPO: Multi-Dimensional Preference Sequential Alignment With Implicit Reward Modeling. 2024. [[arxiv]](https://arxiv.org/abs/2405.12739)
|
583 |
-
1. Zhang et al. Getting More from Less: Large Language Models are Good Spontaneous Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2405.13816)
|
584 |
-
1. Zhang et al. TS-Align: A Teacher-Student Collaborative Framework for Scalable Iterative Finetuning of Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2405.20215)
|
585 |
-
1. Zihong Chen. Sentence Segmentation and Sentence Punctuation Based on XunziALLM. 2024. [[paper]](https://aclanthology.org/2024.lt4hala-1.30)
|
586 |
-
1. Gao et al. The Best of Both Worlds: Toward an Honest and Helpful Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2406.00380)
|
587 |
-
1. Wang and Song. MARS: Benchmarking the Metaphysical Reasoning Abilities of Language Models with a Multi-task Evaluation Dataset. 2024. [[arxiv]](https://arxiv.org/abs/2406.02106)
|
588 |
-
1. Hu et al. Computational Limits of Low-Rank Adaptation (LoRA) for Transformer-Based Models. 2024. [[arxiv]](https://arxiv.org/abs/2406.03136)
|
589 |
-
1. Ge et al. Time Sensitive Knowledge Editing through Efficient Finetuning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2406.04496)
|
590 |
-
1. Tan et al. Peer Review as A Multi-Turn and Long-Context Dialogue with Role-Based Interactions. 2024. [[arxiv]](https://arxiv.org/abs/2406.05688)
|
591 |
-
1. Song et al. Turbo Sparse: Achieving LLM SOTA Performance with Minimal Activated Parameters. 2024. [[arxiv]](https://arxiv.org/abs/2406.05955)
|
592 |
-
1. Gu et al. RWKV-CLIP: A Robust Vision-Language Representation Learner. 2024. [[arxiv]](https://arxiv.org/abs/2406.06973)
|
593 |
-
1. Chen et al. Advancing Tool-Augmented Large Language Models: Integrating Insights from Errors in Inference Trees. 2024. [[arxiv]](https://arxiv.org/abs/2406.07115)
|
594 |
-
1. Zhu et al. Are Large Language Models Good Statisticians?. 2024. [[arxiv]](https://arxiv.org/abs/2406.07815)
|
595 |
-
1. Li et al. Know the Unknown: An Uncertainty-Sensitive Method for LLM Instruction Tuning. 2024. [[arxiv]](https://arxiv.org/abs/2406.10099)
|
596 |
-
1. Ding et al. IntentionQA: A Benchmark for Evaluating Purchase Intention Comprehension Abilities of Language Models in E-commerce. 2024. [[arxiv]](https://arxiv.org/abs/2406.10173)
|
597 |
-
1. He et al. COMMUNITY-CROSS-INSTRUCT: Unsupervised Instruction Generation for Aligning Large Language Models to Online Communities. 2024. [[arxiv]](https://arxiv.org/abs/2406.12074)
|
598 |
-
1. Lin et al. FVEL: Interactive Formal Verification Environment with Large Language Models via Theorem Proving. 2024. [[arxiv]](https://arxiv.org/abs/2406.14408)
|
599 |
-
1. Treutlein et al. Connecting the Dots: LLMs can Infer and Verbalize Latent Structure from Disparate Training Data. 2024. [[arxiv]](https://arxiv.org/abs/2406.14546)
|
600 |
-
1. Feng et al. SS-Bench: A Benchmark for Social Story Generation and Evaluation. 2024. [[arxiv]](https://arxiv.org/abs/2406.15695)
|
601 |
-
1. Feng et al. Self-Constructed Context Decompilation with Fined-grained Alignment Enhancement. 2024. [[arxiv]](https://arxiv.org/abs/2406.17233)
|
602 |
-
1. Liu et al. Large Language Models for Cuffless Blood Pressure Measurement From Wearable Biosignals. 2024. [[arxiv]](https://arxiv.org/abs/2406.18069)
|
603 |
-
1. Iyer et al. Exploring Very Low-Resource Translation with LLMs: The University of Edinburgh’s Submission to AmericasNLP 2024 Translation Task. AmericasNLP 2024. [[paper]](https://aclanthology.org/2024.americasnlp-1.25)
|
604 |
-
1. **[StarWhisper](https://github.com/Yu-Yang-Li/StarWhisper)**: A large language model for Astronomy, based on ChatGLM2-6B and Qwen-14B.
|
605 |
-
1. **[DISC-LawLLM](https://github.com/FudanDISC/DISC-LawLLM)**: A large language model specialized in Chinese legal domain, based on Baichuan-13B, is capable of retrieving and reasoning on legal knowledge.
|
606 |
-
1. **[Sunsimiao](https://github.com/X-D-Lab/Sunsimiao)**: A large language model specialized in Chinese medical domain, based on Baichuan-7B and ChatGLM-6B.
|
607 |
-
1. **[CareGPT](https://github.com/WangRongsheng/CareGPT)**: A series of large language models for Chinese medical domain, based on LLaMA2-7B and Baichuan-13B.
|
608 |
-
1. **[MachineMindset](https://github.com/PKU-YuanGroup/Machine-Mindset/)**: A series of MBTI Personality large language models, capable of giving any LLM 16 different personality types based on different datasets and training methods.
|
609 |
-
1. **[Luminia-13B-v3](https://huggingface.co/Nekochu/Luminia-13B-v3)**: A large language model specialized in generate metadata for stable diffusion. [[🤗Demo]](https://huggingface.co/spaces/Nekochu/Luminia-13B_SD_Prompt)
|
610 |
-
1. **[Chinese-LLaVA-Med](https://github.com/BUAADreamer/Chinese-LLaVA-Med)**: A multimodal large language model specialized in Chinese medical domain, based on LLaVA-1.5-7B.
|
611 |
-
1. **[AutoRE](https://github.com/THUDM/AutoRE)**: A document-level relation extraction system based on large language models.
|
612 |
-
1. **[NVIDIA RTX AI Toolkit](https://github.com/NVIDIA/RTX-AI-Toolkit)**: SDKs for fine-tuning LLMs on Windows PC for NVIDIA RTX.
|
613 |
-
1. **[LazyLLM](https://github.com/LazyAGI/LazyLLM)**: An easy and lazy way for building multi-agent LLMs applications and supports model fine-tuning via LLaMA Factory.
|
614 |
-
|
615 |
-
</details>
|
616 |
-
|
617 |
-
## License
|
618 |
-
|
619 |
-
This repository is licensed under the [Apache-2.0 License](LICENSE).
|
620 |
-
|
621 |
-
Please follow the model licenses to use the corresponding model weights: [Baichuan 2](https://huggingface.co/baichuan-inc/Baichuan2-7B-Base/blob/main/Community%20License%20for%20Baichuan%202%20Model.pdf) / [BLOOM](https://huggingface.co/spaces/bigscience/license) / [ChatGLM3](https://github.com/THUDM/ChatGLM3/blob/main/MODEL_LICENSE) / [Command R](https://cohere.com/c4ai-cc-by-nc-license) / [DeepSeek](https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/LICENSE-MODEL) / [Falcon](https://huggingface.co/tiiuae/falcon-180B/blob/main/LICENSE.txt) / [Gemma](https://ai.google.dev/gemma/terms) / [GLM-4](https://huggingface.co/THUDM/glm-4-9b/blob/main/LICENSE) / [InternLM2](https://github.com/InternLM/InternLM#license) / [Llama](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) / [Llama 2 (LLaVA-1.5)](https://ai.meta.com/llama/license/) / [Llama 3](https://llama.meta.com/llama3/license/) / [Mistral](LICENSE) / [OLMo](LICENSE) / [Phi-1.5/Phi-2](https://huggingface.co/microsoft/phi-1_5/resolve/main/Research%20License.docx) / [Phi-3](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/blob/main/LICENSE) / [Qwen](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) / [StarCoder 2](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement) / [XVERSE](https://github.com/xverse-ai/XVERSE-13B/blob/main/MODEL_LICENSE.pdf) / [Yi](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE) / [Yi-1.5](LICENSE) / [Yuan 2](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/LICENSE-Yuan)
|
622 |
-
|
623 |
-
## Citation
|
624 |
-
|
625 |
-
If this work is helpful, please kindly cite as:
|
626 |
-
|
627 |
-
```bibtex
|
628 |
-
@inproceedings{zheng2024llamafactory,
|
629 |
-
title={LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models},
|
630 |
-
author={Yaowei Zheng and Richong Zhang and Junhao Zhang and Yanhan Ye and Zheyan Luo and Zhangchi Feng and Yongqiang Ma},
|
631 |
-
booktitle={Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)},
|
632 |
-
address={Bangkok, Thailand},
|
633 |
-
publisher={Association for Computational Linguistics},
|
634 |
-
year={2024},
|
635 |
-
url={http://arxiv.org/abs/2403.13372}
|
636 |
-
}
|
637 |
-
```
|
638 |
-
|
639 |
-
## Acknowledgement
|
640 |
-
|
641 |
-
This repo benefits from [PEFT](https://github.com/huggingface/peft), [TRL](https://github.com/huggingface/trl), [QLoRA](https://github.com/artidoro/qlora) and [FastChat](https://github.com/lm-sys/FastChat). Thanks for their wonderful works.
|
642 |
-
|
643 |
-
## Star History
|
644 |
-
|
645 |
-

|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
library_name: transformers
|
4 |
+
pipeline_tag: text-generation
|
5 |
+
---
|
6 |
+
|
7 |

|
8 |
|
9 |
+
This repository contains the code for fine-tuning models, as described in [Autonomous Data Selection with Language Models for Mathematical Texts](https://huggingface.co/papers/2402.07625).
|
10 |
+
|
11 |
[](https://github.com/hiyouga/LLaMA-Factory/stargazers)
|
12 |
[](LICENSE)
|
13 |
[](https://github.com/hiyouga/LLaMA-Factory/commits/main)
|
|
|
127 |
|
128 |
[23/12/12] We supported fine-tuning the latest MoE model **[Mixtral 8x7B](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)** in our framework. See hardware requirement [here](#hardware-requirement).
|
129 |
|
130 |
+
[23/12/01] We supported downloading pre-trained models and datasets from the **[ModelScope Hub](https://modelscope.cn/models)**. See [this tutorial](#download-from-modelscope-hub) for usage.
|
131 |
|
132 |
[23/10/21] We supported **[NEFTune](https://arxiv.org/abs/2310.05914)** trick for fine-tuning. Try `neftune_noise_alpha: 5` argument to activate NEFTune.
|
133 |
|
|
|
147 |
|
148 |
[23/07/18] We developed an **all-in-one Web UI** for training, evaluation and inference. Try `train_web.py` to fine-tune models in your Web browser. Thank [@KanadeSiina](https://github.com/KanadeSiina) and [@codemayq](https://github.com/codemayq) for their efforts in the development.
|
149 |
|
150 |
+
[23/07/09] We released **[FastEdit](https://github.com/hiyouga/FastEdit)** ⚡ 🩹, an easy-to-use package for editing the factual knowledge of large language models efficiently. Please follow [FastEdit](https://github.com/hiyouga/FastEdit) if you are interested.
|
151 |
|
152 |
[23/06/29] We provided a **reproducible example** of training a chat model using instruction-following datasets, see [Baichuan-7B-sft](https://huggingface.co/hiyouga/Baichuan-7B-sft) for details.
|
153 |
|
154 |
+
[23/06/22] We aligned the [demo API](src/api_demo.py) with the [OpenAI's](https://platform.openai.com/docs/api-reference/chat/create) format where you can insert the fine-tuned model in **arbitrary ChatGPT-based applications**.
|
155 |
|
156 |
[23/06/03] We supported quantized training and inference (aka **[QLoRA](https://github.com/artidoro/qlora)**). See [examples](examples/README.md) for usage.
|
157 |
|
|
|
265 |
- [STEM (zh)](https://huggingface.co/datasets/hfl/stem_zh_instruction)
|
266 |
- [Ruozhiba (zh)](https://huggingface.co/datasets/hfl/ruozhiba_gpt4_turbo)
|
267 |
- [Neo-sft (zh)](https://huggingface.co/datasets/m-a-p/neo_sft_phase2)
|
|
|
268 |
- [Magpie-Pro-300K-Filtered (en)](https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-300K-Filtered)
|
269 |
+
- [WebInstructSub (en)](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
</details>
|
271 |
|
272 |
<details><summary>Preference datasets</summary>
|
|
|
319 |
| Freeze | 16 | 20GB | 40GB | 80GB | 200GB | 360GB | 160GB | 400GB |
|
320 |
| LoRA/GaLore/BAdam | 16 | 16GB | 32GB | 64GB | 160GB | 240GB | 120GB | 320GB |
|
321 |
| QLoRA | 8 | 10GB | 20GB | 40GB | 80GB | 140GB | 60GB | 160GB |
|
322 |
+
| QLoRA | 4 | 6GB | 12GB | 24GB | 48GB | 72GB | 30GB | 96GB |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|