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
09dbf9ff
Unverified
Commit
09dbf9ff
authored
Nov 20, 2024
by
Cyrus Leung
Committed by
GitHub
Nov 20, 2024
Browse files
[Bugfix] Handle conflicts between modern and legacy fields (#10471)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
343041c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
vllm/transformers_utils/config.py
vllm/transformers_utils/config.py
+9
-0
No files found.
vllm/transformers_utils/config.py
View file @
09dbf9ff
...
...
@@ -107,6 +107,15 @@ def patch_rope_scaling(config: PretrainedConfig) -> None:
def
patch_rope_scaling_dict
(
rope_scaling
:
Dict
[
str
,
Any
])
->
None
:
if
"rope_type"
in
rope_scaling
and
"type"
in
rope_scaling
:
rope_type
=
rope_scaling
[
"rope_type"
]
rope_type_legacy
=
rope_scaling
[
"type"
]
if
rope_type
!=
rope_type_legacy
:
raise
ValueError
(
f
"Found conflicts between 'rope_type=
{
rope_type
}
' (modern "
f
"field) and 'type=
{
rope_type_legacy
}
' (legacy field). "
"You should only specify one of them."
)
if
"rope_type"
not
in
rope_scaling
and
"type"
in
rope_scaling
:
rope_scaling
[
"rope_type"
]
=
rope_scaling
[
"type"
]
logger
.
info
(
"Replacing legacy 'type' key with 'rope_type'"
)
...
...
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