nemo_curator.stages.text.experimental.translation.utils.prompt_loader

View as Markdown

Shared prompt-loading helpers for translation stages.

Module Contents

Functions

NameDescription
load_prompt_templateLoad a YAML prompt file and return (system_prompt, user_template).

Data

_PROMPT_DIR

API

nemo_curator.stages.text.experimental.translation.utils.prompt_loader.load_prompt_template(
filename: str
) -> tuple[str, str]

Load a YAML prompt file and return (system_prompt, user_template).

Parameters

filename : str Name of the YAML file inside the prompts/ directory (e.g. "translate.yaml" or "faith_eval.yaml").

Returns

tuple[str, str] (system prompt, user template).

Raises

FileNotFoundError If the prompt file does not exist. ValueError If the YAML is malformed or does not contain a top-level mapping. KeyError If the top-level mapping is missing the system or user key.

nemo_curator.stages.text.experimental.translation.utils.prompt_loader._PROMPT_DIR = Path(__file__).resolve().parent.parent / 'prompts'