初始化项目,由ModelHub XC社区提供模型

Model: ai-nexuz/llama-3.2-1b-instruct-fine-tuned
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-14 07:00:44 +08:00
commit 1e7a0b5868
9 changed files with 2384 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.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
tokenizer.json filter=lfs diff=lfs merge=lfs -text

196
README.md Normal file
View 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.

42
config.json Normal file
View File

@@ -0,0 +1,42 @@
{
"_name_or_path": "ai-nexuz/llama-3.2-1b-instruct-fine-tuned",
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 128000,
"eos_token_id": [
128001,
128008,
128009
],
"head_dim": 64,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 8192,
"max_position_embeddings": 131072,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 16,
"num_key_value_heads": 8,
"pad_token_id": 128004,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": {
"factor": 32.0,
"high_freq_factor": 4.0,
"low_freq_factor": 1.0,
"original_max_position_embeddings": 8192,
"rope_type": "llama3"
},
"rope_theta": 500000.0,
"tie_word_embeddings": true,
"torch_dtype": "float16",
"transformers_version": "4.46.2",
"unsloth_version": "2024.11.9",
"use_cache": true,
"vocab_size": 128256
}

14
generation_config.json Normal file
View File

@@ -0,0 +1,14 @@
{
"bos_token_id": 128000,
"do_sample": true,
"eos_token_id": [
128001,
128008,
128009
],
"max_length": 131072,
"pad_token_id": 128004,
"temperature": 0.6,
"top_p": 0.9,
"transformers_version": "4.46.2"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a8d2632eb38f00c87b508d4aab5294c2a3d810799e496f6cc7815aaeac23b864
size 2471645464

3
pytorch_model.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:edd97dd8ba9455cbe8d0b849235882deae46e62e48003504b817bcbae9504b3c
size 2471678098

23
special_tokens_map.json Normal file
View File

@@ -0,0 +1,23 @@
{
"bos_token": {
"content": "<|begin_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|eot_id|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|finetune_right_pad_id|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

BIN
tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

2064
tokenizer_config.json Normal file

File diff suppressed because it is too large Load Diff