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
421e218b
Unverified
Commit
421e218b
authored
Jul 24, 2024
by
Michael Goin
Committed by
GitHub
Jul 24, 2024
Browse files
[Bugfix] Bump transformers to 4.43.2 (#6752)
parent
5448f676
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
28 deletions
+29
-28
requirements-common.txt
requirements-common.txt
+1
-1
tests/test_config.py
tests/test_config.py
+28
-27
No files found.
requirements-common.txt
View file @
421e218b
...
...
@@ -6,7 +6,7 @@ numpy < 2.0.0
requests
tqdm
py-cpuinfo
transformers >= 4.43.
1
# Required for Chameleon and Llama 3.1 hotfox.
transformers >= 4.43.
2
# Required for Chameleon and Llama 3.1 hotfox.
tokenizers >= 0.19.1 # Required for Llama 3.
fastapi
aiohttp
...
...
tests/test_config.py
View file @
421e218b
...
...
@@ -64,8 +64,9 @@ def test_get_sliding_window():
def
test_rope_customization
():
TEST_ROPE_SCALING
=
{
"
rope_
type"
:
"dynamic"
,
"factor"
:
2.0
}
TEST_ROPE_SCALING
=
{
"type"
:
"dynamic"
,
"factor"
:
2.0
}
TEST_ROPE_THETA
=
16_000_000.0
LONGCHAT_ROPE_SCALING
=
{
"type"
:
"linear"
,
"factor"
:
8.0
}
llama_model_config
=
ModelConfig
(
"meta-llama/Meta-Llama-3-8B-Instruct"
,
...
...
@@ -95,29 +96,29 @@ def test_rope_customization():
None
)
==
TEST_ROPE_THETA
assert
llama_model_config
.
max_model_len
==
16384
# TODO: add these back when the rope configs are fixed
# LONGCHAT_ROPE_SCALING = {"rope_type": "linear", "factor": 8.0}
# longchat_model_config = ModelConfig(
#
"lmsys/longchat-13b-16k
",
#
"lmsys/longchat-13b-16k"
,
#
tokenizer_mode="auto
",
#
trust_remote_code=False
,
# dtype="float16",
#
seed=0,
# )
# assert getattr(
longchat_model_config.hf_config
, "
rope_scaling
",
#
None) ==
LONGCHAT_ROPE_SCALING
#
assert longchat_model_config.max_model_len == 16384
#
longchat_model_config = ModelConfig(
#
"lmsys/longchat-13b-16k",
#
"lmsys/longchat-13b-16k",
#
tokenizer_mode="auto",
#
trust_remote_code=False,
#
dtype="float16",
#
seed=0,
#
rope_scaling=TEST_ROPE_SCALING,
#
)
#
assert getattr(longchat_model_config.hf_config, "rope_scaling",
#
None) == TEST_ROPE_SCALING
#
assert longchat_model_config.max_model_len == 4096
longchat_model_config
=
ModelConfig
(
"lmsys/longchat-13b-16k"
,
"lmsys/longchat-13b-16k"
,
tokenizer_mode
=
"auto
"
,
trust_remote_code
=
False
,
dtype
=
"float16
"
,
seed
=
0
,
)
#
Check if LONGCHAT_ROPE_SCALING entries are in longchat_model_config
assert
all
(
longchat_model_config
.
hf_config
.
rope_scaling
.
get
(
key
)
==
value
for
key
,
value
in
LONGCHAT_ROPE_SCALING
.
items
())
assert
longchat_model_config
.
max_model_len
==
16384
longchat_model_config
=
ModelConfig
(
"lmsys/longchat-13b-16k"
,
"lmsys/longchat-13b-16k"
,
tokenizer_mode
=
"auto"
,
trust_remote_code
=
False
,
dtype
=
"float16"
,
seed
=
0
,
rope_scaling
=
TEST_ROPE_SCALING
,
)
assert
getattr
(
longchat_model_config
.
hf_config
,
"rope_scaling"
,
None
)
==
TEST_ROPE_SCALING
assert
longchat_model_config
.
max_model_len
==
4096
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