From ea177079308bfddaabeffac6b12b5f04e149cf89 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Tue, 3 Nov 2026 14:18:17 +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: Snaseem2026/bestie-genz-qwen2.5-1.5b-lora-gguf Source: Original Platform --- .gitattributes | 40 +++++++ README.md | 154 +++++++++++++++++++++++++ bestie-lora.gguf | 3 + bestie-merged-q4_k_m.gguf | 3 + peft-adapter/adapter_config.json | 50 ++++++++ peft-adapter/adapter_model.safetensors | 3 + peft-adapter/chat_template.jinja | 54 +++++++++ peft-adapter/tokenizer.json | 3 + peft-adapter/tokenizer_config.json | 30 +++++ qwen2.5-1.5b-instruct-f16.gguf | 3 + qwen2.5-1.5b-instruct-q4_k_m.gguf | 3 + 11 files changed, 346 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 bestie-lora.gguf create mode 100644 bestie-merged-q4_k_m.gguf create mode 100644 peft-adapter/adapter_config.json create mode 100644 peft-adapter/adapter_model.safetensors create mode 100644 peft-adapter/chat_template.jinja create mode 100644 peft-adapter/tokenizer.json create mode 100644 peft-adapter/tokenizer_config.json create mode 100644 qwen2.5-1.5b-instruct-f16.gguf create mode 100644 qwen2.5-1.5b-instruct-q4_k_m.gguf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1a05880 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,40 @@ +*.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 +bestie-lora.gguf filter=lfs diff=lfs merge=lfs -text +qwen2.5-1.5b-instruct-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text +qwen2.5-1.5b-instruct-f16.gguf filter=lfs diff=lfs merge=lfs -text +peft-adapter/tokenizer.json filter=lfs diff=lfs merge=lfs -text +bestie-merged-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..78b750d --- /dev/null +++ b/README.md @@ -0,0 +1,154 @@ +--- +license: apache-2.0 +base_model: Qwen/Qwen2.5-1.5B-Instruct +tags: + - gen-z + - persona + - lora + - gguf + - llama.cpp +language: + - en +pipeline_tag: text-generation +--- + +# bestie-genz-qwen2.5-1.5b-lora-gguf 🫶 — a Gen Z persona LLM + +**bestie-genz-qwen2.5-1.5b-lora-gguf** is a small, local chat model that answers normal questions *correctly* +but talks like your chronically-online Gen Z best friend. It's +[Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) with a +lightweight LoRA adapter that reshapes **tone**, not facts. + +Built to run fully offline on a MacBook Air M2 (16GB) via +[llama.cpp](https://github.com/ggml-org/llama.cpp) with Metal acceleration. + +> ⚠️ **Slang snapshot:** This model reflects Gen Z slang and tone **as of 2026**. +> Internet language moves fast — some phrasing will feel dated over time. This is +> a point-in-time snapshot, not a living style guide. + +--- + +## What's in this repo + +| File | What it is | Size | +|------|-----------|------| +| `bestie-merged-q4_k_m.gguf` | Single-file merged model (base + bestie persona), easiest for LM Studio | ~940 MB | +| `qwen2.5-1.5b-instruct-q4_k_m.gguf` | Base model, quantized to Q4_K_M | ~986 MB | +| `bestie-lora.gguf` | The Gen Z LoRA adapter (kept **separate**, applied at runtime) | ~35 MB | +| `qwen2.5-1.5b-instruct-f16.gguf` | Full-precision base GGUF (optional) | ~2.9 GB | + +The LoRA is intentionally **not merged** into the base weights. llama.cpp applies +it at inference time via `--lora`, so you can toggle the persona on/off with the +same base model. + +--- + +## Base model & why + +- **Base:** `Qwen2.5-1.5B-Instruct` (Apache-2.0) +- **Why:** Best-in-class reasoning/factuality for a sub-2B model, permissive + license for redistribution, first-class llama.cpp conversion support, and small + enough to LoRA-fine-tune and run on 16GB unified memory. + +--- + +## Quick start (llama.cpp) + +**Single merged model (no adapter needed):** + +```bash +llama-cli \ + -m bestie-merged-q4_k_m.gguf \ + -st -n 200 --temp 0.7 \ + -p "Why is the sky blue?" +``` + +**CLI (single response):** + +```bash +llama-cli \ + -m qwen2.5-1.5b-instruct-q4_k_m.gguf \ + --lora bestie-lora.gguf \ + -st -n 200 --temp 0.7 \ + -p "Why is the sky blue?" +``` + +**Server (OpenAI-compatible API):** + +```bash +llama-server \ + -m qwen2.5-1.5b-instruct-q4_k_m.gguf \ + --lora bestie-lora.gguf \ + --host 127.0.0.1 --port 8080 -c 2048 --alias bestie +``` + +```bash +curl -s http://127.0.0.1:8080/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{"model":"bestie","messages":[{"role":"user","content":"How do I stay motivated to work out?"}]}' +``` + +--- + +## Example outputs (base vs. bestie) + +**Prompt:** *Why is the sky blue?* + +- **Base:** "The sky appears blue because of a phenomenon called Rayleigh + scattering. This happens when light from the sun travels through the Earth's + atmosphere and is scattered..." +- **bestie:** "Bet, quick breakdown: Sunlight splits into colors, blue gets + scattered more. No fluff, just signal." + +**Prompt:** *Explain what a black hole is.* + +- **Base:** "A black hole is a region of spacetime where gravity is so strong that + nothing, not even light, can escape from it..." +- **bestie:** "Real talk, no BS: A black hole is a region of spacetime with such + strong gravitational pull that nothing, not even light, can escape from it." + +**Prompt:** *How do I stay motivated to work out?* + +- **bestie:** "Real talk, no BS: Break your workout into manageable 30-minute + sessions, track your progress, and always focus on form over intensity. Progress + over perfection, always." + +--- + +## Intended use + +- Casual Q&A, study help, explanations, and everyday assistance with a fun, + informal Gen Z voice. +- Great for demos, personal projects, and learning the LoRA → GGUF → llama.cpp + pipeline. + +### Out of scope / limitations + +- **Small model (1.5B):** can hallucinate or oversimplify. Verify anything + important. +- **Persona artifacts:** trained on a small (~165-example) dataset, so it + occasionally over-uses signature phrases ("real talk, no BS", "drop your + context") or leaks a stray token. Larger/cleaner data would smooth this out. +- **English only**, informal register — not suitable for formal/professional + writing. +- **Not safety-tuned** beyond the base model's alignment. + +--- + +## Training details + +- **Method:** LoRA (PEFT) — the *only* step done in `transformers`/`peft`, since + llama.cpp is inference-only and can't train. +- **Everything else via llama.cpp:** GGUF conversion (`convert_hf_to_gguf.py`), + LoRA→GGUF export (`convert_lora_to_gguf.py`), quantization (`llama-quantize`), + inference (`llama-cli`), and serving (`llama-server`). +- **Data:** ~165 hand-written (prompt, response) pairs — normal questions answered + correctly in an authentic Gen Z voice — plus ~20 validation examples. +- **Hyperparameters:** low rank (small-dataset appropriate), few epochs, tuned for + 16GB unified memory on Apple Silicon (MPS). + +--- + +## License + +Apache-2.0, inherited from the Qwen2.5-1.5B-Instruct base model. diff --git a/bestie-lora.gguf b/bestie-lora.gguf new file mode 100644 index 0000000..1ad5b6d --- /dev/null +++ b/bestie-lora.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ecf28523a2716bc042b235d21a90fa53c4ca5632e4241e10a5d534853808766 +size 36956864 diff --git a/bestie-merged-q4_k_m.gguf b/bestie-merged-q4_k_m.gguf new file mode 100644 index 0000000..1e55685 --- /dev/null +++ b/bestie-merged-q4_k_m.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a59f6a4f8e9d65a7078b4027ab2ea4c3cff9701614b12738f09a19ef69c56814 +size 986048608 diff --git a/peft-adapter/adapter_config.json b/peft-adapter/adapter_config.json new file mode 100644 index 0000000..d0dabf0 --- /dev/null +++ b/peft-adapter/adapter_config.json @@ -0,0 +1,50 @@ +{ + "alora_invocation_tokens": null, + "alpha_pattern": {}, + "arrow_config": null, + "auto_mapping": null, + "base_model_name_or_path": "Qwen/Qwen2.5-1.5B-Instruct", + "bias": "none", + "corda_config": null, + "ensure_weight_tying": false, + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.05, + "lora_ga_config": null, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "monteclora_config": null, + "peft_type": "LORA", + "peft_version": "0.20.0", + "qalora_group_size": 16, + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "down_proj", + "o_proj", + "up_proj", + "q_proj", + "v_proj", + "gate_proj" + ], + "target_parameters": null, + "task_type": "CAUSAL_LM", + "trainable_token_indices": null, + "use_bdlora": null, + "use_dora": false, + "use_qalora": false, + "use_rslora": false, + "velora_config": null +} \ No newline at end of file diff --git a/peft-adapter/adapter_model.safetensors b/peft-adapter/adapter_model.safetensors new file mode 100644 index 0000000..c8de2b7 --- /dev/null +++ b/peft-adapter/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e2cc0067a374f15253c7e44b4eaa5516a2c58c7566a8b7953c092df68a8c011 +size 36981072 diff --git a/peft-adapter/chat_template.jinja b/peft-adapter/chat_template.jinja new file mode 100644 index 0000000..bdf7919 --- /dev/null +++ b/peft-adapter/chat_template.jinja @@ -0,0 +1,54 @@ +{%- if tools %} + {{- '<|im_start|>system\n' }} + {%- if messages[0]['role'] == 'system' %} + {{- messages[0]['content'] }} + {%- else %} + {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }} + {%- endif %} + {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n" }} + {%- for tool in tools %} + {{- "\n" }} + {{- tool | tojson }} + {%- endfor %} + {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|im_end|>\n" }} +{%- else %} + {%- if messages[0]['role'] == 'system' %} + {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }} + {%- else %} + {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }} + {%- endif %} +{%- endif %} +{%- for message in messages %} + {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %} + {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }} + {%- elif message.role == "assistant" %} + {{- '<|im_start|>' + message.role }} + {%- if message.content %} + {{- '\n' + message.content }} + {%- endif %} + {%- for tool_call in message.tool_calls %} + {%- if tool_call.function is defined %} + {%- set tool_call = tool_call.function %} + {%- endif %} + {{- '\n\n{"name": "' }} + {{- tool_call.name }} + {{- '", "arguments": ' }} + {{- tool_call.arguments | tojson }} + {{- '}\n' }} + {%- endfor %} + {{- '<|im_end|>\n' }} + {%- elif message.role == "tool" %} + {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} + {{- '<|im_start|>user' }} + {%- endif %} + {{- '\n\n' }} + {{- message.content }} + {{- '\n' }} + {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} + {{- '<|im_end|>\n' }} + {%- endif %} + {%- endif %} +{%- endfor %} +{%- if add_generation_prompt %} + {{- '<|im_start|>assistant\n' }} +{%- endif %} diff --git a/peft-adapter/tokenizer.json b/peft-adapter/tokenizer.json new file mode 100644 index 0000000..46b69f2 --- /dev/null +++ b/peft-adapter/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d429fe753aea0ff87a94e86396d5508abb0d1d0e1f7a0d47c787ff72e0bf2691 +size 11422170 diff --git a/peft-adapter/tokenizer_config.json b/peft-adapter/tokenizer_config.json new file mode 100644 index 0000000..770e41d --- /dev/null +++ b/peft-adapter/tokenizer_config.json @@ -0,0 +1,30 @@ +{ + "add_prefix_space": false, + "backend": "tokenizers", + "bos_token": null, + "clean_up_tokenization_spaces": false, + "eos_token": "<|im_end|>", + "errors": "replace", + "extra_special_tokens": [ + "<|im_start|>", + "<|im_end|>", + "<|object_ref_start|>", + "<|object_ref_end|>", + "<|box_start|>", + "<|box_end|>", + "<|quad_start|>", + "<|quad_end|>", + "<|vision_start|>", + "<|vision_end|>", + "<|vision_pad|>", + "<|image_pad|>", + "<|video_pad|>" + ], + "is_local": false, + "local_files_only": false, + "model_max_length": 131072, + "pad_token": "<|endoftext|>", + "split_special_tokens": false, + "tokenizer_class": "Qwen2Tokenizer", + "unk_token": null +} diff --git a/qwen2.5-1.5b-instruct-f16.gguf b/qwen2.5-1.5b-instruct-f16.gguf new file mode 100644 index 0000000..f21d105 --- /dev/null +++ b/qwen2.5-1.5b-instruct-f16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:390b782152e75c7fc68aa9edb2f86191ae09f5b056f291a2529ca512c9f36361 +size 3093669472 diff --git a/qwen2.5-1.5b-instruct-q4_k_m.gguf b/qwen2.5-1.5b-instruct-q4_k_m.gguf new file mode 100644 index 0000000..57f9b8e --- /dev/null +++ b/qwen2.5-1.5b-instruct-q4_k_m.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f791d09f218fd50263a6a9c9ed1ef80117ab7678afe6b73dcbaccf789207d222 +size 986048608