disable submission

This commit is contained in:
Yizhou Chi 2024-10-14 09:56:55 +08:00
parent 3a57060e25
commit a91003a7fe
4 changed files with 55 additions and 25 deletions

View file

@ -38,7 +38,8 @@ class InstructionGenerator:
self.state = state
self.file_path = state["exp_pool_path"]
if state["custom_dataset_dir"]:
self.dataset_info = "xxx"
with open(f"{state['custom_dataset_dir']}/description.md", "r", encoding="utf-8") as file:
self.dataset_info = file.read()
else:
dataset_info_path = f"{self.data_config['datasets_dir']}/{state['task']}/dataset_info.json"
with open(dataset_info_path, "r") as file:

View file

@ -5,7 +5,8 @@ from metagpt.llm import LLM
DATA_CONFIG = load_data_config()
DATASET_INSIGHT_PROMPT = """
DATASET_DESCRIPTION_SELA_PROMPT = """
# Dataset Description
{dataset}
@ -14,6 +15,15 @@ DATASET_INSIGHT_PROMPT = """
# Dataset Head
{head}
"""
DATASET_DESCRIPTION_CUSTOM_PROMPT = """
# Dataset Description
{dataset_description}
"""
DATASET_INSIGHT_PROMPT = """
{description}
# Instruction
Propose insights to help improve the performance of the model on this dataset.
@ -127,11 +137,15 @@ class SolutionDesigner:
async def generate_solutions(self, dataset_info, dataset_name, save_analysis_pool=True):
llm = LLM()
context = DATASET_INSIGHT_PROMPT.format(
dataset=dataset_info["description"],
metadata=self.metadata_builder(dataset_info["metadata"]),
head=dataset_info["df_head"],
)
if type(dataset_info) == dict:
description_prompt = DATASET_DESCRIPTION_SELA_PROMPT.format(
dataset=dataset_info["description"],
metadata=self.metadata_builder(dataset_info["metadata"]),
head=dataset_info["df_head"],
)
else:
description_prompt = DATASET_DESCRIPTION_CUSTOM_PROMPT.format(dataset_description=dataset_info)
context = DATASET_INSIGHT_PROMPT.format(description=description_prompt)
rsp = await llm.aask(context)
rsp = clean_json_from_rsp(rsp)
analysis_pool = self.process_analysis_pool(json.loads(rsp))