Views
No views yet
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3model_id = "NexaAIDev/octo-planner-2b"
4model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6question = "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"
7inputs = f"<|user|>{question}<|end|><|assistant|>"
8input_ids = tokenizer(inputs, return_tensors="pt").to(model.device)
9outputs = model.generate(
10 input_ids=input_ids["input_ids"],
11 max_length=1024,
12 do_sample=False)
13res = tokenizer.decode(outputs.tolist()[0])
14print(f"=== inference result ===\n{res}")def send_email(recipient, title, content):
"""
Sends an email to a specified recipient with a given title and content.
Parameters:
- recipient (str): The email address of the recipient.
- title (str): The subject line of the email. This is a brief summary or title of the email's purpose or content.
- 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.
"""@article{chen2024octoplannerondevicelanguagemodel,
title={Octo-planner: On-device Language Model for Planner-Action Agents},
author={Wei Chen and Zhiyuan Li and Zhen Guo and Yikang Shen},
year={2024},
eprint={2406.18082},
url={https://arxiv.org/abs/2406.18082},
}@misc{gemma-2023-open-models,
author = {{Gemma Team, Google DeepMind}},
title = {Gemma: Open Models Based on Gemini Research and Technology},
url = {https://goo.gle/GemmaReport},
year = {2023},
}