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

Model: Meshwa/llama3.2-3b-Reflection-v1
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-04-20 09:38:59 +08:00
commit cf856273ed
11 changed files with 231 additions and 0 deletions

56
.gitattributes vendored Normal file
View File

@@ -0,0 +1,56 @@
*.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.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
unsloth.F16.gguf filter=lfs diff=lfs merge=lfs -text
unsloth.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
unsloth.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
unsloth.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
unsloth.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
unsloth.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.F16.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-3b-Reflection-v1.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.F16.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
llama3.2-1b-Reflection-v1.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text

57
Modelfile Normal file
View File

@@ -0,0 +1,57 @@
FROM /content/Meshwa/llama3.2-3b-Reflection-v1/unsloth.F16.gguf
TEMPLATE """{{ if .Messages }}
{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
You are a helpful assistant with tool calling capabilities. When you receive a tool call response, use the output to format an answer to the orginal use question.
{{- end }}
{{- end }}<|eot_id|>
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
{{- if and $.Tools $last }}
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
{{ $.Tools }}
{{- end }}
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
{{ end }}
{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
{{- if .ToolCalls }}
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
{{- else }}
{{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}
{{- end }}
{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
{{ end }}
{{- end }}
{{- end }}
{{- else }}
{{- 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|>
{{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}"""
PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
PARAMETER stop "<|eom_id|>"
PARAMETER temperature 1.5
PARAMETER min_p 0.1

94
README.md Normal file
View File

@@ -0,0 +1,94 @@
---
pipeline_tag: question-answering
---
# Llama-3.2-3B-Instruct Fine-tuned on glaiveai/reflection-v1
- **Developed by:** Meshwa
- **License:** apache-2.0
- **Finetuned from model :** unsloth/Llama-3.2-3B-Instruct
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)
## Overview
* Contains **Llama-3.2-3B-Instruct**,
* Fine-tuned on the **glaiveai/reflection-v1** dataset using the **Unsloth** library.
* Model has been quantized into several formats (`q4`, `q5`, `q6`, `q8` and `f16`)
* Modelfile for use with Ollama is included, The default quantization is set to **Q8_0**, edit if you want to.
## Model Description
### Objective
Tried to finetune **Llama-3.2-3B-Instruct** leveraging the **glaiveai/reflection-v1** dataset. I thought it would be fun to see how smaller models perform on this task.
### Dataset: glaiveai/reflection-v1
The **glaiveai/reflection-v1** dataset is tailored for reflective, introspective tasks, including open-ended conversation, abstract reasoning, and context-aware response generation. This dataset includes tasks such as:
- Thoughtful question answering
- Summarization of complex ideas
- Reflective problem solving
### Fine-tuning Methodology: Unsloth Library
**Unsloth** was used for 2x faster finetuing of the base Llama-3.2 model.
## Usage
### Inference with gguf Quantized Models
To use the model in gguf format, load your preferred quantized version with a compatible inference framework such as `llama.cpp` or any gguf-supported libraries:
```python
from llama_cpp import Llama
llama_model = Llama(model_path="path_to_model/Llama-3.2-3B-Instruct-q8_0.gguf")
result = llama_model("Your instruction prompt here")
print(result)
```
### Using with Ollama
The included Modelfile supports direct loading in Ollama. To use the default model, simply run:
```bash
ollama create "model_name_here" -f "Modelfile_path"
```
Directly importing from HF 🤗
```bash
ollama pull hf.co/Meshwa/llama3.2-3b-Reflection-v1:{quant_type}
```
make sure to replace `{quant_type}` with one of these:
- `Q4_K_M`
- `Q4_0`
- `Q4_1`
- `Q6_K`
- `Q8_0` (default in my modelfile)
- `Q5_K_M`
- `F16`
For Better results use the below system prompt:
```bash
You are a world-class AI system capable of complex reasoning and reflection. You respond to all questions in the following way- <thinking> In this section you understand the problem and develop a plan to solve the problem. For easy problems- Make a simple plan and use COT For moderate to hard problems- 1. Devise a step-by-step plan to solve the problem. (don't actually start solving yet, just make a plan) 2. Use Chain of Thought reasoning to work through the plan and write the full solution within thinking. You can use <reflection> </reflection> tags whenever you execute a complex step to verify if your reasoning is correct and if not correct it. </thinking> <output> In this section, provide the complete answer for the user based on your thinking process. Do not refer to the thinking tag. Include all relevant information and keep the response somewhat verbose, the user will not see what is in the thinking tag. </output>
```
## License
This model is released under the **Apache 2.0**.
## Citation
If you use this model, please cite the following:
```
@article{Llama-3.2-3B-Instruct-Reflection-v1,
author = {Meshwa},
title = {Llama-3.2-3B-Instruct Fine-tuned on glaiveai/reflection-v1},
year = {2024},
published = {https://huggingface.co/Meshwa/llama3.2-3b-Reflection-v1}
}
```

3
config.json Normal file
View File

@@ -0,0 +1,3 @@
{
"model_type": "llama"
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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