From a9066609bbe55df19447e9fb0f4ee21b22e43331 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 2 Jul 2024 16:42:21 -0400 Subject: [PATCH] Fix remaining prompt file paths Special handling is required to find these prompt files from an installed version of the instructlab-sdg package. This updates the rest of this file to make use of `self.sdg_base` from the base `Flow` class which will work from an installed library. Signed-off-by: Russell Bryant --- src/instructlab/sdg/default_flows.py | 48 ++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/src/instructlab/sdg/default_flows.py b/src/instructlab/sdg/default_flows.py index 11c191f6..f83ed60b 100644 --- a/src/instructlab/sdg/default_flows.py +++ b/src/instructlab/sdg/default_flows.py @@ -144,7 +144,8 @@ def get_flow(self) -> list: "block_config": { "block_name": "gen_knowledge", "config_path": os.path.join( - self.sdg_base, "configs/knowledge/generate_questions_responses.yaml" + self.sdg_base, + "configs/knowledge/generate_questions_responses.yaml", ), "client": self.client, "model_id": self.model_id, @@ -276,7 +277,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "gen_questions", - "config_path": "src/instructlab/sdg/configs/skills/freeform_questions.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/freeform_questions.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -293,7 +297,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "eval_questions", - "config_path": "src/instructlab/sdg/configs/skills/evaluate_freeform_questions.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/evaluate_freeform_questions.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -322,7 +329,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "gen_responses", - "config_path": "src/instructlab/sdg/configs/skills/freeform_responses.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/freeform_responses.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -337,7 +347,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "evaluate_qa_pair", - "config_path": "src/instructlab/sdg/configs/skills/evaluate_freeform_pair.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/evaluate_freeform_pair.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -376,7 +389,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_kwargs": { "block_name": "gen_contexts", - "config_path": "src/instructlab/sdg/configs/skills/contexts.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/contexts.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -396,7 +412,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "gen_grounded_questions", - "config_path": "src/instructlab/sdg/configs/skills/grounded_questions.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/grounded_questions.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -412,7 +431,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "eval_grounded_questions", - "config_path": "src/instructlab/sdg/configs/skills/evaluate_grounded_questions.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/evaluate_grounded_questions.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -442,7 +464,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "gen_grounded_responses", - "config_path": "src/instructlab/sdg/configs/skills/grounded_responses.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/grounded_responses.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family), @@ -457,7 +482,10 @@ def get_flow(self) -> list: "block_type": LLMBlock, "block_config": { "block_name": "evaluate_grounded_qa_pair", - "config_path": "src/instructlab/sdg/configs/skills/evaluate_grounded_pair.yaml", + "config_path": os.path.join( + self.sdg_base, + "configs/skills/evaluate_grounded_pair.yaml", + ), "client": self.client, "model_id": self.model_id, "model_prompt": _get_model_prompt(self.model_family),