Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
AutoAWQ
Commits
a293e16f
"vscode:/vscode.git/clone" did not exist on "deb440b3a2179b1eccce9cf5dc1d4ff0e8a03135"
Commit
a293e16f
authored
Jun 26, 2023
by
Jiaming Tang
Browse files
[Minor] fix loading awq checkpoint issue
parent
36913edb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
awq/entry.py
awq/entry.py
+7
-6
No files found.
awq/entry.py
View file @
a293e16f
...
...
@@ -87,7 +87,13 @@ def build_model_and_enc(model_path):
model
=
AutoModelForCausalLM
.
from_pretrained
(
model_path
,
config
=
config
,
trust_remote_code
=
True
,
**
kwargs
)
if
args
.
run_awq
:
if
args
.
load_awq
:
print
(
"Loading pre-computed AWQ results from"
,
args
.
load_awq
)
awq_results
=
torch
.
load
(
args
.
load_awq
,
map_location
=
"cpu"
)
apply_awq
(
model
,
awq_results
)
elif
args
.
run_awq
:
awq_results
=
run_awq
(
model
,
enc
,
w_bit
=
args
.
w_bit
,
q_config
=
q_config
,
...
...
@@ -97,11 +103,6 @@ def build_model_and_enc(model_path):
torch
.
save
(
awq_results
,
args
.
dump_awq
)
print
(
"AWQ results saved at"
,
args
.
dump_awq
)
if
args
.
load_awq
:
print
(
"Loading pre-computed AWQ results from"
,
args
.
load_awq
)
awq_results
=
torch
.
load
(
args
.
load_awq
,
map_location
=
"cpu"
)
apply_awq
(
model
,
awq_results
)
# weight quantization
if
args
.
w_bit
is
not
None
:
if
args
.
q_backend
==
"fake"
:
...
...
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