From 861e245062c2bcc262d3cb8dc7c85cb63ddee553 Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 4 Dec 2023 17:51:21 +0800 Subject: [PATCH] RWKV_RESCALE_LAYER 999 for music model --- backend-python/utils/rwkv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend-python/utils/rwkv.py b/backend-python/utils/rwkv.py index b2e1101..d6ca77e 100644 --- a/backend-python/utils/rwkv.py +++ b/backend-python/utils/rwkv.py @@ -511,6 +511,9 @@ def get_tokenizer(tokenizer_len: int): def RWKV(model: str, strategy: str, tokenizer: Union[str, None]) -> AbstractRWKV: rwkv_beta = global_var.get(global_var.Args).rwkv_beta + if "midi" in model.lower() or "abc" in model.lower(): + os.environ["RWKV_RESCALE_LAYER"] = "999" + # dynamic import to make RWKV_CUDA_ON work if rwkv_beta: from rwkv_pip.beta.model import (