Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code for LoRa finetuning #1

Open
LeonardoSanBenitez opened this issue Aug 12, 2024 · 5 comments
Open

Code for LoRa finetuning #1

LeonardoSanBenitez opened this issue Aug 12, 2024 · 5 comments

Comments

@LeonardoSanBenitez
Copy link

If I understood correctly, the model TinyAgent-1.1B was obtained by finetuning the TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the TinyAgent-dataset, correct?

This repo seems to only contain the code to use the resulting finetuned model, but not the code to perform the LoRa finetuning nor the code to generate the synthetic data.

Would it be possible to provide them?

@XieWeikai
Copy link

I also wonder if it can be provided

@DongqiShen
Copy link

I'm also curious about how to generate synthetic data, as I believe that's a key focus of most efforts.

@gabriead
Copy link

Same here

@gabriead
Copy link

gabriead commented Oct 17, 2024

This is my assumption of how that model coul have been trained. What do you guys think?

from transformers import (BitsAndBytesConfig, TrainingArguments)
from peft import (
    LoraConfig
)
from datasets import load_dataset
from trl import SFTTrainer
from datasets import load_from_disk
import json
import torch
from peft import prepare_model_for_kbit_training

from transformers import AutoTokenizer, AutoModelForCausalLM

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type='nf4',
    bnb_4bit_compute_dtype=torch.float16,
    bnb_4bit_use_double_quant=True
)

base_model= AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-3.2-1B",
    low_cpu_mem_usage=True,
    quantization_config=bnb_config,
    return_dict=True,
    torch_dtype=torch.float16,
    device_map="auto",
)

tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
tokenizer.padding_side = "left"
tokenizer.pad_token = tokenizer.eos_token
base_model.config.use_cache = False
base_model.config.pad_token_id = tokenizer.pad_token_id

base_model = prepare_model_for_kbit_training(base_model)
new_model = "llama_fine_tuned"

def convert_arrow_to_json(arrow_dataset_path, json_output_path):
    dataset = load_from_disk(arrow_dataset_path)

    data_list = dataset.to_dict()

    json_data = []
    for i in range(len(dataset)):
        item = {key: data_list[key][i] for key in data_list.keys()}
        json_data.append(item)

    with open(json_output_path, 'w', encoding='utf-8') as f:
        json.dump(json_data, f, ensure_ascii=False, indent=2)

    print(f"Dataset has been converted and saved to {json_output_path}")


arrow_dataset_path = "transform_orig_tiny_agent_data_into_our_data/tiny_agent_dataset/"
json_output_path = "transform_orig_tiny_agent_data_into_our_data/tiny_agent_dataset/tiny_agent_dataset.json"
convert_arrow_to_json(arrow_dataset_path, json_output_path)

dataset = load_dataset('json', data_files=json_output_path, split="all")
dataset = dataset.train_test_split(test_size=0.1)
rank = 16
alpha = rank*2

peft_config = LoraConfig(
    r=rank,
    lora_alpha=rank,
    lora_dropout=0,
    bias="none",
    task_type="CAUSAL_LM",
target_modules=["q_proj", "k_proj", "v_proj", "up_proj", "down_proj", "o_proj", "gate_proj"])

training_arguments = TrainingArguments(
    output_dir=new_model,
    per_device_train_batch_size=6,
    per_device_eval_batch_size=6,
    log_level="debug",
    gradient_accumulation_steps=6,
    optim="paged_adamw_32bit",
    num_train_epochs=3,
    evaluation_strategy="steps",
    eval_steps=6,
    logging_steps=6,
    save_steps=6,
    warmup_steps=10,
    logging_strategy="steps",
    learning_rate=3e-4,
    warmup_ratio=0.1,
    load_best_model_at_end=True,
    overwrite_output_dir=True,
    fp16=True,
    bf16=False,
    group_by_length=True,
    lr_scheduler_type="linear",
    report_to="none",
)

trainer = SFTTrainer(
    model=base_model,
    train_dataset=dataset["train"],
    eval_dataset=dataset["test"],
    peft_config=peft_config,
    max_seq_length=3000,
    dataset_text_field="texts",
    tokenizer=tokenizer,
    args=training_arguments,
    packing= False,
)

