Skip to content

Commit

Permalink
fix: kaggle import and large output response issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DriesSmit committed May 22, 2024
1 parent 399ad1c commit 112d400
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 44 deletions.
7 changes: 7 additions & 0 deletions debatellm/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ def _infer(
"num_messages_removed": history_counter,
}
response = response.choices[0].message.content # type: ignore

# If the response is to large, we cut off the start of the response
# until the response is small enough.
max_response_length = 1024
if len(str(response)) > max_response_length:
response = str(response)[-max_response_length:]

else:
response = "This is a mock output." # type: ignore
usage_info = {"prompt_tokens": 0, "response_tokens": 0, "cost": 0} # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jupyter_server==2.6.0
jupyter_server_terminals==0.4.4
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.7
kaggle
kaggle==1.5.16
keras==2.12.0
kiwisolver==1.4.4
latex==0.7.0
Expand Down
86 changes: 43 additions & 43 deletions scripts/launch_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

exp_table = []

agent_type = "gpt"
agent_type = "mixtral"

# Single agent
# exp_table.append(
Expand Down Expand Up @@ -91,36 +91,36 @@
# )

# Ensemble Refinement
# exp_table.extend(
# [
# {
# "system": "ensemble_refinement",
# "system.name": "ensemble_refinement",
# "system.num_reasoning_steps": 3,
# "system.num_aggregation_steps": [1, 9],
# "system.agents": gen_agent_config(
# 1,
# agent_type=agent_type,
# prompt="er_simple",
# is_es=True,
# use_few_shot_examples=False, # [False, True],
# ),
# },
# {
# "system": "ensemble_refinement_er_debate",
# "system.name": "ensemble_refinement",
# "system.num_reasoning_steps": 3,
# "system.num_aggregation_steps": [1, 9],
# "system.agents": gen_agent_config(
# 1,
# agent_type=agent_type,
# prompt="er_cot",
# is_es=True,
# use_few_shot_examples=False, # [False, True],
# ),
# },
# ]
# )
exp_table.extend(
[
{
"system": "ensemble_refinement",
"system.name": "ensemble_refinement",
"system.num_reasoning_steps": 3,
"system.num_aggregation_steps": [1, 9],
"system.agents": gen_agent_config(
1,
agent_type=agent_type,
prompt="er_simple",
is_es=True,
use_few_shot_examples=False, # [False, True],
),
},
{
"system": "ensemble_refinement_er_debate",
"system.name": "ensemble_refinement",
"system.num_reasoning_steps": 3,
"system.num_aggregation_steps": [1, 9],
"system.agents": gen_agent_config(
1,
agent_type=agent_type,
prompt="er_cot",
is_es=True,
use_few_shot_examples=False, # [False, True],
),
},
]
)

# SPP Synergy
# exp_table.append(
Expand All @@ -141,18 +141,18 @@
# "system.agreement_intensity": [2, 6],
# }
# )
exp_table.append(
{
"system": "google_mad",
"system.summarize_answers": [True, False],
"system.agents": gen_agent_config(
[2, 3, 4],
agent_type=agent_type,
prompt="cot",
),
"system.num_rounds": [2, 3],
}
)
# exp_table.append(
# {
# "system": "google_mad",
# "system.summarize_answers": [True, False],
# "system.agents": gen_agent_config(
# [2, 3, 4],
# agent_type=agent_type,
# prompt="cot",
# ),
# "system.num_rounds": [2, 3],
# }
# )


# # Tsinghua MAD
Expand Down

0 comments on commit 112d400

Please sign in to comment.