from src.train_tools.restoration import load_processor, load_model_with_adapters


if __name__ == "__main__":
    local_model = load_model_with_adapters(
        base_model_path="Qwen/Qwen2.5-VL-3B-Instruct",
        checkpoint_identifier="path/to/checkpoint",
        device_map="cuda",
        torch_dtype="bfloat16"
    )
    processor = load_processor("Qwen/Qwen2.5-VL-3B-Instruct")
    print("Loaded model from local checkpoint.")
    local_model.eval()
    merged_model = local_model.merge_and_unload()

    output_dir = "baked_middle_heat_qwen"
    merged_model.save_pretrained(output_dir)
    processor.save_pretrained(output_dir)