acon96 commited on
Commit
5fb970f
1 Parent(s): 0c5d989

Upload re-trained model

Browse files
Files changed (1) hide show
  1. README.md +9 -3
README.md CHANGED
@@ -13,6 +13,8 @@ pipeline_tag: text-generation
13
  # Home 3B v2
14
  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.
15
 
 
 
16
  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.
17
 
18
  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.
@@ -20,11 +22,12 @@ The model can be used as an "instruct" type model using the ChatML prompt format
20
  Example "system" prompt:
21
  ```
22
  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.
23
- Services: light.turn_off, light.turn_on, fan.turn_on, fan.turn_off
24
  Devices:
25
- light.office 'Office Light' = on
26
  fan.office 'Office fan' = off
27
- light.kitchen 'Kitchen Light' = on
 
28
  ```
29
 
30
  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:
@@ -46,6 +49,9 @@ assistant If Mary is 7 years old, then you are 10 years old (7+3=10).
46
  ## Training
47
  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.
48
 
 
 
 
49
  ## Datasets
50
  Snythetic Dataset for SFT - https://github.com/acon96/home-llm
51
  Stanford Alpaca Cleaned - https://huggingface.co/datasets/yahma/alpaca-cleaned
 
13
  # Home 3B v2
14
  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.
15
 
16
+ **NOTE**: This is a re-training as the first attempt did not perform very well for some reason.
17
+
18
  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.
19
 
20
  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.
 
22
  Example "system" prompt:
23
  ```
24
  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.
25
+ Services: light.turn_off(), light.turn_on(brightness,rgb_color), fan.turn_on(), fan.turn_off()
26
  Devices:
27
+ light.office 'Office Light' = on;80%
28
  fan.office 'Office fan' = off
29
+ light.kitchen 'Kitchen Light' = on;80%;red
30
+ light.bedroom 'Bedroom Light' = off
31
  ```
32
 
33
  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:
 
49
  ## Training
50
  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.
51
 
52
+ ## Evaluation
53
+ This model acheives a 87.31% score for JSON function calling accuracy on the test dataset.
54
+
55
  ## Datasets
56
  Snythetic Dataset for SFT - https://github.com/acon96/home-llm
57
  Stanford Alpaca Cleaned - https://huggingface.co/datasets/yahma/alpaca-cleaned