Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
2c9b8ea2
Unverified
Commit
2c9b8ea2
authored
Dec 27, 2024
by
Jee Jee Li
Committed by
GitHub
Dec 27, 2024
Browse files
[Bugfix] Fix TeleChat2ForCausalLM weights mapper (#11546)
Signed-off-by:
Jee Jee Li
<
pandaleefree@gmail.com
>
parent
d003f3ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
vllm/model_executor/models/telechat2.py
vllm/model_executor/models/telechat2.py
+13
-13
No files found.
vllm/model_executor/models/telechat2.py
View file @
2c9b8ea2
...
@@ -31,19 +31,6 @@ from .utils import (AutoWeightsLoader, PPMissingLayer, WeightsMapper,
...
@@ -31,19 +31,6 @@ from .utils import (AutoWeightsLoader, PPMissingLayer, WeightsMapper,
class
TeleChat2Model
(
LlamaModel
):
class
TeleChat2Model
(
LlamaModel
):
hf_to_vllm_mapper
=
WeightsMapper
(
orig_to_new_prefix
=
{
"transformer."
:
"model."
,
},
orig_to_new_substr
=
{
".h."
:
".layers."
,
".self_attention."
:
".self_attn."
,
".word_embeddings."
:
".embed_tokens."
,
".dense."
:
".o_proj."
,
".ln_f."
:
".norm."
,
},
)
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
def
__init__
(
self
,
*
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
# 1. Initialize the LlamaModel with bias
# 1. Initialize the LlamaModel with bias
vllm_config
.
model_config
.
hf_config
.
bias
=
True
vllm_config
.
model_config
.
hf_config
.
bias
=
True
...
@@ -118,6 +105,19 @@ class TeleChat2Model(LlamaModel):
...
@@ -118,6 +105,19 @@ class TeleChat2Model(LlamaModel):
class
TeleChat2ForCausalLM
(
LlamaForCausalLM
):
class
TeleChat2ForCausalLM
(
LlamaForCausalLM
):
hf_to_vllm_mapper
=
WeightsMapper
(
orig_to_new_prefix
=
{
"transformer."
:
"model."
,
},
orig_to_new_substr
=
{
".h."
:
".layers."
,
".self_attention."
:
".self_attn."
,
".word_embeddings."
:
".embed_tokens."
,
".dense."
:
".o_proj."
,
".ln_f."
:
".norm."
,
},
)
def
_init_model
(
self
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
def
_init_model
(
self
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
return
TeleChat2Model
(
vllm_config
=
vllm_config
,
prefix
=
prefix
)
return
TeleChat2Model
(
vllm_config
=
vllm_config
,
prefix
=
prefix
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment