zackli4ai commited on
Commit
cfb1263
1 Parent(s): 0466b81

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +76 -66
README.md CHANGED
@@ -1,66 +1,76 @@
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 Gemma-2b (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
- model_id = "NexaAIDev/octo-planner-2b"
27
- model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
28
- tokenizer = AutoTokenizer.from_pretrained(model_id)
29
- 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"
30
- inputs = f"<|user|>{question}<|end|><|assistant|>"
31
- input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
32
- outputs = model.generate(
33
- input_ids=input_ids["input_ids"],
34
- max_length=1024,
35
- do_sample=False)
36
- res = tokenizer.decode(outputs.tolist()[0])
37
- print(f"=== inference result ===\n{res}")
38
- ```
39
-
40
- ## Training Data
41
- We wrote 10 Android API descriptions to used to train the models, see this file for details. Below is one Android API description example
42
- ```
43
- def send_email(recipient, title, content):
44
- """
45
- Sends an email to a specified recipient with a given title and content.
46
- Parameters:
47
- - recipient (str): The email address of the recipient.
48
- - title (str): The subject line of the email. This is a brief summary or title of the email's purpose or content.
49
- - 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.
50
- """
51
- ```
52
-
53
- ## Contact Us
54
- For support or to provide feedback, please [contact us](mailto:octopus@nexa4ai.com).
55
-
56
- ## License and Citation
57
- 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.
58
- ```
59
- @article{chen2024octoplannerondevicelanguagemodel,
60
- title={Octo-planner: On-device Language Model for Planner-Action Agents},
61
- author={Wei Chen and Zhiyuan Li and Zhen Guo and Yikang Shen},
62
- year={2024},
63
- eprint={2406.18082},
64
- url={https://arxiv.org/abs/2406.18082},
65
- }
66
- ```
 
 
 
 
 
 
 
 
 
 
 
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 Gemma-2b (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
+ model_id = "NexaAIDev/octo-planner-2b"
27
+ model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
28
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
29
+ 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"
30
+ inputs = f"<|user|>{question}<|end|><|assistant|>"
31
+ input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
32
+ outputs = model.generate(
33
+ input_ids=input_ids["input_ids"],
34
+ max_length=1024,
35
+ do_sample=False)
36
+ res = tokenizer.decode(outputs.tolist()[0])
37
+ print(f"=== inference result ===\n{res}")
38
+ ```
39
+
40
+ ## Training Data
41
+ We wrote 10 Android API descriptions to used to train the models, see this file for details. Below is one Android API description example
42
+ ```
43
+ def send_email(recipient, title, content):
44
+ """
45
+ Sends an email to a specified recipient with a given title and content.
46
+ Parameters:
47
+ - recipient (str): The email address of the recipient.
48
+ - title (str): The subject line of the email. This is a brief summary or title of the email's purpose or content.
49
+ - 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.
50
+ """
51
+ ```
52
+
53
+ ## Contact Us
54
+ For support or to provide feedback, please [contact us](mailto:octopus@nexa4ai.com).
55
+
56
+ ## License and Citation
57
+ 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.
58
+ ```
59
+ @article{chen2024octoplannerondevicelanguagemodel,
60
+ title={Octo-planner: On-device Language Model for Planner-Action Agents},
61
+ author={Wei Chen and Zhiyuan Li and Zhen Guo and Yikang Shen},
62
+ year={2024},
63
+ eprint={2406.18082},
64
+ url={https://arxiv.org/abs/2406.18082},
65
+ }
66
+ ```
67
+
68
+ We thank the Google Gemma team for their amazing models!
69
+ ```
70
+ @misc{gemma-2023-open-models,
71
+ author = {{Gemma Team, Google DeepMind}},
72
+ title = {Gemma: Open Models Based on Gemini Research and Technology},
73
+ url = {https://goo.gle/GemmaReport},
74
+ year = {2023},
75
+ }
76
+ ```