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
chenpangpang
transformers
Commits
4bb50aa2
Unverified
Commit
4bb50aa2
authored
Oct 31, 2023
by
Younes Belkada
Committed by
GitHub
Oct 31, 2023
Browse files
[`Quantization` / `tests` ] Fix bnb MPT test (#27178)
fix bnb mpt test
parent
05f22901
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
tests/quantization/bnb/test_mixed_int8.py
tests/quantization/bnb/test_mixed_int8.py
+2
-3
No files found.
tests/quantization/bnb/test_mixed_int8.py
View file @
4bb50aa2
...
@@ -124,7 +124,6 @@ class MixedInt8Test(BaseMixedInt8Test):
...
@@ -124,7 +124,6 @@ class MixedInt8Test(BaseMixedInt8Test):
gc
.
collect
()
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
torch
.
cuda
.
empty_cache
()
@
unittest
.
skip
(
"Un-skip once https://github.com/mosaicml/llm-foundry/issues/703 is resolved"
)
def
test_get_keys_to_not_convert_trust_remote_code
(
self
):
def
test_get_keys_to_not_convert_trust_remote_code
(
self
):
r
"""
r
"""
Test the `get_keys_to_not_convert` function with `trust_remote_code` models.
Test the `get_keys_to_not_convert` function with `trust_remote_code` models.
...
@@ -135,11 +134,11 @@ class MixedInt8Test(BaseMixedInt8Test):
...
@@ -135,11 +134,11 @@ class MixedInt8Test(BaseMixedInt8Test):
model_id
=
"mosaicml/mpt-7b"
model_id
=
"mosaicml/mpt-7b"
config
=
AutoConfig
.
from_pretrained
(
config
=
AutoConfig
.
from_pretrained
(
model_id
,
trust_remote_code
=
True
,
revision
=
"
72e5f594ce36f9cabfa2a9fd8f58b491eb467e
e7"
model_id
,
trust_remote_code
=
True
,
revision
=
"
ada218f9a93b5f1c6dce48a4cc9ff01fcba431
e7"
)
)
with
init_empty_weights
():
with
init_empty_weights
():
model
=
AutoModelForCausalLM
.
from_config
(
model
=
AutoModelForCausalLM
.
from_config
(
config
,
trust_remote_code
=
True
,
code_revision
=
"
72e5f594ce36f9cabfa2a9fd8f58b491eb467e
e7"
config
,
trust_remote_code
=
True
,
code_revision
=
"
ada218f9a93b5f1c6dce48a4cc9ff01fcba431
e7"
)
)
self
.
assertEqual
(
get_keys_to_not_convert
(
model
),
[
"transformer.wte"
])
self
.
assertEqual
(
get_keys_to_not_convert
(
model
),
[
"transformer.wte"
])
...
...
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