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
6eaccb73
Unverified
Commit
6eaccb73
authored
May 12, 2024
by
Yikang Shen
Committed by
GitHub
May 11, 2024
Browse files
[Model] Add support for IBM Granite Code models (#4636)
parent
e254497b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
vllm/model_executor/models/llama.py
vllm/model_executor/models/llama.py
+6
-2
No files found.
vllm/model_executor/models/llama.py
View file @
6eaccb73
...
...
@@ -58,15 +58,16 @@ class LlamaMLP(nn.Module):
intermediate_size
:
int
,
hidden_act
:
str
,
quant_config
:
Optional
[
QKVParallelLinear
]
=
None
,
bias
:
bool
=
False
,
)
->
None
:
super
().
__init__
()
self
.
gate_up_proj
=
MergedColumnParallelLinear
(
hidden_size
,
[
intermediate_size
]
*
2
,
bias
=
False
,
bias
=
bias
,
quant_config
=
quant_config
)
self
.
down_proj
=
RowParallelLinear
(
intermediate_size
,
hidden_size
,
bias
=
False
,
bias
=
bias
,
quant_config
=
quant_config
)
if
hidden_act
!=
"silu"
:
raise
ValueError
(
f
"Unsupported activation:
{
hidden_act
}
. "
...
...
@@ -209,6 +210,7 @@ class LlamaDecoderLayer(nn.Module):
intermediate_size
=
config
.
intermediate_size
,
hidden_act
=
config
.
hidden_act
,
quant_config
=
quant_config
,
bias
=
getattr
(
config
,
"mlp_bias"
,
False
),
)
self
.
input_layernorm
=
RMSNorm
(
config
.
hidden_size
,
eps
=
config
.
rms_norm_eps
)
...
...
@@ -348,6 +350,8 @@ class LlamaForCausalLM(nn.Module):
# compatibility
if
not
lora_config
else
lora_config
.
lora_vocab_padding_size
,
)
if
config
.
tie_word_embeddings
:
self
.
lm_head
.
weight
=
self
.
model
.
embed_tokens
.
weight
logit_scale
=
getattr
(
config
,
"logit_scale"
,
1.0
)
self
.
logits_processor
=
LogitsProcessor
(
self
.
unpadded_vocab_size
,
...
...
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