Enable tied weights with shared scales

This commit is contained in:
Oliver Simons committed 2026-10-27 18:47:46 +01:00
1 parent 3cb743d38c
commit f8999caf78
1 file changed
+2 -2
+2 -2
View File
@@ -1871,11 +1871,11 @@ bool llama_model_base::load_tensors(llama_model_loader & ml) {
// output scales
if (output) {
// weight scale
if (!output_s) {
if (!output_s && gguf_find_tensor(ml.metadata, tn(LLM_TENSOR_OUTPUT, "scale").str().c_str()) >= 0) {
output_s = create_tensor(tn(LLM_TENSOR_OUTPUT, "scale"), {1}, TENSOR_NOT_REQUIRED);
}
// input scale
if (!output_in_s) {
if (!output_in_s && gguf_find_tensor(ml.metadata, tn(LLM_TENSOR_OUTPUT, "input_scale").str().c_str()) >= 0) {
output_in_s = create_tensor(tn(LLM_TENSOR_OUTPUT, "input_scale"), {1}, TENSOR_NOT_REQUIRED);
}
}