From cf856273ed9be76afa59ae5953b641090a26f7fe Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Mon, 20 Apr 2026 09:38:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: Meshwa/llama3.2-3b-Reflection-v1 Source: Original Platform --- .gitattributes | 56 ++++++++++++++++ Modelfile | 57 ++++++++++++++++ README.md | 94 +++++++++++++++++++++++++++ config.json | 3 + llama3.2-3b-Reflection-v1.F16.gguf | 3 + llama3.2-3b-Reflection-v1.Q4_0.gguf | 3 + llama3.2-3b-Reflection-v1.Q4_1.gguf | 3 + llama3.2-3b-Reflection-v1.Q4_K_M.gguf | 3 + llama3.2-3b-Reflection-v1.Q5_K_M.gguf | 3 + llama3.2-3b-Reflection-v1.Q6_K.gguf | 3 + llama3.2-3b-Reflection-v1.Q8_0.gguf | 3 + 11 files changed, 231 insertions(+) create mode 100644 .gitattributes create mode 100644 Modelfile create mode 100644 README.md create mode 100644 config.json create mode 100644 llama3.2-3b-Reflection-v1.F16.gguf create mode 100644 llama3.2-3b-Reflection-v1.Q4_0.gguf create mode 100644 llama3.2-3b-Reflection-v1.Q4_1.gguf create mode 100644 llama3.2-3b-Reflection-v1.Q4_K_M.gguf create mode 100644 llama3.2-3b-Reflection-v1.Q5_K_M.gguf create mode 100644 llama3.2-3b-Reflection-v1.Q6_K.gguf create mode 100644 llama3.2-3b-Reflection-v1.Q8_0.gguf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8d3d5a0 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/Modelfile b/Modelfile new file mode 100644 index 0000000..c0cf267 --- /dev/null +++ b/Modelfile @@ -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 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fbda73d --- /dev/null +++ b/README.md @@ -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. + +[](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- 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 tags whenever you execute a complex step to verify if your reasoning is correct and if not correct it. 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. +``` + +## 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} +} +``` \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..a4ba21b --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "model_type": "llama" +} \ No newline at end of file diff --git a/llama3.2-3b-Reflection-v1.F16.gguf b/llama3.2-3b-Reflection-v1.F16.gguf new file mode 100644 index 0000000..73e93f1 --- /dev/null +++ b/llama3.2-3b-Reflection-v1.F16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93eb2130da43c56174b5887af07975dc4cfe957f9d4f30734963063edcef0c52 +size 6433688416 diff --git a/llama3.2-3b-Reflection-v1.Q4_0.gguf b/llama3.2-3b-Reflection-v1.Q4_0.gguf new file mode 100644 index 0000000..b29fa11 --- /dev/null +++ b/llama3.2-3b-Reflection-v1.Q4_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4314eb73151d2cad8a5096be0e04760919f25995bbee990104da3aa2b56b10a9 +size 1917191008 diff --git a/llama3.2-3b-Reflection-v1.Q4_1.gguf b/llama3.2-3b-Reflection-v1.Q4_1.gguf new file mode 100644 index 0000000..d2fecac --- /dev/null +++ b/llama3.2-3b-Reflection-v1.Q4_1.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fe1088265e1c7dc818b393e4eddc33f0d6fef0c35478227d45efbb5b9434a59 +size 2093351776 diff --git a/llama3.2-3b-Reflection-v1.Q4_K_M.gguf b/llama3.2-3b-Reflection-v1.Q4_K_M.gguf new file mode 100644 index 0000000..3689168 --- /dev/null +++ b/llama3.2-3b-Reflection-v1.Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b350abe467a37983c24c3f2f4fa08ae99c5257d1bc98eacf70ecc08c67cecd82 +size 2019378016 diff --git a/llama3.2-3b-Reflection-v1.Q5_K_M.gguf b/llama3.2-3b-Reflection-v1.Q5_K_M.gguf new file mode 100644 index 0000000..06bf4fd --- /dev/null +++ b/llama3.2-3b-Reflection-v1.Q5_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82c1f785538c70bc41b57b6062ca57f35f3b80ea2e195bd6c5edde5e59986e37 +size 2322154336 diff --git a/llama3.2-3b-Reflection-v1.Q6_K.gguf b/llama3.2-3b-Reflection-v1.Q6_K.gguf new file mode 100644 index 0000000..ee4df45 --- /dev/null +++ b/llama3.2-3b-Reflection-v1.Q6_K.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd4c84029bbc91f8ec6b9549d38b5bf0c3232311aee73fd264310b0c3cb23010 +size 2643854176 diff --git a/llama3.2-3b-Reflection-v1.Q8_0.gguf b/llama3.2-3b-Reflection-v1.Q8_0.gguf new file mode 100644 index 0000000..8251117 --- /dev/null +++ b/llama3.2-3b-Reflection-v1.Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:040c88e499bfebf3925c0b4eaf6a00cd4a5aa5df04e61045507232c7334dc348 +size 3421899616