def METHOD_NAME(
    training_config: TrainingConfig,
    dataset_config: DatasetConfig,
    export_reference: Optional[HuggingFaceModelReference],
    launch_interactive: bool,
) -> ResultSummary:
    model_ref, model_type, prompt_format = pick_model(
        training_config.model_selection, training_config.storage_directory
    )
    tokenizer = load_tokenizer(model_ref)
    train_data, test_data = prepare_datasets(
        dataset_config, tokenizer, model_type, prompt_format
    )
    model = train(model_ref, training_config, train_data, test_data, tokenizer)
    if launch_interactive:
        transcript = launch_interactively(
            app_url=Link(
                label="Interactive Evaluation App",
                url="http://localhost:7861",
            ),
            model=model,
            tokenizer=tokenizer,
            model_type=model_type,
            max_input_tokens=dataset_config.max_input_length,
            max_new_tokens=dataset_config.max_output_length,
            prompt_format=prompt_format,
        )
    else:
        transcript = []
    eval_results = eval(
        model, test_data, tokenizer, model_type, dataset_config, prompt_format
    )
    exported_model_reference = None
    if export_reference is not None:
        exported_model_reference = export(model, export_reference)
    return summarize(
        source_model=model_ref,
        trained_model=model,
        evaluation_results=eval_results,
        pushed_model_reference=exported_model_reference,
        interactive_eval_transcript=transcript,
    )