初始化项目,由ModelHub XC社区提供模型
Model: ai-nexuz/llama-3.2-1b-instruct-fine-tuned Source: Original Platform
This commit is contained in:
196
README.md
Normal file
196
README.md
Normal file
@@ -0,0 +1,196 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
datasets:
|
||||
- kanhatakeyama/wizardlm8x22b-logical-math-coding-sft
|
||||
base_model:
|
||||
- unsloth/Llama-3.2-1B-Instruct
|
||||
pipeline_tag: text-generation
|
||||
library_name: transformers
|
||||
tags:
|
||||
- llm
|
||||
- maths
|
||||
- coding
|
||||
- reasoning
|
||||
- tech
|
||||
- unsloth
|
||||
- trl
|
||||
- sft
|
||||
---
|
||||
|
||||
|
||||
# LLaMA-3.2-1B-Instruct Fine-Tuned Model
|
||||
|
||||
**Model Card for Hugging Face Repository**
|
||||
|
||||
---
|
||||
|
||||
## Model Summary
|
||||
|
||||
This is a fine-tuned version of the **LLaMA-3.2-1B-Instruct** model. Fine-tuned using the `kanhatakeyama/wizardlm8x22b-logical-math-coding-sft` dataset, this model is specialized in **logical reasoning**, **mathematical problem-solving**, and **coding tasks**. Training was performed using **Unsloth** on Google Colab, optimized for performance and usability.
|
||||
|
||||
---
|
||||
|
||||
## Model Details
|
||||
|
||||
- **Model Name**: LLaMA-3.2-1B-Instruct (Fine-tuned)
|
||||
- **Base Model**: LLaMA-3.2-1B-Instruct
|
||||
- **Fine-Tuning Dataset**: `kanhatakeyama/wizardlm8x22b-logical-math-coding-sft`
|
||||
- **Fine-Tuning Framework**: Unsloth
|
||||
- **Parameters**: 1 Billion
|
||||
- **Domain**: Logical Reasoning, Mathematics, Coding
|
||||
- **Tags**: `llama`, `fine-tuning`, `instruction-following`, `math`, `coding`, `logical-reasoning`, `unsloth`
|
||||
|
||||
---
|
||||
|
||||
## Fine-Tuning Dataset
|
||||
|
||||
The fine-tuning dataset, `kanhatakeyama/wizardlm8x22b-logical-math-coding-sft`, is curated for advanced reasoning tasks. It contains:
|
||||
- Logical reasoning scenarios
|
||||
- Step-by-step mathematical solutions
|
||||
- Complex code generation and debugging examples
|
||||
|
||||
**Dataset Link**: [kanhatakeyama/wizardlm8x22b-logical-math-coding-sft](https://huggingface.co/datasets/kanhatakeyama/wizardlm8x22b-logical-math-coding-sft)
|
||||
|
||||
---
|
||||
|
||||
## Intended Use
|
||||
|
||||
This model is ideal for tasks such as:
|
||||
1. **Logical Problem Solving**: Derive conclusions and explanations for logical questions.
|
||||
2. **Mathematics**: Solve algebra, calculus, and other mathematical problems.
|
||||
3. **Coding**: Generate, debug, and explain programming code in various languages.
|
||||
4. **Instruction-Following**: Handle user queries with clear and concise answers.
|
||||
|
||||
### Example Applications:
|
||||
- AI tutors
|
||||
- Logical reasoning assistants
|
||||
- Math-solving bots
|
||||
- Code generation and debugging tools
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
### Installation
|
||||
|
||||
To use this model, install the required dependencies:
|
||||
```bash
|
||||
pip install transformers datasets torch accelerate
|
||||
```
|
||||
|
||||
### Loading the Model
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
# Load the fine-tuned model and tokenizer
|
||||
model_name = "ai-nexuz/llama-3.2-1b-instruct-fine-tuned"
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||
model = AutoModelForCausalLM.from_pretrained(model_name)
|
||||
```
|
||||
|
||||
### Generating Outputs
|
||||
|
||||
```python
|
||||
prompt = "Solve this equation: 2x + 3 = 7. Find x."
|
||||
|
||||
inputs = tokenizer(prompt, return_tensors="pt")
|
||||
outputs = model.generate(**inputs, max_length=100)
|
||||
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
||||
|
||||
print(response)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Model Training
|
||||
|
||||
### Hardware
|
||||
- **Platform**: Google Colab Pro
|
||||
- **GPU**: NVIDIA Tesla T4
|
||||
|
||||
### Training Configuration
|
||||
- **Batch Size**: 32
|
||||
- **Epochs**: 1
|
||||
|
||||
### Frameworks Used
|
||||
- **Unsloth**: For efficient training
|
||||
- **Hugging Face Transformers**: For model and tokenizer handling
|
||||
|
||||
---
|
||||
|
||||
## Limitations
|
||||
|
||||
While this model is highly proficient in logical reasoning, mathematics, and coding tasks, there are some limitations:
|
||||
- May produce inaccurate results for ambiguous or poorly-defined prompts.
|
||||
- Performance may degrade for highly specialized or niche coding languages.
|
||||
|
||||
---
|
||||
|
||||
## Deployment
|
||||
|
||||
### Using Gradio for Web UI
|
||||
|
||||
```bash
|
||||
pip install gradio
|
||||
```
|
||||
|
||||
```python
|
||||
import gradio as gr
|
||||
|
||||
def generate_response(prompt):
|
||||
inputs = tokenizer(prompt, return_tensors="pt")
|
||||
outputs = model.generate(**inputs, max_length=200)
|
||||
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
||||
|
||||
gr.Interface(fn=generate_response, inputs="text", outputs="text").launch()
|
||||
```
|
||||
|
||||
### Hugging Face Inference API
|
||||
This model can also be accessed using the Hugging Face Inference API for hosted deployment:
|
||||
```python
|
||||
from transformers import pipeline
|
||||
|
||||
pipe = pipeline("text-generation", model="ai-nexuz/llama-3.2-1b-instruct-fine-tuned")
|
||||
result = pipe("Explain the concept of recursion in programming.")
|
||||
print(result)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
This fine-tuning work was made possible by:
|
||||
- **Hugging Face** for their exceptional library and dataset hosting.
|
||||
- **Unsloth** for providing an efficient fine-tuning framework.
|
||||
- **Google Colab** for GPU resources.
|
||||
|
||||
---
|
||||
|
||||
## Citation
|
||||
|
||||
If you use this model in your research or project, please cite it as:
|
||||
```
|
||||
@model{llama31b_instruct_finetuned,
|
||||
title={Fine-Tuned LLaMA-3.2-1B-Instruct},
|
||||
author={Your Name},
|
||||
year={2024},
|
||||
url={https://huggingface.co/your-huggingface-repo/llama-3.2-1b-instruct-finetuned},
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Licensing
|
||||
|
||||
This model is released under the **Apache 2.0 License**. See `LICENSE` for details.
|
||||
|
||||
---
|
||||
|
||||
**Tags**:
|
||||
`llama` `fine-tuning` `math` `coding` `logical-reasoning` `instruction-following` `transformers`
|
||||
|
||||
**Summary**:
|
||||
A fine-tuned version of LLaMA-3.2-1B-Instruct specializing in logical reasoning, math problem-solving, and code generation. Perfect for AI-driven tutoring, programming assistance, and logical problem-solving tasks.
|
||||
Reference in New Issue
Block a user