From d2e74543e58de731c493666e9b31ab9da1115530 Mon Sep 17 00:00:00 2001 From: ljleb Date: Mon, 17 Jun 2024 12:43:24 -0400 Subject: [PATCH 1/2] Create FUNDING.yml --- .github/FUNDING.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b93772f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: ljleb +patreon: ljleb From b57d146dc3beab67042bd700ee62b8dd45f62454 Mon Sep 17 00:00:00 2001 From: ljleb Date: Mon, 17 Jun 2024 12:52:46 -0400 Subject: [PATCH 2/2] Update custom_merge_method.py --- examples/custom_merge_method.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/custom_merge_method.py b/examples/custom_merge_method.py index a34ffc4..3e5a5ea 100644 --- a/examples/custom_merge_method.py +++ b/examples/custom_merge_method.py @@ -1,6 +1,7 @@ import sd_mecha import torch from sd_mecha.extensions.merge_method import convert_to_recipe, LiftFlag, MergeSpace +from sd_mecha import Hyper sd_mecha.set_log_level() @@ -28,8 +29,10 @@ def custom_sum( b: torch.Tensor | LiftFlag[MergeSpace.BASE], *, # hyperparameters go here - alpha: float = 0.5, # default arguments are honored - beta: float, + # `Hyper` is an union type of `float`, `int` and `dict` (the dict case is for a different weight per block MBW), which is what the caller of the method excpects. + # in practice the method only ever receives numeric types (int or float), so no need to worry about the dict case + alpha: Hyper = 0.5, # default arguments are honored + beta: Hyper, # `@convert_to_recipe` introduces additional kwargs: `device=` and `dtype=` # We must put `**kwargs` to satisfy the type system: **kwargs,