zackli4ai commited on
Commit
077b72e
1 Parent(s): ab7bac5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -68
README.md CHANGED
@@ -1,69 +1,69 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
4
- # Octo-planner: On-device Language Model for Planner-Action Agents Framework
5
-
6
- We're thrilled to introduce the Octo-planner, the latest breakthrough in on-device language models from Nexa AI. Developed for the Planner-Action Agents Framework, Octo-planner enables rapid and efficient planning without the need for cloud connectivity, this model together with [Octopus-V2](https://huggingface.co/NexaAIDev/Octopus-v2) can work on edge devices locally to support AI Agent usages.
7
-
8
- ### Key Features of Octo-planner:
9
- - **Efficient Planning**: Utilizes fine-tuned plan model based on Phi-3 Mini (2.51 billion parameters) for high efficiency and low power consumption.
10
- - **Agent Framework**: Separates planning and action, allowing for specialized optimization and improved scalability.
11
- - **Enhanced Accuracy**: Achieves a planning success rate of 98.1% on benchmark dataset, providing reliable and effective performance.
12
- - **On-device Operation**: Designed for edge devices, ensuring fast response times and enhanced privacy by processing data locally.
13
-
14
-
15
- ## Example Usage
16
- Below is a demo of Octo-planner:
17
- <p align="center" width="100%">
18
- <a><img src="1-demo.png" alt="ondevice" style="width: 80%; min-width: 300px; display: block; margin: auto;"></a>
19
- </p>
20
-
21
-
22
- Run below code to use Octopus Planner for a given question:
23
- ```python
24
- import torch
25
- from transformers import AutoModelForCausalLM, AutoTokenizer
26
-
27
- model_id = "NexaAIDev/octopus-planning"
28
- model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
29
- tokenizer = AutoTokenizer.from_pretrained(model_id)
30
-
31
- question = "Find my presentation for tomorrow's meeting, connect to the conference room projector via Bluetooth, increase the screen brightness, take a screenshot of the final summary slide, and email it to all participants"
32
- inputs = f"<|user|>{question}<|end|><|assistant|>"
33
- input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
34
- outputs = model.generate(
35
- input_ids=input_ids["input_ids"],
36
- max_length=1024,
37
- do_sample=False)
38
- res = tokenizer.decode(outputs.tolist()[0])
39
- print(f"=== inference result ===\n{res}")
40
- ```
41
-
42
- ## Training Data
43
- We wrote 10 Android API descriptions to used to train the models, see this file for details. Below is one Android API description example
44
- ```
45
- def send_email(recipient, title, content):
46
- """
47
- Sends an email to a specified recipient with a given title and content.
48
-
49
- Parameters:
50
- - recipient (str): The email address of the recipient.
51
- - title (str): The subject line of the email. This is a brief summary or title of the email's purpose or content.
52
- - content (str): The main body text of the email. It contains the primary message, information, or content that is intended to be communicated to the recipient.
53
- """
54
- ```
55
-
56
- ## Contact Us
57
- For support or to provide feedback, please [contact us](mailto:octopus@nexa4ai.com).
58
-
59
- ## License and Citation
60
- Refer to our [license page](https://www.nexa4ai.com/licenses/v2) for usage details. Please cite our work using the below reference for any academic or research purposes.
61
- ```
62
- @article{nexa2024octopusplanner,
63
- title={Planner-Action Agents Framework for On-device Small Language Models},
64
- author={Nexa AI Team},
65
- journal={ArXiv},
66
- year={2024},
67
- volume={abs/2404.11459}
68
- }
69
  ```
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ ---
4
+ # Octo-planner: On-device Language Model for Planner-Action Agents Framework
5
+
6
+ We're thrilled to introduce the Octo-planner, the latest breakthrough in on-device language models from Nexa AI. Developed for the Planner-Action Agents Framework, Octo-planner enables rapid and efficient planning without the need for cloud connectivity, this model together with [Octopus-V2](https://huggingface.co/NexaAIDev/Octopus-v2) can work on edge devices locally to support AI Agent usages.
7
+
8
+ ### Key Features of Octo-planner:
9
+ - **Efficient Planning**: Utilizes fine-tuned plan model based on Phi-3 Mini (2.51 billion parameters) for high efficiency and low power consumption.
10
+ - **Agent Framework**: Separates planning and action, allowing for specialized optimization and improved scalability.
11
+ - **Enhanced Accuracy**: Achieves a planning success rate of 98.1% on benchmark dataset, providing reliable and effective performance.
12
+ - **On-device Operation**: Designed for edge devices, ensuring fast response times and enhanced privacy by processing data locally.
13
+
14
+
15
+ ## Example Usage
16
+ Below is a demo of Octo-planner:
17
+ <p align="center" width="100%">
18
+ <a><img src="1-demo.png" alt="ondevice" style="width: 80%; min-width: 300px; display: block; margin: auto;"></a>
19
+ </p>
20
+
21
+
22
+ Run below code to use Octopus Planner for a given question:
23
+ ```python
24
+ import torch
25
+ from transformers import AutoModelForCausalLM, AutoTokenizer
26
+
27
+ model_id = "NexaAIDev/octopus-planning"
28
+ model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
29
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
30
+
31
+ question = "Find my presentation for tomorrow's meeting, connect to the conference room projector via Bluetooth, increase the screen brightness, take a screenshot of the final summary slide, and email it to all participants"
32
+ inputs = f"<|user|>{question}<|end|><|assistant|>"
33
+ input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
34
+ outputs = model.generate(
35
+ input_ids=input_ids["input_ids"],
36
+ max_length=1024,
37
+ do_sample=False)
38
+ res = tokenizer.decode(outputs.tolist()[0])
39
+ print(f"=== inference result ===\n{res}")
40
+ ```
41
+
42
+ ## Training Data
43
+ We wrote 10 Android API descriptions to used to train the models, see this file for details. Below is one Android API description example
44
+ ```
45
+ def send_email(recipient, title, content):
46
+ """
47
+ Sends an email to a specified recipient with a given title and content.
48
+
49
+ Parameters:
50
+ - recipient (str): The email address of the recipient.
51
+ - title (str): The subject line of the email. This is a brief summary or title of the email's purpose or content.
52
+ - content (str): The main body text of the email. It contains the primary message, information, or content that is intended to be communicated to the recipient.
53
+ """
54
+ ```
55
+
56
+ ## Contact Us
57
+ For support or to provide feedback, please [contact us](mailto:octopus@nexa4ai.com).
58
+
59
+ ## License and Citation
60
+ Refer to our [license page](https://www.nexa4ai.com/licenses/v2) for usage details. Please cite our work using the below reference for any academic or research purposes.
61
+ ```
62
+ @article{chen2024octoplannerondevicelanguagemodel,
63
+ title={Octo-planner: On-device Language Model for Planner-Action Agents},
64
+ author={Wei Chen and Zhiyuan Li and Zhen Guo and Yikang Shen},
65
+ year={2024},
66
+ eprint={2406.18082},
67
+ url={https://arxiv.org/abs/2406.18082},
68
+ }
69
  ```