runningSnail
commited on
Commit
•
6060ae8
1
Parent(s):
39ae8bf
update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,72 @@
|
|
1 |
---
|
2 |
license: cc-by-nc-4.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-nc-4.0
|
3 |
---
|
4 |
+
# Octopus Planner: On-device Language Model for AI Agent Framework
|
5 |
+
|
6 |
+
We're thrilled to introduce the Octopus Planner, the latest breakthrough in on-device language models from Nexa AI. Developed for the Planner-Action Agents Framework, Octopus Planner leverages state-of-the-art technology to enhance AI agents' decision-making processes directly on edge devices. By enabling rapid and efficient planning and action execution 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 Octopus Planner:
|
9 |
+
- **Efficient Planning**: Utilizes Phi-3 Mini architecture with only 3.8 billion parameters for high efficiency and low power consumption.
|
10 |
+
- **Enhanced Accuracy**: Achieves a planning success rate of 97%, providing reliable and effective performance.
|
11 |
+
- **On-device Operation**: Designed for edge devices, ensuring fast response times and enhanced privacy by processing data locally.
|
12 |
+
- **Cost-Effective**: Reduces operational costs by minimizing the key-value cache required, which also improves battery life.
|
13 |
+
- **Fine-tuned**: Extensively fine-tuned on specialized tasks to ensure high accuracy and contextual understanding.
|
14 |
+
|
15 |
+
## Innovative Framework
|
16 |
+
The Octopus Planner introduces a specialized Planner and Action Agents Framework:
|
17 |
+
- **Dual Model Architecture**: Separates planning and action, allowing for specialized optimization and improved scalability.
|
18 |
+
- **Focused Training**: Employs fine-tuning over traditional long prompting, improving efficiency without sacrificing accuracy.
|
19 |
+
- **Comprehensive Benchmarking**: Includes rigorous in-domain testing to validate the model's effectiveness in real-world scenarios.
|
20 |
+
|
21 |
+
## Example Usage
|
22 |
+
Below is a code snippet to use Octopus Planner for scheduling a team meeting:
|
23 |
+
```python
|
24 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
25 |
+
|
26 |
+
model_id = "nexa-collaboration/planning-phi3-128k-full"
|
27 |
+
tokenizer_id = "microsoft/Phi-3-mini-128k-instruct"
|
28 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
|
29 |
+
tokenizer = AutoTokenizer.from_pretrained(tokenizer_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 |
+
|
33 |
+
inputs = f"<|user|>{question}<|end|><|assistant|>"
|
34 |
+
input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
|
35 |
+
|
36 |
+
outputs = model.generate(
|
37 |
+
input_ids=input_ids["input_ids"],
|
38 |
+
max_length=1024,
|
39 |
+
do_sample=False)
|
40 |
+
|
41 |
+
res = tokenizer.decode(outputs.tolist()[0])
|
42 |
+
print(f"=== inference result ===\n{res}")
|
43 |
+
```
|
44 |
+
|
45 |
+
## Training Data
|
46 |
+
We wrote 10 Android API descriptions to used to train the models, see this file for details. Below is one Android API description example
|
47 |
+
```
|
48 |
+
def send_email(recipient, title, content):
|
49 |
+
"""
|
50 |
+
Sends an email to a specified recipient with a given title and content.
|
51 |
+
|
52 |
+
Parameters:
|
53 |
+
- recipient (str): The email address of the recipient.
|
54 |
+
- title (str): The subject line of the email. This is a brief summary or title of the email's purpose or content.
|
55 |
+
- 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.
|
56 |
+
"""
|
57 |
+
```
|
58 |
+
|
59 |
+
## Contact Us
|
60 |
+
For support or to provide feedback, please [contact us](mailto:octopus@nexa4ai.com).
|
61 |
+
|
62 |
+
## License and Citation
|
63 |
+
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.
|
64 |
+
```
|
65 |
+
@article{nexa2024octopusplanner,
|
66 |
+
title={Planner-Action Agents Framework for On-device Small Language Models},
|
67 |
+
author={Nexa AI Team},
|
68 |
+
journal={ArXiv},
|
69 |
+
year={2024},
|
70 |
+
volume={abs/2404.11459}
|
71 |
+
}
|
72 |
+
```
|