Skip to content

Commit

Permalink
Fix remaining prompt file paths
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
russellb committed Jul 2, 2024
1 parent 2debc77 commit a906660
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions src/instructlab/sdg/default_flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit a906660

Please sign in to comment.