mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
add merge message
This commit is contained in:
parent
a598823573
commit
92caf3d5fc
@ -49,10 +49,12 @@ def merge_model(request: MergeModelRequest):
|
||||
|
||||
merged: Dict[str, Any] = OrderedDict()
|
||||
merged["weight"] = {}
|
||||
print("merge start.")
|
||||
for key in tqdm.tqdm(weights[0].keys()):
|
||||
merged["weight"][key] = 0
|
||||
for i, weight in enumerate(weights):
|
||||
merged["weight"][key] += weight[key] * alphas[i]
|
||||
print("merge done. write metadata.")
|
||||
|
||||
merged["config"] = state_dict["config"]
|
||||
merged["params"] = state_dict["params"] if "params" in state_dict else None
|
||||
@ -62,4 +64,5 @@ def merge_model(request: MergeModelRequest):
|
||||
merged["embedder_name"] = (
|
||||
state_dict["embedder_name"] if "embedder_name" in state_dict else None
|
||||
)
|
||||
print("write metadata done.")
|
||||
return merged
|
||||
|
Loading…
Reference in New Issue
Block a user