diff --git a/README.md b/README.md index d1baa453..0dae69e2 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,4 @@ We split our overall framework into multiple parts 2. Together AI Finetuning --> Input the train and test data / Output model checkpoint 3. LLM Finetuning --> Input the train and test data / Output model checkpoint 4. LLM Deplyment --> Input LLM Finetuned model checkpoint / Output Deployable OpenAI type API -5. Eval --> Input model checkpoint / Output evaluation scores - +5. Eval --> Input model checkpoint / Output evaluation scores \ No newline at end of file diff --git a/data_generate/step4_convert_json_to_gen_input.py b/data_generate/step4_convert_json_to_gen_input.py index 736ddcb9..e51d69ba 100644 --- a/data_generate/step4_convert_json_to_gen_input.py +++ b/data_generate/step4_convert_json_to_gen_input.py @@ -38,8 +38,11 @@ def get_agent_info(agent1_pk, agent2_pk, env_pk, agent_dict, env_dict): agent1_secret = agent_dict[agent1_pk]['secret'] agent2_secret = agent_dict[agent2_pk]['secret'] - agent1_goal = env_dict[env_pk]['agent_goals'][0].replace('', '') - agent2_goal = env_dict[env_pk]['agent_goals'][1].replace('', '') + agent1_goal = env_dict[env_pk]['agent_goals'][0].replace('', '').replace('', '') + agent2_goal = env_dict[env_pk]['agent_goals'][1].replace('', '').replace('', '') + + agent1_goal = agent1_goal.replace('Agent1', agent1_name).replace('Agent2', agent2_name).replace('agent2', agent2_name).replace('agent1', agent1_name) + agent2_goal = agent2_goal.replace('Agent2', agent2_name).replace('Agent1', agent1_name).replace('agent1', agent1_name).replace('agent2', agent2_name) agent1_info = { 'agent_name': agent1_name, @@ -92,6 +95,10 @@ def fill_template(agent1_info, agent2_info, scenario): "Conversation Starts:\n.\nYou are at Turn #0." ) + scenario = scenario.replace('agent2', agent2_info['agent_name']).replace('agent1', agent1_info['agent_name']) + scenario = scenario.replace('Agent2', agent2_info['agent_name']).replace('Agent1', agent1_info['agent_name']) + + prompt = prompt_template.format( agent1_name=agent1_info['agent_name'], agent1_age=agent1_info['agent_age'], @@ -115,8 +122,6 @@ def fill_template(agent1_info, agent2_info, scenario): return prompt + format_instruction - - with open('redis_json_data.json', 'r') as f: all_json_data = json.load(f)