-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
35,000 additions
and
0 deletions.
There are no files selected for viewing
1,710 changes: 1,710 additions & 0 deletions
1,710
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_10.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
1,191 changes: 1,191 additions & 0 deletions
1,191
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_11.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
544 changes: 544 additions & 0 deletions
544
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_12.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
3,697 changes: 3,697 additions & 0 deletions
3,697
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_13.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
4,462 changes: 4,462 additions & 0 deletions
4,462
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_14.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
1,899 changes: 1,899 additions & 0 deletions
1,899
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_15.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
462 changes: 462 additions & 0 deletions
462
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_16.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
432 changes: 432 additions & 0 deletions
432
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_17.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
429 changes: 429 additions & 0 deletions
429
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_18.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
4,740 changes: 4,740 additions & 0 deletions
4,740
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_19.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
218 changes: 218 additions & 0 deletions
218
notebooks/experiments/experiment_k1/llama-v3p1-70b-instruct/exp_2.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import datetime\n", | ||
"import os\n", | ||
"from mdagent import MDAgent\n", | ||
"import matplotlib.pyplot as plt" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"date and time: 2024-09-08\n", | ||
"time: 15:54:37\n", | ||
"LLM: accounts/fireworks/models/llama-v3p1-70b-instruct \n", | ||
"Temperature: 0.1\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"prompt2 = \"Download the PDB file for protein 1LYZ.\"\n", | ||
"llm_var = \"accounts/fireworks/models/llama-v3p1-70b-instruct\"\n", | ||
"tools = \"all\"\n", | ||
"agent = MDAgent(agent_type=\"Structured\", model=llm_var, top_k_tools=tools)\n", | ||
"now = datetime.datetime.now()\n", | ||
"date = now.strftime(\"%Y-%m-%d\")\n", | ||
"print(\"date and time:\",date)\n", | ||
"time = now.strftime(\"%H:%M:%S\")\n", | ||
"print(\"time:\",time)\n", | ||
"print(\"LLM: \",agent.llm.model_name,\"\\nTemperature: \",agent.llm.temperature)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Thought: To download the PDB file for protein 1LYZ, I need to use the PDBFileDownloader tool.\n", | ||
"\n", | ||
"Action:\n", | ||
"```\n", | ||
"{\n", | ||
" \"action\": \"PDBFileDownloader\",\n", | ||
" \"action_input\": \"1LYZ\"\n", | ||
"}\n", | ||
"```\n", | ||
"PDB file found with this ID: 1LYZ\n", | ||
"Thought: Now that I have downloaded the PDB file for protein 1LYZ, I need to verify that the file was downloaded correctly and is in the correct format.\n", | ||
"\n", | ||
"Action:\n", | ||
"```\n", | ||
"{\n", | ||
" \"action\": \"ListRegistryPaths\",\n", | ||
" \"action_input\": \"paths\"\n", | ||
"}\n", | ||
"```\n", | ||
"\n", | ||
"Thought: Now that I have verified the PDB file for protein 1LYZ was downloaded correctly and is in the correct format, I can provide the final answer.\n", | ||
"\n", | ||
"Action:\n", | ||
"```\n", | ||
"{\n", | ||
" \"action\": \"Final Answer\",\n", | ||
" \"action_input\": \"The PDB file for protein 1LYZ has been successfully downloaded and is available in the registry with the ID 1LYZ_155439.\"\n", | ||
"}\n", | ||
"```" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"({'input': '\\n You are an expert molecular dynamics scientist, and\\n your task is to respond to the question or\\n solve the problem to the best of your ability using\\n the provided tools.\\n\\n You can only respond with a single complete\\n \\'Thought, Action, Action Input\\' format\\n OR a single \\'Final Answer\\' format.\\n\\n Complete format:\\n Thought: (reflect on your progress and decide what to do next)\\n Action:\\n ```\\n {\\n \"action\": (the action name, it should be the name of a tool),\\n \"action_input\": (the input string for the action)\\n }\\n \\'\\'\\'\\n\\n OR\\n\\n Final Answer: (the final response to the original input\\n question, once all steps are complete)\\n\\n You are required to use the tools provided,\\n using the most specific tool\\n available for each action.\\n Your final answer should contain all information\\n necessary to answer the question and its subquestions.\\n Before you finish, reflect on your progress and make\\n sure you have addressed the question in its entirety.\\n\\n If you are asked to continue\\n or reference previous runs,\\n the context will be provided to you.\\n If context is provided, you should assume\\n you are continuing a chat.\\n\\n Here is the input:\\n Previous Context: None\\n Question: Download the PDB file for protein 1LYZ. ',\n", | ||
" 'output': 'The PDB file for protein 1LYZ has been successfully downloaded and is available in the registry with the ID 1LYZ_155439.'},\n", | ||
" '5JGNZ2BJ')" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"agent.run(prompt2)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"date and time: 2024-09-08\n", | ||
"time: 15:54:43\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"now = datetime.datetime.now()\n", | ||
"date = now.strftime(\"%Y-%m-%d\")\n", | ||
"print(\"date and time:\",date)\n", | ||
"time = now.strftime(\"%H:%M:%S\")\n", | ||
"print(\"time:\",time)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"ckpt_116\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"registry = agent.path_registry\n", | ||
"print(os.path.basename(registry.ckpt_dir))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Files found in registry: 1LYZ_155439: PDB file downloaded from RSCB\n", | ||
" PDBFile ID: 1LYZ_155439\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"paths_and_descriptions = registry.list_path_names_and_descriptions()\n", | ||
"print(\"\\n\".join(paths_and_descriptions.split(\",\")))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"It is asserted that file path for 1LYZ_155439 exists\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import re\n", | ||
"import os\n", | ||
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n", | ||
"file_id = match.group(0)\n", | ||
"pdb_path = registry.get_mapped_path(file_id)\n", | ||
"assert os.path.exists(pdb_path)\n", | ||
"print(f'It is asserted that file path for {file_id} exists')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Experiment Result: ✅❌\n", | ||
"\n", | ||
"### Completed without Exception or TimeOut Errors ✅\n", | ||
"### Attempted all necessary steps ✅\n", | ||
"### Completed without Hallucination ✅\n", | ||
"### Logic make sense ✅\n", | ||
"### Correct Answer ✅" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "mdagent", | ||
"language": "python", | ||
"name": "mdagent" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Oops, something went wrong.