Skip to content

Commit

Permalink
fix data processing agent1 and agent2 name bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lwaekfjlk committed Nov 13, 2023
1 parent cee1227 commit 11a1a20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data_generate/step4_convert_json_to_gen_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def get_agent_info(agent1_pk, agent2_pk, env_pk, agent_dict, env_dict):
agent1_goal = env_dict[env_pk]['agent_goals'][0].replace('<extra_info>', '').replace('</extra_info>', '')
agent2_goal = env_dict[env_pk]['agent_goals'][1].replace('<extra_info>', '').replace('</extra_info>', '')

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,
'agent_age': agent1_age,
Expand Down Expand Up @@ -92,10 +95,8 @@ def fill_template(agent1_info, agent2_info, scenario):
"Conversation Starts:\n.\nYou are at Turn #0."
)

scenario = scenario.replace('agent1', agent1_info['agent_name'])
scenario = scenario.replace('agent2', agent2_info['agent_name'])
scenario = scenario.replace('Agent1', agent1_info['agent_name'])
scenario = scenario.replace('Agent2', agent2_info['agent_name'])
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(
Expand Down

0 comments on commit 11a1a20

Please sign in to comment.