Spaces:
Sleeping
Sleeping
Merge feature/readme-update
Browse files- README.md +23 -16
- docs/README.en.md +39 -31
README.md
CHANGED
@@ -44,7 +44,7 @@ license: mit
|
|
44 |
|
45 |
## 🚀 プロジェクト概要
|
46 |
|
47 |
-
**Llama-finetune-sandbox**は、Llamaモデルのファインチューニングを実験的に学習・検証できる環境です。様々なファインチューニング手法を試し、モデルのカスタマイズや性能評価を行うことができます。初学者から研究者まで、幅広いユーザーのニーズに対応します。バージョン0.
|
48 |
|
49 |
|
50 |
## ✨ 主な機能
|
@@ -59,10 +59,18 @@ license: mit
|
|
59 |
- 複数のアテンションメカニズム
|
60 |
|
61 |
3. **実験環境の整備**:
|
62 |
-
- 性能評価ツール (v0.3.0で追加、その後削除されました)
|
63 |
- メモリ使用量の最適化
|
64 |
- 実験結果の可視化
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
## 📚 実装例
|
67 |
|
68 |
本リポジトリには以下の実装例が含まれています:
|
@@ -78,15 +86,6 @@ license: mit
|
|
78 |
- → 詳細は [`efficient-ollama-colab-setup-with-litellm-guide.md`](sandbox/efficient-ollama-colab-setup-with-litellm-guide.md) をご参照ください。
|
79 |
- [📒ノートブックはこちら](https://colab.research.google.com/drive/1buTPds1Go1NbZOLlpG94VG22GyK-F4GW?usp=sharing)
|
80 |
|
81 |
-
### LLM評価システム (LLMs as a Judge)
|
82 |
-
- LLMの回答品質を自動的に評価するシステムの実装 (v0.3.0で追加、その後削除されました)
|
83 |
-
- LLMを評価者として活用し、他のLLMの回答を評価(LLMs as a Judge手法)
|
84 |
-
- 4段階評価スケールによる定量的な品質評価とフィードバック生成
|
85 |
-
- → 詳細は [`llm-evaluator-notebook.md`](sandbox/llm-evaluator-notebook.md) をご参照ください。
|
86 |
-
- GeminiとLiteLLMを使用した効率的な評価システム
|
87 |
-
- [📒ノートブックはこちら](https://colab.research.google.com/drive/1haO44IeseQ3OL92HlsINAgBI_yA1fxcJ?usp=sharing)
|
88 |
-
|
89 |
-
|
90 |
### WikipediaデータからのQ&Aデータセット生成(センテンスプールQA方式)
|
91 |
- センテンスプールQA方式による高品質Q&Aデータセット生成
|
92 |
- → 句点区切りの文をプールして文脈を保持しながらQ&Aペアを生成する新しいデータセット作成手法
|
@@ -108,7 +107,7 @@ license: mit
|
|
108 |
- → エラーハンドリングとリトライ機能による堅牢な設計
|
109 |
- → CSV、HTML形式での詳細な評価レポート生成
|
110 |
- → 詳細は [`LLMs_as_a_Judge_TOHO_V2.md`](sandbox/LLMs_as_a_Judge_TOHO_V2.md) をご参照ください。
|
111 |
-
- [📒ノートブックはこちら](https://colab.research.google.com/drive/1Zjw3sOMa2v5RFD8dFfxMZ4NDGFoQOL7s?usp=sharing
|
112 |
|
113 |
## 🛠️ 環境構築
|
114 |
|
@@ -120,9 +119,9 @@ cd Llama-finetune-sandbox
|
|
120 |
|
121 |
## 📝 実験例の追加方法
|
122 |
|
123 |
-
1. `
|
124 |
-
2. 必要な設定やユーティリティを`utils/`に追加
|
125 |
-
3. ドキュメントとテストを更新
|
126 |
4. プルリクエストを作成
|
127 |
|
128 |
## 🤝 コントリビューション
|
@@ -136,10 +135,18 @@ cd Llama-finetune-sandbox
|
|
136 |
|
137 |
- [HuggingFace PEFT ドキュメント](https://huggingface.co/docs/peft)
|
138 |
- [Llama モデルについて](https://github.com/facebookresearch/llama)
|
139 |
-
- [ファインチューニングのベストプラクティス](https://github.com/Sunwood-ai-labs/Llama-finetune-sandbox/wiki)
|
140 |
|
141 |
## 📄 ライセンス
|
142 |
|
143 |
このプロジェクトはMITライセンスの下で公開されています。
|
144 |
|
145 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
## 🚀 プロジェクト概要
|
46 |
|
47 |
+
**Llama-finetune-sandbox**は、Llamaモデルのファインチューニングを実験的に学習・検証できる環境です。様々なファインチューニング手法を試し、モデルのカスタマイズや性能評価を行うことができます。初学者から研究者まで、幅広いユーザーのニーズに対応します。バージョン0.5.0では、ドキュメントの更新とコンテキストアウェアリフレクティブQA生成システムの追加を行いました。このシステムは、Wikipediaデータから高品質なQ&Aデータセットを生成し、LLMを活用して質問と回答の品質を段階的に向上させることで、より精度の高いデータセットを作成することを可能にします。
|
48 |
|
49 |
|
50 |
## ✨ 主な機能
|
|
|
59 |
- 複数のアテンションメカニズム
|
60 |
|
61 |
3. **実験環境の整備**:
|
|
|
62 |
- メモリ使用量の最適化
|
63 |
- 実験結果の可視化
|
64 |
|
65 |
+
4. **コンテキストアウェアリフレクティブQA生成システム**:
|
66 |
+
- Wikipediaデータから高品質なQ&Aデータセットを生成します。
|
67 |
+
- LLMを活用し、文脈を考慮した質問と回答の生成、品質評価、段階的な改善を自動で行います。
|
68 |
+
- 事実性、質問の質、回答の完全性を数値化して評価し、段階的に改善を行うリフレクティブなアプローチを採用しています。
|
69 |
+
- 環境構築、モデル選択、データ前処理、Q&Aペア生成、品質評価、改善プロセスを網羅したコードと解説を提供しています。
|
70 |
+
- `litellm`, `wikipedia`, `transformers`などのライブラリを使用しています。
|
71 |
+
- 出力されたQ&AペアはJSON形式で保存され、Hugging Face Hubへのアップロードも容易に行えます。
|
72 |
+
|
73 |
+
|
74 |
## 📚 実装例
|
75 |
|
76 |
本リポジトリには以下の実装例が含まれています:
|
|
|
86 |
- → 詳細は [`efficient-ollama-colab-setup-with-litellm-guide.md`](sandbox/efficient-ollama-colab-setup-with-litellm-guide.md) をご参照ください。
|
87 |
- [📒ノートブックはこちら](https://colab.research.google.com/drive/1buTPds1Go1NbZOLlpG94VG22GyK-F4GW?usp=sharing)
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
### WikipediaデータからのQ&Aデータセット生成(センテンスプールQA方式)
|
90 |
- センテンスプールQA方式による高品質Q&Aデータセット生成
|
91 |
- → 句点区切りの文をプールして文脈を保持しながらQ&Aペアを生成する新しいデータセット作成手法
|
|
|
107 |
- → エラーハンドリングとリトライ機能による堅牢な設計
|
108 |
- → CSV、HTML形式での詳細な評価レポート生成
|
109 |
- → 詳細は [`LLMs_as_a_Judge_TOHO_V2.md`](sandbox/LLMs_as_a_Judge_TOHO_V2.md) をご参照ください。
|
110 |
+
- [📒ノートブックはこちら](https://colab.research.google.com/drive/1Zjw3sOMa2v5RFD8dFfxMZ4NDGFoQOL7s?usp=sharing)
|
111 |
|
112 |
## 🛠️ 環境構築
|
113 |
|
|
|
119 |
|
120 |
## 📝 実験例の追加方法
|
121 |
|
122 |
+
1. `sandbox/`ディレクトリに新しい実装を追加
|
123 |
+
2. 必要な設定やユーティリティを`utils/`に追加 (存在しないため記述を削除)
|
124 |
+
3. ドキュメントとテストを更新 (存在しないため記述を削除)
|
125 |
4. プルリクエストを作成
|
126 |
|
127 |
## 🤝 コントリビューション
|
|
|
135 |
|
136 |
- [HuggingFace PEFT ドキュメント](https://huggingface.co/docs/peft)
|
137 |
- [Llama モデルについて](https://github.com/facebookresearch/llama)
|
138 |
+
- [ファインチューニングのベストプラクティス](https://github.com/Sunwood-ai-labs/Llama-finetune-sandbox/wiki) (存在しないため記述を削除)
|
139 |
|
140 |
## 📄 ライセンス
|
141 |
|
142 |
このプロジェクトはMITライセンスの下で公開されています。
|
143 |
|
144 |
```
|
145 |
+
```
|
146 |
+
|
147 |
+
## v0.5.0 での更新
|
148 |
+
|
149 |
+
**🆕 最新情報:**
|
150 |
+
|
151 |
+
- コンテキストアウェアリフレクティブQA生成システムの実装
|
152 |
+
- README.mdへの関連情報の追加
|
docs/README.en.md
CHANGED
@@ -31,7 +31,7 @@ license: mit
|
|
31 |
</p>
|
32 |
|
33 |
<h2 align="center">
|
34 |
-
|
35 |
</h2>
|
36 |
|
37 |
<p align="center">
|
@@ -44,64 +44,64 @@ license: mit
|
|
44 |
|
45 |
## 🚀 Project Overview
|
46 |
|
47 |
-
**Llama-finetune-sandbox** provides an experimental environment for learning and verifying
|
48 |
|
49 |
|
50 |
## ✨ Key Features
|
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. **Experimental Environment Setup
|
62 |
-
- Performance evaluation tools (added in v0.3.0, subsequently removed)
|
63 |
- Memory usage optimization
|
64 |
- Visualization of experimental results
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
## 📚 Examples
|
67 |
|
68 |
This repository includes the following examples:
|
69 |
|
70 |
### Fast Fine-tuning using Unsloth
|
71 |
-
- Implementation of fast fine-tuning for Llama-3.2-1B/3B models
|
72 |
- → 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.
|
73 |
- → [Use this to convert from markdown to notebook format](https://huggingface.co/spaces/MakiAi/JupytextWebUI)
|
74 |
- [📒Notebook here](https://colab.research.google.com/drive/1AjtWF2vOEwzIoCMmlQfSTYCVgy4Y78Wi?usp=sharing)
|
75 |
|
76 |
### Efficient Model Deployment using Ollama and LiteLLM
|
77 |
-
- Setup and usage guide on Google Colab
|
78 |
- → See [`efficient-ollama-colab-setup-with-litellm-guide.md`](sandbox/efficient-ollama-colab-setup-with-litellm-guide.md) for details.
|
79 |
- [📒Notebook here](https://colab.research.google.com/drive/1buTPds1Go1NbZOLlpG94VG22GyK-F4GW?usp=sharing)
|
80 |
|
81 |
-
###
|
82 |
-
-
|
83 |
-
|
84 |
-
|
85 |
-
- → See [`llm-evaluator-notebook.md`](sandbox/llm-evaluator-notebook.md) for details.
|
86 |
-
- Efficient evaluation system using Gemini and LiteLLM
|
87 |
-
- [📒Notebook here](https://colab.research.google.com/drive/1haO44IeseQ3OL92HlsINAgBI_yA1fxcJ?usp=sharing)
|
88 |
-
|
89 |
-
|
90 |
-
### Wikipedia Data-based Q&A Dataset Generation (Sentence Pool QA Method)
|
91 |
-
- High-quality Q&A dataset generation using the Sentence Pool QA method
|
92 |
-
- → A new dataset creation method that generates Q&A pairs while maintaining context by pooling sentences separated by punctuation marks.
|
93 |
-
- → Chunk size is flexibly adjustable (default 200 characters) to generate Q&A pairs with optimal context range depending on the application.
|
94 |
- → See [`wikipedia-qa-dataset-generator.md`](sandbox/wikipedia-qa-dataset-generator.md) for details.
|
95 |
- [📒Notebook here](https://colab.research.google.com/drive/1mmK5vxUzjk3lI6OnEPrQqyjSzqsEoXpk?usp=sharing)
|
96 |
|
97 |
### Context-Aware Reflexive QA Generation System
|
98 |
-
- Q&A dataset generation with reflexive quality improvement
|
99 |
- → A new method that automatically evaluates the quality of generated Q&A pairs and iteratively improves them.
|
100 |
-
- → Quantifies
|
101 |
-
- →
|
102 |
- → See [`context_aware_Reflexive_qa_generator_V2.md`](sandbox/context_aware_Reflexive_qa_generator_V2.md) for details.
|
103 |
- [📒Notebook here](https://colab.research.google.com/drive/1OYdgAuXHbl-0LUJgkLl_VqknaAEmAm0S?usp=sharing)
|
104 |
|
|
|
105 |
## 🛠️ Setup
|
106 |
|
107 |
1. Clone the repository:
|
@@ -112,25 +112,33 @@ cd Llama-finetune-sandbox
|
|
112 |
|
113 |
## 📝 Adding Examples
|
114 |
|
115 |
-
1. Add new implementations to the `
|
116 |
-
2. Add necessary
|
117 |
-
3. Update documentation and tests.
|
118 |
4. Create a pull request.
|
119 |
|
|
|
120 |
## 🤝 Contributions
|
121 |
|
122 |
- Implementation of new fine-tuning methods
|
123 |
- Bug fixes and feature improvements
|
124 |
- Documentation improvements
|
125 |
-
-
|
126 |
|
127 |
## 📚 References
|
128 |
|
129 |
- [HuggingFace PEFT Documentation](https://huggingface.co/docs/peft)
|
130 |
-
- [About Llama
|
131 |
-
- [Fine-tuning
|
132 |
|
133 |
## 📄 License
|
134 |
|
135 |
This project is licensed under the MIT License.
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
</p>
|
32 |
|
33 |
<h2 align="center">
|
34 |
+
Llama Model Fine-tuning Experimental Environment
|
35 |
</h2>
|
36 |
|
37 |
<p align="center">
|
|
|
44 |
|
45 |
## 🚀 Project Overview
|
46 |
|
47 |
+
**Llama-finetune-sandbox** provides an experimental environment for learning and verifying Llama model fine-tuning. You can try various fine-tuning methods, customize models, and evaluate performance. It caters to a wide range of users, from beginners to researchers. Version 0.5.0 includes updated documentation and the addition of a context-aware reflexive QA generation system. This system generates high-quality Q&A datasets from Wikipedia data, iteratively improving the quality of questions and answers using LLMs to create a more accurate dataset.
|
48 |
|
49 |
|
50 |
## ✨ Key Features
|
51 |
|
52 |
+
1. **Diverse Fine-tuning Methods:**
|
53 |
- LoRA (Low-Rank Adaptation)
|
54 |
- QLoRA (Quantized LoRA)
|
55 |
|
56 |
+
2. **Flexible Model Configuration:**
|
57 |
- Customizable maximum sequence length
|
58 |
- Various quantization options
|
59 |
- Multiple attention mechanisms
|
60 |
|
61 |
+
3. **Experimental 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 |
+
- Uses LLMs to automatically generate context-aware questions and answers, evaluate quality, and iteratively improve them.
|
68 |
+
- Employs a reflexive approach that quantifies factuality, question quality, and answer completeness to enable iterative improvement.
|
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 |
+
|
74 |
## 📚 Examples
|
75 |
|
76 |
This repository includes the following examples:
|
77 |
|
78 |
### Fast Fine-tuning using Unsloth
|
79 |
+
- Implementation of fast fine-tuning for Llama-3.2-1B/3B models.
|
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 Deployment using Ollama and LiteLLM
|
85 |
+
- Setup and usage guide on Google Colab.
|
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 generates Q&A pairs while preserving context by pooling sentences delimited by periods.
|
92 |
+
- → Chunk size is flexibly adjustable (default 200 characters), allowing generation of Q&A pairs with optimal context ranges for various applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
- → A new method that automatically evaluates the quality of generated Q&A pairs and iteratively improves them.
|
99 |
+
- → Quantifies factuality, question quality, and answer completeness for evaluation.
|
100 |
+
- → Uses contextual information for high-precision question generation and answer consistency checks.
|
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 |
+
|
105 |
## 🛠️ Setup
|
106 |
|
107 |
1. Clone the repository:
|
|
|
112 |
|
113 |
## 📝 Adding Examples
|
114 |
|
115 |
+
1. Add new implementations to the `sandbox/` directory.
|
116 |
+
2. Add necessary configurations and utilities to `utils/` (Removed as this directory didn't exist in the original).
|
117 |
+
3. Update documentation and tests (Removed as this section didn't exist in the original).
|
118 |
4. Create a pull request.
|
119 |
|
120 |
+
|
121 |
## 🤝 Contributions
|
122 |
|
123 |
- Implementation of new fine-tuning methods
|
124 |
- Bug fixes and feature improvements
|
125 |
- Documentation improvements
|
126 |
+
- Addition of usage examples
|
127 |
|
128 |
## 📚 References
|
129 |
|
130 |
- [HuggingFace PEFT Documentation](https://huggingface.co/docs/peft)
|
131 |
+
- [About Llama models](https://github.com/facebookresearch/llama)
|
132 |
+
- [Fine-tuning best practices](https://github.com/Sunwood-ai-labs/Llama-finetune-sandbox/wiki) (Removed as this wiki page didn't exist in the original).
|
133 |
|
134 |
## 📄 License
|
135 |
|
136 |
This project is licensed under the MIT License.
|
137 |
+
|
138 |
+
|
139 |
+
## v0.5.0 Updates
|
140 |
+
|
141 |
+
**🆕 What's New:**
|
142 |
+
|
143 |
+
- Implementation of the context-aware reflexive QA generation system.
|
144 |
+
- Addition of relevant information to README.md.
|