MelleaSession with rejection sampling to derive README template variables
from a JSONL training dataset — including a high-level description, the inferred
Python argument list, and Jinja2-renderable sample rows. Validates the generated
output with deterministic requirements (correct naming conventions, syntactically
valid argument lists) before rendering the final INTRINSIC_README.md via a
Jinja2 template.
Functions
FUNC make_readme_jinja_dict
m.instruct with deterministic requirements and rejection sampling to
generate README template variables.
Args:
m: ActiveMelleaSessionto use for LLM generation.dataset_path: Path to the JSONL training dataset file.base_model: Base model ID or path used to train the adapter.prompt_file: Path to the prompt format file (empty string if not provided).name: Destination model name on Hugging Face Hub (e.g."acme/carbchecker-alora").hints: Optional string of additional domain hints to include in the prompt.
- Dict of Jinja2 template variables for rendering the
INTRINSIC_README.md.
FUNC generate_readme
MelleaSession, uses the LLM to generate template variables,
renders the Jinja template, and writes the result to output_path.
Args:
dataset_path: Path to the JSONL training dataset file.base_model: Base model ID or path used to train the adapter.prompt_file: Path to the prompt format file, orNone.output_path: Destination path for the generated README file.name: Destination model name on Hugging Face Hub.hints: Optional string of additional domain hints for the LLM.
- The path to the written output file (same as
output_path).
Classes
CLASS ReadmeTemplateVars
Pydantic model holding all variables required to render the intrinsic README template.
Attributes:
high_level_description: A 2-3 sentence description of what the intrinsic adapter does.dataset_description: Brief description of the training dataset contents and format.userid: HuggingFace user ID (the namespace portion of the model name).intrinsic_name: Short snake_case identifier for the intrinsic (e.g."carbchecker").intrinsic_name_camelcase: CamelCase version ofintrinsic_name(e.g."CarbChecker").arglist: Python function argument list with type hints (e.g."description\: str").arglist_without_type_annotations: Argument list without type hints (e.g."description").