flow-merge Help

Loading a merge configuration

This section explains how we load merging tasks and their related settings.

Initialize a merge plan from configuration

Consider a config file at our current working directory named example-config.yaml. It has the following contents:


merge_method: "slerp" base_model: "Qwen/Qwen2-0.5B" slices: - sources -

You can load the file either via the terminal or using a Notebook

  1. In the terminal:

    flow-merge run --config-file example.yaml
  2. Alternatively, in a Notebook:

    my_merge_plan = MergePlan.from_file("example-config.yaml")
  1. Instantiate a config object interactively

    MergeConfig()
  2. Step with a link.

  3. Final step in part 1.

Now you have created a new MergePlan object. This object serves as the base for the merging operation, providing the necessary slices. The merge is defined piece-wise, where each single slice represents a single corresponding output layer. Each slice contains the desired merging options for that output layer.

Python representation of the output object MergePlan:

MergePlan( merge_method="slerp", slices=[ NormalizedSlice( key1=value1, key2=value2 ) ], key3="value", key4="value", )
Last modified: 22 August 2024