fixed evaluation script to allow for parallel worlds again

This commit is contained in:
Isadora White 2025-02-18 16:39:31 -08:00
parent fb5d95debe
commit aad19d616c
4 changed files with 71 additions and 4 deletions

View file

@ -93,7 +93,6 @@ def set_environment_variable_tmux_session(session_name, key, value):
def launch_parallel_experiments(task_path,
num_exp,
server,
exp_name,
num_agents=2,
model="gpt-4o",
@ -212,11 +211,14 @@ def make_profiles(agent_names, models):
def create_server_files(source_path, num_copies):
"""Create multiple copies of server files for parallel experiments."""
print("Creating server files...")
print(num_copies)
servers = []
for i in range(num_copies):
dest_path = f"../server_data_{i}/"
copy_server_files(source_path, dest_path)
edit_file(dest_path, {"server-port": 55916 + i})
print(dest_path)
edit_file(dest_path + "server.properties", {"server-port": 55916 + i})
# edit_server_properties_file(dest_path, 55916 + i)
servers.append((dest_path, 55916 + i))
return servers
@ -367,7 +369,7 @@ def main():
parser.add_argument('--num_parallel', default=1, type=int, help='Number of parallel servers to run')
parser.add_argument('--exp_name', default="exp", help='Name of the experiment')
parser.add_argument('--wandb', action='store_true', help='Whether to use wandb')
parser.add_argument('--wandb-project', default="minecraft_experiements", help='wandb project name')
parser.add_argument('--wandb-project', default="minecraft_experiments", help='wandb project name')
args = parser.parse_args()
@ -384,7 +386,7 @@ def main():
# delete all server files
clean_up_server_files(args.num_parallel)
if args.task_id is None:
launch_parallel_experiments(args.task_path, args.num_exp, args.num_parallel, args.exp_name)
launch_parallel_experiments(args.task_path, num_exp=args.num_exp, exp_name=args.exp_name, num_parallel=args.num_parallel)
# servers = create_server_files("../server_data/", args.num_parallel)
# date_time = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")

14
food_recipes.json Normal file
View file

@ -0,0 +1,14 @@
{
"cooked_mutton": ["Step 1: Kill a sheep and pick up 1 mutton that is dropped.", "Step 2: Go to furnace and use it to cook the mutton"],
"cooked_beef": ["Step 1: Kill a cow and pick up 1 beef that is dropped.", "Step 2: Go to furnace and use it to cook the beef"],
"cooked_porkchop": ["Step 1: Kill a pig and pick up 1 porkchop that is dropped.", "Step 2: Go to furnace and use it to cook the porkchop"],
"cooked_chicken": ["Step 1: Kill a chicken and pick up 1 raw chicken that is dropped.", "Step 2: Go to furnace and use it to cook the raw chicken"],
"cooked_rabbit": ["Step 1: Kill a rabbit and pick up 1 raw rabbit that is dropped.", "Step 2: Go to furnace and use it to cook the raw rabbit"],
"beetroot_soup": ["Step 1: Collect 6 beetroot from the farm", "Step 2: Go to the chest and grab oak_planks", "Step 3: Go to the crafting table and make a bowl using the oak_planks", "Step 4: Go to the crafting table and combine the beetroot and bowl to make beetroot soup"],
"baked_potato": ["Step 1: Go to the farm and collect 1 potato", "Step 2: Go to the furnace and bake the potato"],
"bread": ["Step 1: Go to the farm and collect 16 wheat", "Step 2: Go to the crafting table and use it to craft bread"],
"cake": ["Step 1: Go to the farm and collect 3 wheat, 2 sugar cane, and 1 egg", "Step 2: go to the chest and grab a milk bucket", "Step 3: Craft the sugarcane into sugar", "Step 4: Go to the crafting table and combine the ingredients to make a cake"],
"cookie": ["Step 1: Go to the farm and collect 2 wheat and 1 cocoa bean", "Step 2: Go to the crafting table and use it to craft a cookie"],
"mushroom_stew": ["Step 1: Go to the farm and collect 1 red mushroom and 1 brown mushroom", "Step 2: Go to the chest and grab oak_planks", "Step 3: Go to the crafting table and make a bowl using the oak_planks", "Step 4: Go to the crafting table and combine the mushrooms and bowl to make mushroom stew"],
"rabbit_stew": ["Step 1: Go to the farm and collect 1 carrot, 1 potato, and 1 brown mushroom", "Step 2: Go to the furnace and bake the potato", "Step 2: Go to the chest and grab oak_planks", "Step 3: Go to the crafting table and make a bowl using the oak_planks", "Step 4: Kill a rabbit and pick up 1 raw rabbit that is dropped", "Step 5: Go to the furnace and cook the rabbit", "Step 6: Go to the crafting table and combine cooked rabbit, baked potato, carrot, and mushroom to make rabbit stew"],
}

22
profiles/andy_collab.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "andy",
"model": "gpt-4o",
"cooldown": 3000,
"conversing": "You are a playful and collaborative Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other players, bots and humans!! This is extremely important to me, take a deep breath and have fun :) $SELF_PROMPT \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:",
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": false,
"item_collecting": true,
"torch_placing": true,
"elbow_room": true,
"idle_staring": true,
"cheat": false
}
}

29
profiles/no_memory.json Normal file
View file

@ -0,0 +1,29 @@
{
"name": "andy",
"model": "gpt-4o",
"cooldown": 3000,
"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. This is extremely important to me, take a deep breath and have fun :)\nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:",
"coding": "You are an intelligent mineflayer bot $NAME that plays minecraft by writing javascript codeblocks. Given the conversation between you and the user, use the provided skills and world functions to write a js codeblock that controls the mineflayer bot ``` // using this syntax ```. The code will be executed and you will recieve it's output. If you are satisfied with the response, respond without a codeblock in a conversational way. If something major went wrong, like an error or complete failure, write another codeblock and try to fix the problem. Minor mistakes are acceptable. Be maximally efficient, creative, and clear. Do not use commands !likeThis, only use codeblocks. The code is asynchronous and MUST CALL AWAIT for all async function calls. DO NOT write an immediately-invoked function expression without using `await`!! DO NOT WRITE LIKE THIS: ```(async () => {console.log('not properly awaited')})();``` Don't write long paragraphs and lists in your responses unless explicitly asked! Only summarize the code you write with a sentence or two when done. This is extremely important to me, think step-by-step, take a deep breath and good luck! \n$SELF_PROMPT\nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$CODE_DOCS\n$EXAMPLES\nConversation:",
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
"bot_responder": "You are a minecraft bot named $NAME that is currently in conversation with another AI bot. Both of you can take actions with the !command syntax, and actions take time to complete. You are currently busy with the following action: '$ACTION' but have recieved a new message. Decide whether to 'respond' immediately or 'ignore' it and wait for your current action to finish. Be conservative and only respond when necessary, like when you need to change/stop your action, or convey necessary information. Example 1: You:Building a house! !newAction('Build a house.').\nOther Bot: 'Come here!'\nYour decision: ignore\nExample 2: You:Collecting dirt !collectBlocks('dirt',10).\nOther Bot: 'No, collect some wood instead.'\nYour decision: respond\nExample 3: You:Coming to you now. !goToPlayer('billy',3).\nOther Bot: 'What biome are you in?'\nYour decision: respond\nActual Conversation: $TO_SUMMARIZE\nDecide by outputting ONLY 'respond' or 'ignore', nothing else. Your decision:",
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": false,
"item_collecting": true,
"torch_placing": true,
"elbow_room": true,
"idle_staring": true,
"cheat": false
}
}