Skip to content

Commit

Permalink
fix and replace scenario and social goal agent name (#104)
Browse files Browse the repository at this point in the history
* support inference on the whole dataset

* add initial code for scenario and social goal  generation

* modify readme

* add step1 and step2 but still not correct

* add a test

* support generating env and match it with existing agents to be a combo

* add readme

* support gpt-4-turbo change and add db doc and conert to json

* fix prompt to generate better scenario based on gpt-4-turbo

* complete the overall 4 steps

* modify readme

* support bert score filtering

* change name

* delete file

* delete jsonl

* delete dump.rdb

* modify readme

* fix data processing agent1 and agent2 name bug

* fix data processing agent1 and agent2 name bug
  • Loading branch information
lwaekfjlk authored and ruiyiw committed Nov 13, 2023
1 parent 1142e22 commit 2b435e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 9 additions & 4 deletions data_generate/step4_convert_json_to_gen_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<extra_info>', '')
agent2_goal = env_dict[env_pk]['agent_goals'][1].replace('<extra_info>', '')
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,
Expand Down Expand Up @@ -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'],
Expand All @@ -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)

Expand Down

0 comments on commit 2b435e9

Please sign in to comment.