Spaces:
Sleeping
Sleeping
[email protected]
commited on
Merge pull request #22 from Sunwood-ai-labs/translate-readme-12026839076
Browse files- docs/README.en.md +46 -52
docs/README.en.md
CHANGED
@@ -31,7 +31,7 @@ license: mit
|
|
31 |
</p>
|
32 |
|
33 |
<h2 align="center">
|
34 |
-
Llama Model Fine-tuning
|
35 |
</h2>
|
36 |
|
37 |
<p align="center">
|
@@ -44,86 +44,93 @@ license: mit
|
|
44 |
|
45 |
## ๐ Project Overview
|
46 |
|
47 |
-
**Llama-finetune-sandbox** provides an experimental environment for learning and
|
48 |
|
49 |
|
50 |
-
## โจ
|
51 |
|
52 |
-
1. **Diverse Fine-tuning Methods
|
53 |
- LoRA (Low-Rank Adaptation)
|
54 |
- QLoRA (Quantized LoRA)
|
55 |
|
56 |
-
2. **Flexible Model
|
57 |
- Customizable maximum sequence length
|
58 |
- Various quantization options
|
59 |
- Multiple attention mechanisms
|
60 |
|
61 |
-
3. **
|
62 |
-
-
|
63 |
- Visualization of experimental results
|
64 |
|
65 |
-
4. **Context-Aware Reflexive QA Generation System
|
66 |
- Generates high-quality Q&A datasets from Wikipedia data.
|
67 |
-
-
|
68 |
-
- Employs a reflexive approach, quantifying factuality, question quality, and answer completeness
|
69 |
- Provides comprehensive code and explanations covering environment setup, model selection, data preprocessing, Q&A pair generation, quality evaluation, and the improvement process.
|
70 |
-
-
|
71 |
- Generated Q&A pairs are saved in JSON format and can be easily uploaded to the Hugging Face Hub.
|
72 |
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
## ๐ Examples
|
75 |
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
- โ See [`Llama_3_2_1B+3B_Conversational_+_2x_faster_finetuning_JP.md`](sandbox/Llama_3_2_1B+3B_Conversational_+_2x_faster_finetuning_JP.md) for details.
|
81 |
- โ [Use this to convert from markdown to notebook format](https://huggingface.co/spaces/MakiAi/JupytextWebUI)
|
82 |
- [๐Notebook here](https://colab.research.google.com/drive/1AjtWF2vOEwzIoCMmlQfSTYCVgy4Y78Wi?usp=sharing)
|
83 |
|
84 |
-
### Efficient Model
|
85 |
-
- Setup and
|
86 |
- โ See [`efficient-ollama-colab-setup-with-litellm-guide.md`](sandbox/efficient-ollama-colab-setup-with-litellm-guide.md) for details.
|
87 |
- [๐Notebook here](https://colab.research.google.com/drive/1buTPds1Go1NbZOLlpG94VG22GyK-F4GW?usp=sharing)
|
88 |
|
89 |
### Q&A Dataset Generation from Wikipedia Data (Sentence Pool QA Method)
|
90 |
-
- High-quality Q&A dataset generation using the sentence pool QA method
|
91 |
-
- โ A new dataset creation method that
|
92 |
-
- โ Chunk size is flexibly adjustable (default 200 characters) to generate Q&A pairs with
|
93 |
- โ See [`wikipedia-qa-dataset-generator.md`](sandbox/wikipedia-qa-dataset-generator.md) for details.
|
94 |
- [๐Notebook here](https://colab.research.google.com/drive/1mmK5vxUzjk3lI6OnEPrQqyjSzqsEoXpk?usp=sharing)
|
95 |
|
96 |
### Context-Aware Reflexive QA Generation System
|
97 |
-
- Q&A dataset generation with reflexive quality improvement
|
98 |
-
- โ
|
99 |
- โ Quantifies factuality, question quality, and answer completeness for evaluation.
|
100 |
-
- โ
|
101 |
- โ See [`context_aware_Reflexive_qa_generator_V2.md`](sandbox/context_aware_Reflexive_qa_generator_V2.md) for details.
|
102 |
- [๐Notebook here](https://colab.research.google.com/drive/1OYdgAuXHbl-0LUJgkLl_VqknaAEmAm0S?usp=sharing)
|
103 |
|
104 |
### LLM Evaluation System (LLMs as a Judge)
|
105 |
-
- Advanced quality evaluation system
|
106 |
-
- โ Automatically evaluates questions, model answers, and LLM responses on a
|
107 |
-
- โ Robust design with error handling and retry
|
108 |
- โ Generates detailed evaluation reports in CSV and HTML formats.
|
109 |
- โ See [`LLMs_as_a_Judge_TOHO_V2.md`](sandbox/LLMs_as_a_Judge_TOHO_V2.md) for details.
|
110 |
- [๐Notebook here](https://colab.research.google.com/drive/1Zjw3sOMa2v5RFD8dFfxMZ4NDGFoQOL7s?usp=sharing)
|
111 |
|
112 |
|
113 |
-
##
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
git clone https://github.com/Sunwood-ai-labs/Llama-finetune-sandbox.git
|
118 |
-
cd Llama-finetune-sandbox
|
119 |
-
```
|
120 |
|
121 |
-
## ๐ Adding Examples
|
122 |
-
|
123 |
-
1. Add new implementations to the `sandbox/` directory.
|
124 |
-
2. Add necessary settings and utilities to `utils/` (This section was removed as `utils/` directory appears not to exist).
|
125 |
-
3. Update documentation and tests (This section was removed as there's no mention of existing tests).
|
126 |
-
4. Create a pull request.
|
127 |
|
128 |
## ๐ค Contributions
|
129 |
|
@@ -132,19 +139,6 @@ cd Llama-finetune-sandbox
|
|
132 |
- Documentation improvements
|
133 |
- Addition of usage examples
|
134 |
|
135 |
-
## ๐ References
|
136 |
-
|
137 |
-
- [HuggingFace PEFT documentation](https://huggingface.co/docs/peft)
|
138 |
-
- [About Llama models](https://github.com/facebookresearch/llama)
|
139 |
-
- [Fine-tuning best practices](https://github.com/Sunwood-ai-labs/Llama-finetune-sandbox/wiki) (This section was removed as the wiki page appears not to exist).
|
140 |
-
|
141 |
## ๐ License
|
142 |
|
143 |
-
This project is licensed under the MIT License.
|
144 |
-
|
145 |
-
## v0.5.0 Updates
|
146 |
-
|
147 |
-
**๐ What's New:**
|
148 |
-
|
149 |
-
- Implementation of the context-aware reflexive QA generation system.
|
150 |
-
- Addition of relevant information to README.md.
|
|
|
31 |
</p>
|
32 |
|
33 |
<h2 align="center">
|
34 |
+
๏ฝ Llama Model Fine-tuning Experiment Environment ๏ฝ
|
35 |
</h2>
|
36 |
|
37 |
<p align="center">
|
|
|
44 |
|
45 |
## ๐ Project Overview
|
46 |
|
47 |
+
**Llama-finetune-sandbox** provides an experimental environment for learning and validating fine-tuning of Llama models. You can try various fine-tuning methods, customize models, and evaluate their performance. It caters to a wide range of users, from beginners to researchers. Version 0.6.0 includes updated documentation and the implementation of an LLM evaluation system. This system automatically evaluates the quality of LLM responses and generates detailed evaluation reports.
|
48 |
|
49 |
|
50 |
+
## โจ Main Features
|
51 |
|
52 |
+
1. **Diverse Fine-tuning Methods**:
|
53 |
- LoRA (Low-Rank Adaptation)
|
54 |
- QLoRA (Quantized LoRA)
|
55 |
|
56 |
+
2. **Flexible Model Settings**:
|
57 |
- Customizable maximum sequence length
|
58 |
- Various quantization options
|
59 |
- Multiple attention mechanisms
|
60 |
|
61 |
+
3. **Experiment Environment Setup**:
|
62 |
+
- Memory usage optimization
|
63 |
- Visualization of experimental results
|
64 |
|
65 |
+
4. **Context-Aware Reflexive QA Generation System**:
|
66 |
- Generates high-quality Q&A datasets from Wikipedia data.
|
67 |
+
- Utilizes LLMs to generate context-aware questions and answers, automatically evaluate quality, and iteratively improve them.
|
68 |
+
- Employs a reflexive approach, quantifying factuality, question quality, and answer completeness to enable incremental improvements.
|
69 |
- Provides comprehensive code and explanations covering environment setup, model selection, data preprocessing, Q&A pair generation, quality evaluation, and the improvement process.
|
70 |
+
- Uses libraries such as `litellm`, `wikipedia`, and `transformers`.
|
71 |
- Generated Q&A pairs are saved in JSON format and can be easily uploaded to the Hugging Face Hub.
|
72 |
|
73 |
+
5. **LLM Evaluation System**:
|
74 |
+
- Automatically evaluates the quality of LLM responses.
|
75 |
+
- Evaluates questions, model answers, and LLM responses on a 4-point scale, generating detailed evaluation reports.
|
76 |
+
- Features error handling, retry functionality, logging, customizable evaluation criteria, and report generation in CSV and HTML formats.
|
77 |
+
- Also includes functionality for uploading to the Hugging Face Hub.
|
78 |
|
|
|
79 |
|
80 |
+
## ๐ง Usage
|
81 |
|
82 |
+
Refer to the notebooks in this repository.
|
83 |
+
|
84 |
+
|
85 |
+
## ๐ฆ Installation Instructions
|
86 |
+
|
87 |
+
Refer to `requirements.txt` and install the necessary packages.
|
88 |
+
|
89 |
+
|
90 |
+
## ๐ Implementation Examples
|
91 |
+
|
92 |
+
This repository includes the following implementation examples:
|
93 |
+
|
94 |
+
### High-Speed Fine-tuning using Unsloth
|
95 |
+
- High-speed fine-tuning implementation for Llama-3.2-1B/3B models
|
96 |
- โ See [`Llama_3_2_1B+3B_Conversational_+_2x_faster_finetuning_JP.md`](sandbox/Llama_3_2_1B+3B_Conversational_+_2x_faster_finetuning_JP.md) for details.
|
97 |
- โ [Use this to convert from markdown to notebook format](https://huggingface.co/spaces/MakiAi/JupytextWebUI)
|
98 |
- [๐Notebook here](https://colab.research.google.com/drive/1AjtWF2vOEwzIoCMmlQfSTYCVgy4Y78Wi?usp=sharing)
|
99 |
|
100 |
+
### Efficient Model Operation using Ollama and LiteLLM
|
101 |
+
- Setup and operation guide for Google Colab
|
102 |
- โ See [`efficient-ollama-colab-setup-with-litellm-guide.md`](sandbox/efficient-ollama-colab-setup-with-litellm-guide.md) for details.
|
103 |
- [๐Notebook here](https://colab.research.google.com/drive/1buTPds1Go1NbZOLlpG94VG22GyK-F4GW?usp=sharing)
|
104 |
|
105 |
### Q&A Dataset Generation from Wikipedia Data (Sentence Pool QA Method)
|
106 |
+
- High-quality Q&A dataset generation using the sentence pool QA method
|
107 |
+
- โ A new dataset creation method that retains context by pooling sentences separated by punctuation marks.
|
108 |
+
- โ Chunk size is flexibly adjustable (default 200 characters) to generate Q&A pairs with optimal context ranges for various applications.
|
109 |
- โ See [`wikipedia-qa-dataset-generator.md`](sandbox/wikipedia-qa-dataset-generator.md) for details.
|
110 |
- [๐Notebook here](https://colab.research.google.com/drive/1mmK5vxUzjk3lI6OnEPrQqyjSzqsEoXpk?usp=sharing)
|
111 |
|
112 |
### Context-Aware Reflexive QA Generation System
|
113 |
+
- Q&A dataset generation with reflexive quality improvement
|
114 |
+
- โ A new method that automatically evaluates the quality of generated Q&A pairs and iteratively improves them.
|
115 |
- โ Quantifies factuality, question quality, and answer completeness for evaluation.
|
116 |
+
- โ Uses contextual information for high-precision question generation and answer consistency checks.
|
117 |
- โ See [`context_aware_Reflexive_qa_generator_V2.md`](sandbox/context_aware_Reflexive_qa_generator_V2.md) for details.
|
118 |
- [๐Notebook here](https://colab.research.google.com/drive/1OYdgAuXHbl-0LUJgkLl_VqknaAEmAm0S?usp=sharing)
|
119 |
|
120 |
### LLM Evaluation System (LLMs as a Judge)
|
121 |
+
- Advanced quality evaluation system utilizing LLMs as evaluators
|
122 |
+
- โ Automatically evaluates questions, model answers, and LLM responses on a 4-point scale.
|
123 |
+
- โ Robust design with error handling and retry functionality.
|
124 |
- โ Generates detailed evaluation reports in CSV and HTML formats.
|
125 |
- โ See [`LLMs_as_a_Judge_TOHO_V2.md`](sandbox/LLMs_as_a_Judge_TOHO_V2.md) for details.
|
126 |
- [๐Notebook here](https://colab.research.google.com/drive/1Zjw3sOMa2v5RFD8dFfxMZ4NDGFoQOL7s?usp=sharing)
|
127 |
|
128 |
|
129 |
+
## ๐ What's New (v0.6.0)
|
130 |
|
131 |
+
- **Implementation of the LLM Evaluation System**: Added a system to automatically evaluate the quality of LLM responses. Questions, model answers, and LLM answers are compared and evaluated on a 4-point scale. Features error handling, retry functionality, logging, customizable evaluation criteria, and report generation in CSV and HTML formats.
|
132 |
+
- Added information about the LLM evaluation system to README.md
|
|
|
|
|
|
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
## ๐ค Contributions
|
136 |
|
|
|
139 |
- Documentation improvements
|
140 |
- Addition of usage examples
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
## ๐ License
|
143 |
|
144 |
+
This project is licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
|
|
|
|