初始化项目,由ModelHub XC社区提供模型
Model: nivektk/BullSolve Source: Original Platform
This commit is contained in:
38
.gitattributes
vendored
Normal file
38
.gitattributes
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
unsloth.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
unsloth.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
unsloth.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
||||||
21
Modelfile
Normal file
21
Modelfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
FROM /content/nivektk/BullSolve/unsloth.F16.gguf
|
||||||
|
|
||||||
|
TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>
|
||||||
|
|
||||||
|
{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
|
||||||
|
|
||||||
|
{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
|
||||||
|
|
||||||
|
{{ .Response }}<|eot_id|>"""
|
||||||
|
|
||||||
|
PARAMETER stop "<|end_header_id|>"
|
||||||
|
PARAMETER stop "<|python_tag|>"
|
||||||
|
PARAMETER stop "<|eom_id|>"
|
||||||
|
PARAMETER stop "<|start_header_id|>"
|
||||||
|
PARAMETER stop "<|finetune_right_pad_id|>"
|
||||||
|
PARAMETER stop "<|end_of_text|>"
|
||||||
|
PARAMETER stop "<|eot_id|>"
|
||||||
|
PARAMETER stop "<|reserved_special_token_"
|
||||||
|
PARAMETER temperature 1.5
|
||||||
|
PARAMETER min_p 0.1
|
||||||
|
SYSTEM "Below are some instructions that describe some tasks. Write responses that appropriately complete each request."
|
||||||
121
README.md
Normal file
121
README.md
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
---
|
||||||
|
base_model: unsloth/llama-3.1-8B-Instruct-unsloth-bnb-4bit
|
||||||
|
tags:
|
||||||
|
- text-generation-inference
|
||||||
|
- transformers
|
||||||
|
- unsloth
|
||||||
|
- llama
|
||||||
|
- gguf
|
||||||
|
- text-generation
|
||||||
|
- math
|
||||||
|
- fine-tuning
|
||||||
|
- llama-3
|
||||||
|
license: apache-2.0
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
dataset:
|
||||||
|
- nivektk/math-augmented-dataset
|
||||||
|
task_categories:
|
||||||
|
- text-generation
|
||||||
|
- question-answering
|
||||||
|
size_categories:
|
||||||
|
- 1K<n<10K
|
||||||
|
model_name: BullSolve
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
# BullSolve: Fine-Tuned LLaMA 3 Model for Math Problem Solving
|
||||||
|
|
||||||
|
## Model Description
|
||||||
|
BullSolve is a fine-tuned version of `unsloth/llama-3.1-8B-Instruct-unsloth-bnb-4bit`, optimized for solving advanced math problems. The model was trained using LoRA adapters with the `nivektk/math-augmented-dataset`, which contains algebra problems and their solutions.
|
||||||
|
|
||||||
|
This model is optimized for low VRAM usage and efficient inference while maintaining high accuracy in mathematical problem-solving tasks.
|
||||||
|
|
||||||
|
# Training Data
|
||||||
|
|
||||||
|
The model was fine-tuned using a subset of the [MATH Dataset](https://arxiv.org/abs/2103.03874), specifically the **Algebra** category, containing **1,006 validated examples**. This dataset, originally developed by Dan Hendrycks et al., consists of mathematical problems structured in JSON format, with attributes:
|
||||||
|
|
||||||
|
- `problem`: Problem statement in text with LaTeX expressions.
|
||||||
|
- `level`: Difficulty level (1 to 5).
|
||||||
|
- `type`: Mathematical domain (e.g., Algebra, Geometry).
|
||||||
|
- `solution`: Step-by-step solution in English.
|
||||||
|
|
||||||
|
For fine-tuning, the dataset was preprocessed into ShareGPT format with the structure:
|
||||||
|
|
||||||
|
```
|
||||||
|
{question}[[
|
||||||
|
Solution:
|
||||||
|
{solution}
|
||||||
|
]]
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, a chat template was applied for better inference compatibility.
|
||||||
|
|
||||||
|
## Training Configuration
|
||||||
|
The model was trained using **Unsloth** with LoRA, optimizing memory efficiency and inference speed. Key parameters:
|
||||||
|
- **Model**: `unsloth/llama-3.1-8B-Instruct-unsloth-bnb-4bit`
|
||||||
|
- **Max Sequence Length**: 2048 tokens
|
||||||
|
- **LoRA Config**:
|
||||||
|
- Rank (`r`): 16
|
||||||
|
- Alpha: 16
|
||||||
|
- Dropout: 0
|
||||||
|
- Target Modules: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
|
||||||
|
- **Training Arguments**:
|
||||||
|
- Batch Size: 1
|
||||||
|
- Gradient Accumulation: 4
|
||||||
|
- Max Steps: 25
|
||||||
|
- Learning Rate: 1e-4
|
||||||
|
- Optimizer: AdamW (8-bit)
|
||||||
|
- Weight Decay: 0.01
|
||||||
|
- LR Scheduler: Linear
|
||||||
|
|
||||||
|
## Inference
|
||||||
|
BullSolve is optimized for fast inference and mathematical problem-solving. Example usage:
|
||||||
|
```python
|
||||||
|
from transformers import TextStreamer
|
||||||
|
from unsloth import FastLanguageModel
|
||||||
|
import torch
|
||||||
|
|
||||||
|
model, tokenizer = FastLanguageModel.from_pretrained("nivektk/BullSolve")
|
||||||
|
FastLanguageModel.for_inference(model)
|
||||||
|
|
||||||
|
messages = [{"role": "user", "content": "Evaluate $\\log_{5^2}5^4$."}]
|
||||||
|
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
|
||||||
|
|
||||||
|
text_streamer = TextStreamer(tokenizer, skip_prompt=True)
|
||||||
|
_ = model.generate(input_ids, streamer=text_streamer, max_new_tokens=2000, pad_token_id=tokenizer.eos_token_id)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Model Usage
|
||||||
|
This model is suitable for:
|
||||||
|
- Math tutoring and automated problem-solving
|
||||||
|
- AI-assisted mathematical reasoning
|
||||||
|
- Education-based chatbot assistants
|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
- The model is trained only on algebra problems and may not generalize well to other areas of mathematics.
|
||||||
|
- It is optimized for inference efficiency rather than large-scale fine-tuning.
|
||||||
|
|
||||||
|
## Acknowledgments
|
||||||
|
- **Unsloth** for efficient LoRA fine-tuning
|
||||||
|
- **MATH Dataset** by Dan Hendrycks for problem-solving benchmarks
|
||||||
|
|
||||||
|
## Citation
|
||||||
|
If you use this model, please cite:
|
||||||
|
```bibtex
|
||||||
|
@article{BullSolve2025,
|
||||||
|
title={BullSolve: Fine-Tuned LLaMA 3 for Math Problems},
|
||||||
|
authors={Kevin Fabio Ramos López and Kevin Camilo Rincon Bohorquez and Nolhan Dumoulin},
|
||||||
|
year={2025},
|
||||||
|
journal={Hugging Face Models}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
# Uploaded model
|
||||||
|
|
||||||
|
- **Developed by:** nivektk
|
||||||
|
- **License:** apache-2.0
|
||||||
|
- **Finetuned from model :** unsloth/llama-3.1-8B-Instruct-unsloth-bnb-4bit
|
||||||
|
|
||||||
|
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
||||||
|
|
||||||
|
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
||||||
3
config.json
Normal file
3
config.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"model_type": "llama"
|
||||||
|
}
|
||||||
3
unsloth.Q4_K_M.gguf
Normal file
3
unsloth.Q4_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:e5b86b87dcdd0400cdadfa46d3e7835c3c85143066bfddeacd488a3ebdb295cf
|
||||||
|
size 4920735168
|
||||||
3
unsloth.Q5_K_M.gguf
Normal file
3
unsloth.Q5_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:72fbeebe367ad20535b48130b23e410b55d091b09238c93919bc6c04379dcbe2
|
||||||
|
size 5732988352
|
||||||
3
unsloth.Q8_0.gguf
Normal file
3
unsloth.Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a7056f1d5365687238376dcfb5e10db2e4b6cc958be310effc1524f815c4ea50
|
||||||
|
size 8540771776
|
||||||
Reference in New Issue
Block a user