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
In the terminal:
flow-merge run --config-file example.yamlAlternatively, in a Notebook:
my_merge_plan = MergePlan.from_file("example-config.yaml")
Instantiate a config object interactively
MergeConfig()Step with a link.
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