From 1e3ec3c91f140c5f0dddad95a9bcb843d67b382b Mon Sep 17 00:00:00 2001 From: zhangsibo1129 <134488188+zhangsibo1129@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:25:59 +0800 Subject: [PATCH] Complete FastLinear.load parameters in OPTDecoder initialization (#1060) # What does this PR do? `FastLinear.load` requires 4 parameters, but in the following only 3 are given. This PR fix this. ```python # server/text_generation_server/models/custom_modeling/opt_modeling.py if config.word_embed_proj_dim != config.hidden_size: self.project_out = FastLinear.load( config, prefix="model.decoder.project_out", bias=False ) else: self.project_out = None if config.word_embed_proj_dim != config.hidden_size: self.project_in = FastLinear.load( config, prefix="model.decoder.project_in", bias=False ``` ## Who can review? Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR. --- .../models/custom_modeling/opt_modeling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/text_generation_server/models/custom_modeling/opt_modeling.py b/server/text_generation_server/models/custom_modeling/opt_modeling.py index fe6f1e52..ce3f5e21 100644 --- a/server/text_generation_server/models/custom_modeling/opt_modeling.py +++ b/server/text_generation_server/models/custom_modeling/opt_modeling.py @@ -444,14 +444,14 @@ class OPTDecoder(OPTPreTrainedModel): if config.word_embed_proj_dim != config.hidden_size: self.project_out = FastLinear.load( - config, prefix="model.decoder.project_out", bias=False + config, prefix="model.decoder.project_out", weights=weights, bias=False ) else: self.project_out = None if config.word_embed_proj_dim != config.hidden_size: self.project_in = FastLinear.load( - config, prefix="model.decoder.project_in", bias=False + config, prefix="model.decoder.project_in", weights=weights, bias=False ) else: self.project_in = None