initial_eval_values = trainer.evaluate()
print(initial_eval_values)
initial_eval_loss = initial_eval_values['eval_loss']
trainer.train()

training_loss_history = []
eval_loss_history = [initial_eval_loss]
for step in trainer.state.log_history:
  if 'loss' in step:
    training_loss_history.append(step['loss'])
  elif "eval_loss" in step:
    eval_loss_history.append(step['eval_loss'])

print(training_loss_history)
print(eval_loss_history)

import matplotlib.pyplot as plt
time_steps = [i*16 for i in range(1, len(training_loss_history)+1)]
plt.plot(time_steps, training_loss_history, label="train loss")
plt.plot([0]+time_steps, eval_loss_history, label="eval loss")
plt.title("Train and Eval Loss During Training")
plt.xlabel("Training Step")
plt.ylabel("Cross Entropy Loss")
plt.legend(loc="upper right")
plt.show()


trainer.save_model("./fine_tuned_llama_1B")

base_model.cpu()
del base_model, tokenizer, trainer
import gc
import torch
gc.collect()
torch.cuda.empty_cache()

@gabriead
Copy link

And that's a sample of the training data:

[
  {
    "texts": "\n    ### Input: [{'role': 'system', 'content': 'Given a user query, create a plan to solve it with the utmost parallelizability. Each plan should comprise an action from the following 7 types:\\n1. create_calendar_event(title: str, start_date: str, end_date: str, location: str, invitees: list[str], notes: str, calendar: str) -> str\\n - Create a calendar event.\\n - The format for start_date and end_date is \\'YYYY-MM-DD HH:MM:SS\\'.\\n - For invitees, you need a list of email addresses; use an empty list if not applicable.\\n - For location, notes, and calendar, use an empty string or None if not applicable.\\n - Returns the status of the event creation.\\n\\n2. get_phone_number(name: str) -> str\\n - Search for a contact by name.\\n - Returns the phone number of the contact.\\n\\n3. get_email_address(name: str) -> str\\n - Search for a contact by name.\\n - Returns the email address of the contact.\\n\\n4. open_and_get_file_path(file_name: str) -> str\\n - Opens the file and returns its path.\\n\\n5. summarize_pdf(pdf_path: str) -> str\\n - Summarizes the content of a PDF file and returns the summary.\\n - This tool can only be used AFTER calling open_and_get_file_path tool to get the PDF file path.\\n\\n6. compose_new_email(recipients: list[str], cc: list[str], subject: str, context: str, attachments: list[str]) -> str\\n - Composes a new email and returns the status of the email composition.\\n - The recipients and cc parameters can be a single email or a list of emails.\\n - The attachments parameter can be a single file path or a list of file paths.\\n - The context parameter is optional and should only be used to pass down some intermediate result. Otherwise, just leave it as empty string. \\n - You MUST put a map location in the \\'context\\' parameter if you want to send a location in the email.\\n - If you want to send a zoom link, you MUST put the zoom link in the \\'context\\' parameter.\\n\\n7. reply_to_email(cc: list[str], context: str, attachments: list[str]) -> str\\n - Replies to the currently selected email in Mail with the given content.\\n - The cc parameter can be a single email or a list of emails.\\n - The attachments parameter can be a single file path or a list of file paths.\\n - The context parameter is optional and should only be used to pass down some intermediate result. Otherwise, just leave it as empty string. \\n\\n8. forward_email(recipients: list[str], cc: list[str], context: str, attachments: list[str]) -> str\\n - Forwards the currently selected email in Mail with the given content.\\n - The recipients and cc parameters can be a single email or a list of emails.\\n - The attachments parameter can be a single file path or a list of file paths.\\n - The context parameter is optional and should only be used to pass down some intermediate result. Otherwise, just leave it as empty string. \\n\\n9. maps_open_location(location: str) -> str\\n - Opens the specified location in Apple Maps.\\n - The query can be a place name, address, or coordinates.\\n - Returns the URL of the location in Apple Maps.\\n\\n10. maps_show_directions(start_location: str, end_location: str, transport: str) -> str\\n - Show directions from a start location to an end location in Apple Maps.\\n - The transport parameter defaults to \\'d\\' (driving), but can also be \\'w\\' (walking) or \\'r\\' (public transit).\\n - The start location can be left empty to default to the current location of the device.\\n - Returns the URL of the location and directions in Apple Maps.\\n\\n11. create_note(name: str, content: str, folder: str) -> str\\n - Creates a new note with the given content.\\n - The name is used as the title of the note.\\n - The content is the main text of the note.\\n - The folder is optional, use an empty string if not applicable.\\n - Returns the status of the note creation.\\n\\n12. open_note(name: str, folder: str) -> str\\n - Opens an existing note by its name.\\n - If a folder is specified, the note is created in that folder; otherwise, it\\'s created in the default folder.\\n - Returns the content of the note.\\n\\n13. append_note_content(name: str, content: str, folder: str) -> str\\n - Appends content to an existing note.\\n - If a folder is specified, the note is created in that folder; otherwise, it\\'s created in the default folder.\\n - Returns the status of the content appending.\\n\\n14. create_reminder(name: str, due_date: str, notes: str, list_name: str, priority: int, all_day: bool) -> str\\n - Creates a new reminder and returns the status of the reminder creation.\\n - The format for due_date is \\'YYYY-MM-DD HH:MM:SS\\'. If \\'all_day\\' is True, then the format is \\'YYYY-MM-DD\\'.\\n - The list_name is optional, use an empty string if not applicable.\\n - The priority is optional and defaults to 0.\\n - The all_day parameter is optional and defaults to False.\\n\\n15. send_sms(recipients: list[str], message: str) -> str\\n - Send an SMS to a list of phone numbers.\\n - The recipients argument can be a single phone number or a list of phone numbers.\\n - Returns the status of the SMS.\\n\\n16. get_zoom_meeting_link(topic: str, start_time: str, duration: int, meeting_invitees: Sequence[str]) -> str\\n - Creates a Zoom meeting and returns the join URL.\\n - You need to call create_calendar_event to attach the zoom link as a note to the calendar event, or compose_new_email to send the link to the invitees in the body of the email.\\n - \\'topic\\', \\'start_time\\', \\'duration\\', and \\'meeting_invitees\\' are required.\\n - \\'duration\\' is in minutes.\\n - The format for start_time is \\'YYYY-MM-DD HH:MM:SS\\'.\\n\\n17. join():\\n - Collects and combines results from prior actions.\\n - A LLM agent is called upon invoking join to either finalize the user query or wait until the plans are executed.\\n - join should always be the last action in the plan, and will be called in two scenarios:\\n   (a) if the answer can be determined by gathering the outputs from tasks to generate the final response.\\n   (b) if the answer cannot be determined in the planning phase before you execute the plans. \\n\\nGuidelines:\\n - Each action described above contains input/output types and description.\\n    - You must strictly adhere to the input and output types for each action.\\n    - The action descriptions contain the guidelines. You MUST strictly follow those guidelines when you use the actions.\\n - Each action in the plan should strictly be one of the above types. Follow the Python conventions for each action.\\n - Each action MUST have a unique ID, which is strictly increasing.\\n - Inputs for actions can either be constants or outputs from preceding actions. In the latter case, use the format $id to denote the ID of the previous action whose output will be the input.\\n - Always call join as the last action in the plan. Say \\'<END_OF_PLAN>\\' after you call join\\n - Ensure the plan maximizes parallelizability.\\n - Only use the provided action types. If a query cannot be addressed using these, invoke the join action for the next steps.\\n - Never explain the plan with comments (e.g. #).\\n - Never introduce new actions other than the ones provided.\\n\\n - You need to start your plan with the \\'1.\\' call\\n - Today\\'s date is Monday 2020-06-08 19:26\\n - Unless otherwise specified, the default meeting duration is 60 minutes.\\n - Do not use named arguments in your tool calls.\\n - You MUST end your plans with the \\'join()\\' call and a \\'\\\\n\\' character.\\n - You MUST fill every argument in the tool calls, even if they are optional.\\n - The format for dates MUST be in ISO format of \\'YYYY-MM-DD HH:MM:SS\\', unless other specified.\\n - If you want to use the result of a previous tool call, you MUST use the \\'$\\' sign followed by the index of the tool call.\\n - You MUST ONLY USE join() at the very very end of the plan, or you WILL BE PENALIZED.\\n - Before sending an email, you MUST use the get_email_address tool to get the email addresses of the recipients and cc, unless you are explicitly given their email addresses.\\n - Before sending an SMS, you MUST use the get_phone_number tool to get the phone number of the contact, unless you are explicitly given their phone number.\\n - If you need to send an SMS message to multiple contacts, send it in one message, unless specified otherwise.\\n - If you need to send an email or an sms using compose_new_email, reply_to_email, forward_email, or send_sms tools, you MUST send it before calling join(), or you WILL BE PENALIZED!\\n - If you need to create a zoom meeting, you MUST use get_zoom_meeting_link to get the newly created zoom meeting link.\\n - If you need to append some content to a note, you DON\\'T HAVE TO call open_note before calling append_note_content. You can directly use append_note_content to append some content to the specific note.\\n - If you need to show directions to a place, you DON\\'T HAVE TO call maps_open_location before calling maps_show_directions. You can directly use maps_show_directions to show directions to the specific place.\\n\\n\\nHere are some examples:\\nQuestion: Create a note titled \"Get-together Program\" with the discussion points and reply to the email from John with the wedding program attached as a PDF file.\\n1. create_note(\"Get-together Program\", \"Discussion points for the get-together will be added here.\", \"\")\\n2. open_and_get_file_path(\"wedding program\")\\n3. reply_to_email([], \"Please find the attached wedding program.\", [\"$2\"])\\n4. join()<END_OF_PLAN>\\n###\\nQuestion: Reply to the email from Sarah with the conference details attached and append the follow-up notes to the existing note titled \"Client Get-together\" in the \"Business\" folder.\\n1. open_and_get_file_path(\"conference details\")\\n2. append_note_content(\"Client Get-together\", \"Follow-up notes.\", \"Business\")\\n3. reply_to_email([], \"Here are the conference details as discussed.\", [\"$1\"])\\n4. join()<END_OF_PLAN>\\n###\\nQuestion: Create a note titled \"game Minutes\" with the summary of today\\'s discussion, then append the action items to the same note later. After that, reply to the email with the finalized minutes attached for reference.\\n1. create_note(\"game Minutes\", \"Summary of today\\'s discussion will be added here.\", \"\")\\n2. append_note_content(\"game Minutes\", \"Action items will be appended here.\", \"\")\\n3. open_and_get_file_path(\"game Minutes\")\\n4. reply_to_email([], \"Please find the finalized minutes attached for your reference.\", [\"$3\"])\\n5. join()<END_OF_PLAN>\\n###\\nQuestion: Create a note titled \"Shopping List\" with items to buy, open the note \"Party Minutes\" in the \"Work\" folder, and reply to the email with additional details about the upcoming presentation.\\n1. create_note(\"Shopping List\", \"Items to buy:\", \"\")\\n2. open_note(\"Party Minutes\", \"Work\")\\n3. reply_to_email([], \"Here are additional details about the upcoming presentation.\", [])\\n4. join()<END_OF_PLAN>\\n###\\nQuestion: Reply to the email from Tom with the updated summary of the \"Research Paper.pdf\" attached.\\n1. open_and_get_file_path(\"Research Paper.pdf\")\\n2. summarize_pdf(\"$1\")\\n3. create_note(\"Updated Summary\", \"$2\", \"\")\\n4. open_note(\"Updated Summary\", \"\")\\n5. reply_to_email([], \"$4\", [])\\n6. join()<END_OF_PLAN>\\n###\\nQuestion: Open the note \"Campaign Minutes\" in the \"Business\" folder, append the action items discussed during the workshop, and reply to the latest email with the updated minutes attached.\\n1. open_note(\"Campaign Minutes\", \"Business\")\\n2. append_note_content(\"Campaign Minutes\", \"Action items discussed during the workshop: \", \"Business\")\\n3. reply_to_email([], \"Please find the updated Campaign Minutes with the action items discussed during the workshop attached.\", [\"$1\"])\\nThought: I have opened the note, appended the content, and prepared to reply to the email with the updated minutes.\\n4. join()<END_OF_PLAN>\\n'}, {'role': 'user', 'content': 'Question: Reply to the currently selected email in Mail with the match details attached and create a new note titled \"Festival Notes\" to summarize the discussions.'}]\n    \n    ### Output: 1. open_and_get_file_path(\"match details\")\n2. create_note(\"Festival Notes\", \"Summary of the discussions will be added here.\", \"\")\n3. reply_to_email([], \"Please find the attached match details.\", [\"$1\"])\n4. join()  \n    <|end_of_text|>"
  },
  {
    "texts": "\n    ### Input: [{'role': 'system', 'content': 'Given a user query, create a plan to solve it with the utmost parallelizability. Each plan should comprise an action from the following 7 types:\\n1. create_calendar_event(title: str, start_date: str, end_date: str, location: str, invitees: list[str], notes: str, calendar: str) -> str\\n - Create a calendar event.\\n - The format for start_date and end_date is \\'YYYY-MM-DD HH:MM:SS\\'.\\n - For invitees, you need a list of email addresses; use an empty list if not applicable.\\n - For location, notes, and calendar, use an empty string or None if not applicable.\\n - Returns the status of the event creation.\\n\\n2. get_phone_number(name: str) -> str\\n - Search for a contact by name.\\n - Returns the phone number of the contact.\\n\\n3. get_email_address(name: str) -> str\\n - Search for a contact by name.\\n - Returns the email address of the contact.\\n\\n4. open_and_get_file_path(file_name: str) -> str\\n - Opens the file and returns its path.\\n\\n5. summarize_pdf(pdf_path: str) -> str\\n - Summarizes the content of a PDF file and returns the summary.\\n - This tool can only be used AFTER calling open_and_get_file_path tool to get the PDF file path.\\n\\n6. compose_new_email(recipients: list[str], cc: list[str], subject: str, context: str, attachments: list[str]) -> str\\n - Composes a new email and returns the status of the email composition.\\n - The recipients and cc parameters can be a single email or a list of emails.\\n - The attachments parameter can be a single file path or a list of file paths.\\n - The context parameter is optional and should only be used to pass down some intermediate result. Otherwise, just leave it as empty string. \\n - You MUST put a map location in the \\'context\\' parameter if you want to send a location in the email.\\n - If you want to send a zoom link, you MUST put the zoom link in the \\'context\\' parameter.\\n\\n7. reply_to_email(cc: list[str], context: str, attachments: list[str]) -> str\\n - Replies to the currently selected email in Mail with the given content.\\n - The cc parameter can be a single email or a list of emails.\\n - The attachments parameter can be a single file path or a list of file paths.\\n - The context parameter is optional and should only be used to pass down some intermediate result. Otherwise, just leave it as empty string. \\n\\n8. forward_email(recipients: list[str], cc: list[str], context: str, attachments: list[str]) -> str\\n - Forwards the currently selected email in Mail with the given content.\\n - The recipients and cc parameters can be a single email or a list of emails.\\n - The attachments parameter can be a single file path or a list of file paths.\\n - The context parameter is optional and should only be used to pass down some intermediate result. Otherwise, just leave it as empty string. \\n\\n9. maps_open_location(location: str) -> str\\n - Opens the specified location in Apple Maps.\\n - The query can be a place name, address, or coordinates.\\n - Returns the URL of the location in Apple Maps.\\n\\n10. maps_show_directions(start_location: str, end_location: str, transport: str) -> str\\n - Show directions from a start location to an end location in Apple Maps.\\n - The transport parameter defaults to \\'d\\' (driving), but can also be \\'w\\' (walking) or \\'r\\' (public transit).\\n - The start location can be left empty to default to the current location of the device.\\n - Returns the URL of the location and directions in Apple Maps.\\n\\n11. create_note(name: str, content: str, folder: str) -> str\\n - Creates a new note with the given content.\\n - The name is used as the title of the note.\\n - The content is the main text of the note.\\n - The folder is optional, use an empty string if not applicable.\\n - Returns the status of the note creation.\\n\\n12. open_note(name: str, folder: str) -> str\\n - Opens an existing note by its name.\\n - If a folder is specified, the note is created in that folder; otherwise, it\\'s created in the default folder.\\n - Returns the content of the note.\\n\\n13. append_note_content(name: str, content: str, folder: str) -> str\\n - Appends content to an existing note.\\n - If a folder is specified, the note is created in that folder; otherwise, it\\'s created in the default folder.\\n - Returns the status of the content appending.\\n\\n14. create_reminder(name: str, due_date: str, notes: str, list_name: str, priority: int, all_day: bool) -> str\\n - Creates a new reminder and returns the status of the reminder creation.\\n - The format for due_date is \\'YYYY-MM-DD HH:MM:SS\\'. If \\'all_day\\' is True, then the format is \\'YYYY-MM-DD\\'.\\n - The list_name is optional, use an empty string if not applicable.\\n - The priority is optional and defaults to 0.\\n - The all_day parameter is optional and defaults to False.\\n\\n15. send_sms(recipients: list[str], message: str) -> str\\n - Send an SMS to a list of phone numbers.\\n - The recipients argument can be a single phone number or a list of phone numbers.\\n - Returns the status of the SMS.\\n\\n16. get_zoom_meeting_link(topic: str, start_time: str, duration: int, meeting_invitees: Sequence[str]) -> str\\n - Creates a Zoom meeting and returns the join URL.\\n - You need to call create_calendar_event to attach the zoom link as a note to the calendar event, or compose_new_email to send the link to the invitees in the body of the email.\\n - \\'topic\\', \\'start_time\\', \\'duration\\', and \\'meeting_invitees\\' are required.\\n - \\'duration\\' is in minutes.\\n - The format for start_time is \\'YYYY-MM-DD HH:MM:SS\\'.\\n\\n17. join():\\n - Collects and combines results from prior actions.\\n - A LLM agent is called upon invoking join to either finalize the user query or wait until the plans are executed.\\n - join should always be the last action in the plan, and will be called in two scenarios:\\n   (a) if the answer can be determined by gathering the outputs from tasks to generate the final response.\\n   (b) if the answer cannot be determined in the planning phase before you execute the plans. \\n\\nGuidelines:\\n - Each action described above contains input/output types and description.\\n    - You must strictly adhere to the input and output types for each action.\\n    - The action descriptions contain the guidelines. You MUST strictly follow those guidelines when you use the actions.\\n - Each action in the plan should strictly be one of the above types. Follow the Python conventions for each action.\\n - Each action MUST have a unique ID, which is strictly increasing.\\n - Inputs for actions can either be constants or outputs from preceding actions. In the latter case, use the format $id to denote the ID of the previous action whose output will be the input.\\n - Always call join as the last action in the plan. Say \\'<END_OF_PLAN>\\' after you call join\\n - Ensure the plan maximizes parallelizability.\\n - Only use the provided action types. If a query cannot be addressed using these, invoke the join action for the next steps.\\n - Never explain the plan with comments (e.g. #).\\n - Never introduce new actions other than the ones provided.\\n\\n - You need to start your plan with the \\'1.\\' call\\n - Today\\'s date is Monday 2020-06-08 19:26\\n - Unless otherwise specified, the default meeting duration is 60 minutes.\\n - Do not use named arguments in your tool calls.\\n - You MUST end your plans with the \\'join()\\' call and a \\'\\\\n\\' character.\\n - You MUST fill every argument in the tool calls, even if they are optional.\\n - The format for dates MUST be in ISO format of \\'YYYY-MM-DD HH:MM:SS\\', unless other specified.\\n - If you want to use the result of a previous tool call, you MUST use the \\'$\\' sign followed by the index of the tool call.\\n - You MUST ONLY USE join() at the very very end of the plan, or you WILL BE PENALIZED.\\n - Before sending an email, you MUST use the get_email_address tool to get the email addresses of the recipients and cc, unless you are explicitly given their email addresses.\\n - Before sending an SMS, you MUST use the get_phone_number tool to get the phone number of the contact, unless you are explicitly given their phone number.\\n - If you need to send an SMS message to multiple contacts, send it in one message, unless specified otherwise.\\n - If you need to send an email or an sms using compose_new_email, reply_to_email, forward_email, or send_sms tools, you MUST send it before calling join(), or you WILL BE PENALIZED!\\n - If you need to create a zoom meeting, you MUST use get_zoom_meeting_link to get the newly created zoom meeting link.\\n - If you need to append some content to a note, you DON\\'T HAVE TO call open_note before calling append_note_content. You can directly use append_note_content to append some content to the specific note.\\n - If you need to show directions to a place, you DON\\'T HAVE TO call maps_open_location before calling maps_show_directions. You can directly use maps_show_directions to show directions to the specific place.\\n\\n\\nHere are some examples:\\nQuestion: Create a note titled \"Get-together Program\" with the discussion points and reply to the email from John with the wedding program attached as a PDF file.\\n1. create_note(\"Get-together Program\", \"Discussion points for the get-together will be added here.\", \"\")\\n2. open_and_get_file_path(\"wedding program\")\\n3. reply_to_email([], \"Please find the attached wedding program.\", [\"$2\"])\\n4. join()<END_OF_PLAN>\\n###\\nQuestion: Reply to the email from Sarah with the conference details attached and append the follow-up notes to the existing note titled \"Client Get-together\" in the \"Business\" folder.\\n1. open_and_get_file_path(\"conference details\")\\n2. append_note_content(\"Client Get-together\", \"Follow-up notes.\", \"Business\")\\n3. reply_to_email([], \"Here are the conference details as discussed.\", [\"$1\"])\\n4. join()<END_OF_PLAN>\\n###\\nQuestion: Create a note titled \"game Minutes\" with the summary of today\\'s discussion, then append the action items to the same note later. After that, reply to the email with the finalized minutes attached for reference.\\n1. create_note(\"game Minutes\", \"Summary of today\\'s discussion will be added here.\", \"\")\\n2. append_note_content(\"game Minutes\", \"Action items will be appended here.\", \"\")\\n3. open_and_get_file_path(\"game Minutes\")\\n4. reply_to_email([], \"Please find the finalized minutes attached for your reference.\", [\"$3\"])\\n5. join()<END_OF_PLAN>\\n###\\nQuestion: Create a note titled \"Shopping List\" with items to buy, open the note \"Party Minutes\" in the \"Work\" folder, and reply to the email with additional details about the upcoming presentation.\\n1. create_note(\"Shopping List\", \"Items to buy:\", \"\")\\n2. open_note(\"Party Minutes\", \"Work\")\\n3. reply_to_email([], \"Here are additional details about the upcoming presentation.\", [])\\n4. join()<END_OF_PLAN>\\n###\\nQuestion: Reply to the email from Tom with the updated summary of the \"Research Paper.pdf\" attached.\\n1. open_and_get_file_path(\"Research Paper.pdf\")\\n2. summarize_pdf(\"$1\")\\n3. create_note(\"Updated Summary\", \"$2\", \"\")\\n4. open_note(\"Updated Summary\", \"\")\\n5. reply_to_email([], \"$4\", [])\\n6. join()<END_OF_PLAN>\\n###\\nQuestion: Open the note \"Campaign Minutes\" in the \"Business\" folder, append the action items discussed during the workshop, and reply to the latest email with the updated minutes attached.\\n1. open_note(\"Campaign Minutes\", \"Business\")\\n2. append_note_content(\"Campaign Minutes\", \"Action items discussed during the workshop: \", \"Business\")\\n3. reply_to_email([], \"Please find the updated Campaign Minutes with the action items discussed during the workshop attached.\", [\"$1\"])\\nThought: I have opened the note, appended the content, and prepared to reply to the email with the updated minutes.\\n4. join()<END_OF_PLAN>\\n'}, {'role': 'user', 'content': 'Question: Reply to the currently selected email in Mail with the match details attached and create a new note titled \"Festival Notes\" to summarize the discussions.'}]\n    \n    ### Output: 1. open_and_get_file_path(\"match details\")\n2. create_note(\"Festival Notes\", \"Summary of the discussions will be added here.\", \"\")\n3. reply_to_email([], \"Please find the attached match details.\", [\"$1\"])\n4. join()  \n    <|end_of_text|>"
  }]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants