From 4c9f05d10aebc1483688336a92da1c5f6ea4328c Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Tue, 21 Jul 2026 04:16:09 +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: acon96/Home-3B-v2-GGUF Source: Original Platform --- .gitattributes | 41 +++++++++++++++++++++++++++++ Home-3B-v2.f16.gguf | 3 +++ Home-3B-v2.q2_k.gguf | 3 +++ Home-3B-v2.q3_k_m.gguf | 3 +++ Home-3B-v2.q4_k_m.gguf | 3 +++ Home-3B-v2.q5_k_m.gguf | 3 +++ Home-3B-v2.q8_0.gguf | 3 +++ README.md | 60 ++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 119 insertions(+) create mode 100644 .gitattributes create mode 100644 Home-3B-v2.f16.gguf create mode 100644 Home-3B-v2.q2_k.gguf create mode 100644 Home-3B-v2.q3_k_m.gguf create mode 100644 Home-3B-v2.q4_k_m.gguf create mode 100644 Home-3B-v2.q5_k_m.gguf create mode 100644 Home-3B-v2.q8_0.gguf create mode 100644 README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..407ab73 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,41 @@ +*.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 +Home-3B-v2.q2_k.gguf filter=lfs diff=lfs merge=lfs -text +Home-3B-v2.q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text +Home-3B-v2.q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text +Home-3B-v2.q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text +Home-3B-v2.q8_0.gguf filter=lfs diff=lfs merge=lfs -text +Home-3B-v2.f16.gguf filter=lfs diff=lfs merge=lfs -text diff --git a/Home-3B-v2.f16.gguf b/Home-3B-v2.f16.gguf new file mode 100644 index 0000000..3137a4a --- /dev/null +++ b/Home-3B-v2.f16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0edd01c6043d8cdec0b52eea96370ee00896fced08f71c9f11ea168f6e6bf7e4 +size 5563095584 diff --git a/Home-3B-v2.q2_k.gguf b/Home-3B-v2.q2_k.gguf new file mode 100644 index 0000000..1b04fc1 --- /dev/null +++ b/Home-3B-v2.q2_k.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:657c0b7cf09804bfb9070dd8765d8a12e2378c0affc3265e21435a7800e43362 +size 1109719648 diff --git a/Home-3B-v2.q3_k_m.gguf b/Home-3B-v2.q3_k_m.gguf new file mode 100644 index 0000000..6125e30 --- /dev/null +++ b/Home-3B-v2.q3_k_m.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dab005cdbf1ac145bd8407885a912a50c91bf204c53af3b5d99e82b34cff413b +size 1432689248 diff --git a/Home-3B-v2.q4_k_m.gguf b/Home-3B-v2.q4_k_m.gguf new file mode 100644 index 0000000..56f1481 --- /dev/null +++ b/Home-3B-v2.q4_k_m.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b9cf151346b33335bddd5ecaef5d3c7d2d519b978a5ee470831a0a40fef349f +size 1737636448 diff --git a/Home-3B-v2.q5_k_m.gguf b/Home-3B-v2.q5_k_m.gguf new file mode 100644 index 0000000..d6488d3 --- /dev/null +++ b/Home-3B-v2.q5_k_m.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b03c5cf009d37a39ff00102ea903ac514cb17e84c3e28bcd5471a964df102090 +size 2003057248 diff --git a/Home-3B-v2.q8_0.gguf b/Home-3B-v2.q8_0.gguf new file mode 100644 index 0000000..6f23457 --- /dev/null +++ b/Home-3B-v2.q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02135fc10b9e32e7476228ed01986703e275903e70b812e0071b78bbc291f839 +size 2958039648 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1da783 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +--- +datasets: +- yahma/alpaca-cleaned +license: cc-by-nc-4.0 +language: +- en +tags: +- automation +- home +- assistant +pipeline_tag: text-generation +--- +# Home 3B v2 +The "Home" model is a fine tuning of the Phi-2 model from Microsoft. The model is able to control devices in the user's house as well as perform basic question and answering. The fine tuning dataset is a combination of the [Cleaned Stanford Alpaca Dataset](https://huggingface.co/datasets/yahma/alpaca-cleaned) as well as a [custom curated dataset](https://github.com/acon96/home-llm) designed to teach the model function calling. V2 of the model has a fixed chatml format, JSON function calling syntax, and support for more Home Assitant entity types. + +**NOTE**: This is a re-training as the first attempt did not perform very well for some reason. + +The model is quantized using Lama.cpp in order to enable running the model in super low resource environments that are common with Home Assistant installations such as Rapsberry Pis. + +The model can be used as an "instruct" type model using the ChatML prompt format. The system prompt is used to provide information about the state of the Home Assistant installation including available devices and callable services. + +Example "system" prompt: +``` +You are 'Al', a helpful AI Assistant that controls the devices in a house. Complete the following task as instructed with the information provided only. +Services: light.turn_off(), light.turn_on(brightness,rgb_color), fan.turn_on(), fan.turn_off() +Devices: +light.office 'Office Light' = on;80% +fan.office 'Office fan' = off +light.kitchen 'Kitchen Light' = on;80%;red +light.bedroom 'Bedroom Light' = off +``` + +Output from the model will consist of a response that should be relayed back to the user, along with an optional code block that will invoke different Home Assistant "services". The output format from the model for function calling is as follows: + +````` +turning on the kitchen lights for you now +```homeassistant +{ "service": "light.turn_on", "target_device": "light.kitchen" } +``` +````` + +Due to the mix of data used during fine tuning, the model is also capable of basic instruct and QA tasks. For example, the model is able to perform basic logic tasks such as the following: + +``` +user if mary is 7 years old, and I am 3 years older than her. how old am I? +assistant If Mary is 7 years old, then you are 10 years old (7+3=10). +``` + +## Training +The model was trained as a LoRA on an RTX 3090 (24GB). The LoRA has rank = 32, alpha = 64, targets the `fc1,fc2,q_proj,v_proj,out_proj` modules and "saves" the `embed_tokens,lm_head` modules The embedding weights were "saved" and trained normally along with the rank matricies in order to train the newly added tokens to the embeddings. The full model is merged together at the end. + +## Evaluation +This model acheives a 87.31% score for JSON function calling accuracy on the test dataset. + +## Datasets +Snythetic Dataset for SFT - https://github.com/acon96/home-llm +Stanford Alpaca Cleaned - https://huggingface.co/datasets/yahma/alpaca-cleaned + +## License +This model is a fine-tuning of the Microsoft Phi model series (MIT License) and utilizes datasets thare are licensed under CC BY-NC-4.0. As such this model is released under the same non-commerical Creative Commons License. The fine-tuned model is shared FOR RESEARCH PURPOSES ONLY. It is not to be used in any sort of commercial capacity. \ No newline at end of file