Spaces:
Sleeping
A newer version of the Streamlit SDK is available:
1.44.1
title: Llama-finetune-sandbox
emoji: ๐ฆ
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.39.0
app_file: app.py
pinned: false
license: mit
๐ Llama-finetune-sandbox ๐
Llama Model Fine-tuning Experiment Environment
๐ Project Overview
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.7.0 includes updated documentation and the addition of a guide for implementing high-speed inference using Unsloth.
โจ Key Features
Diverse Fine-tuning Methods:
- LoRA (Low-Rank Adaptation)
- QLoRA (Quantized LoRA)
Flexible Model Configuration:
- Customizable maximum sequence length
- Various quantization options
- Multiple attention mechanisms
Experiment Environment Setup:
- Memory usage optimization
- Visualization of experimental results
Context-Aware Reflexive QA Generation System:
- Generates high-quality Q&A datasets from Wikipedia data.
- Uses LLMs to automatically generate context-aware questions and answers, evaluate quality, and iteratively improve them.
- Employs a reflexive approach, quantifying factuality, question quality, and answer completeness to evaluate and iteratively improve the generated Q&A pairs.
- Provides code and explanations covering environment setup, model selection, data preprocessing, Q&A pair generation, quality evaluation, and the improvement process.
- Uses libraries such as
litellm
,wikipedia
, andtransformers
. - Generated Q&A pairs are saved in JSON format and can be easily uploaded to the Hugging Face Hub.
LLM Evaluation System:
- Automatically evaluates the quality of LLM responses.
- Evaluates questions, model answers, and LLM responses on a 4-point scale, generating detailed evaluation reports.
- Features error handling, retry functionality, logging, customizable evaluation criteria, and report generation in CSV and HTML formats.
- Also includes functionality for uploading to the Hugging Face Hub.
๐ง Usage
Refer to the notebooks in this repository.
๐ฆ Installation Instructions
Refer to requirements.txt
and install the necessary packages.
๐ Implementation Examples
This repository includes the following implementation examples:
High-Speed Fine-tuning using Unsloth
- High-speed fine-tuning implementation for Llama-3.2-1B/3B models
- ๐Notebook here
High-Speed Inference using Unsloth
High-speed inference implementation for Llama-3.2 models
- โ See
Unsloth_inference_llama3-2.md
for details. - โ Implementation of efficient inference processing for the Llama-3.2 model using Unsloth
- โ See
High-speed inference implementation for LLM-JP models
- โ See
Unsloth_inference_llm_jp.md
for details. - โ Implementation and performance optimization of high-speed inference processing for Japanese LLMs
- โ See
Efficient Model Operation using Ollama and LiteLLM
- Setup and operation guide on Google Colab
- โ See
efficient-ollama-colab-setup-with-litellm-guide.md
for details. - ๐Notebook here
Q&A Dataset Generation from Wikipedia Data (Sentence Pool QA Method)
- High-quality Q&A dataset generation using the sentence pool QA method
- โ A new dataset creation method that generates Q&A pairs while maintaining context by pooling sentences separated by punctuation marks.
- โ Chunk size is flexibly adjustable (default 200 characters) to generate Q&A pairs with optimal context range depending on the application.
- โ See
wikipedia-qa-dataset-generator.md
for details.
- ๐Notebook here
Context-Aware Reflexive QA Generation System
- Q&A dataset generation with reflexive quality improvement
- โ A new method that automatically evaluates the quality of generated Q&A pairs and iteratively improves them.
- โ Quantifies factuality, question quality, and answer completeness for evaluation.
- โ Generates highly accurate questions and checks the consistency of answers using contextual information.
- โ See
context_aware_Reflexive_qa_generator_V2.md
for details.
- ๐Notebook here
LLM Evaluation System (LLMs as a Judge)
- Advanced quality evaluation system utilizing LLMs as evaluators
- โ Automatically evaluates questions, model answers, and LLM responses on a 4-point scale.
- โ Robust design with error handling and retry functionality.
- โ Generates detailed evaluation reports in CSV and HTML formats.
- โ See
LLMs_as_a_Judge_TOHO_V2.md
for details.
- ๐Notebook here
๐ What's New (v0.7.0)
- Addition of a guide for high-speed inference implementation using Unsloth: Added information on high-speed inference implementation for Llama-3.2 and LLM-JP models, how to use each model, and links to Colab notebooks.
- Updated documentation
๐ค Contributions
- Implementation of new fine-tuning methods
- Bug fixes and feature improvements
- Documentation improvements
- Addition of usage examples
๐ License
This project is licensed under the MIT License.