Merge branch 'master' of https://github.com/namtranase/llama.cpp
This commit is contained in:
commit
44f4ce2272
3 changed files with 3 additions and 6 deletions
|
@ -189,10 +189,7 @@ def apply_scale(module, scales_list, input_feat_dict=None):
|
||||||
if isinstance(prev_op, nn.Linear):
|
if isinstance(prev_op, nn.Linear):
|
||||||
assert len(layers) == 1
|
assert len(layers) == 1
|
||||||
scale_fc_fc(prev_op, layers[0], scales)
|
scale_fc_fc(prev_op, layers[0], scales)
|
||||||
elif (
|
elif isinstance(prev_op, (nn.LayerNorm, LlamaRMSNorm)) or "rmsnorm" in str(prev_op.__class__).lower():
|
||||||
isinstance(prev_op, (nn.LayerNorm, LlamaRMSNorm))
|
|
||||||
or "rmsnorm" in str(prev_op.__class__).lower()
|
|
||||||
):
|
|
||||||
scale_ln_fcs(prev_op, layers, scales)
|
scale_ln_fcs(prev_op, layers, scales)
|
||||||
elif isinstance(prev_op, (nn.GELU, BloomGelu, GELUActivation)):
|
elif isinstance(prev_op, (nn.GELU, BloomGelu, GELUActivation)):
|
||||||
new_module = ScaledActivation(prev_op, scales)
|
new_module = ScaledActivation(prev_op, scales)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue