cellmap_flow.finetune.finetuned_model_templates

Templates for generating finetuned model YAML configurations.

This module provides functions to auto-generate the YAML config for serving finetuned models using FinetuneModelConfig (type: finetune).

Attributes

logger

Functions

generate_finetuned_model_yaml(→ pathlib.Path)

Generate .yaml configuration for serving a finetuned model.

Module Contents

cellmap_flow.finetune.finetuned_model_templates.logger
cellmap_flow.finetune.finetuned_model_templates.generate_finetuned_model_yaml(lora_adapter_path: str, base_model_dict: dict, model_name: str, output_path: pathlib.Path, data_path: str, queue: str = 'gpu_h100', charge_group: str = 'cellmap', json_data: dict = None, scale: str = 's0') pathlib.Path

Generate .yaml configuration for serving a finetuned model.

The generated YAML uses type: finetune, which delegates to FinetuneModelConfig. This loads the base model via its own ModelConfig, applies the LoRA adapter, and serves the result.

Parameters:
  • lora_adapter_path – Path to the saved LoRA adapter directory

  • base_model_dict – Dict describing the base model (from model_config.to_dict())

  • model_name – Name of the finetuned model

  • output_path – Where to write the .yaml file

  • data_path – Path to actual dataset (REQUIRED - no placeholders)

  • queue – LSF queue name

  • charge_group – LSF charge group

  • json_data – Optional dict with input_norm and postprocess from base model

  • scale – Scale level (e.g., “s0”, “s1”) from base model

Returns:

Path to the generated YAML file