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
8e7e9ccc
Commit
8e7e9ccc
authored
Jun 27, 2023
by
Jiaming Tang
Browse files
[Minor] Auto-create the cache directory if not existing
parent
34f1faff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
awq/entry.py
awq/entry.py
+6
-0
No files found.
awq/entry.py
View file @
8e7e9ccc
...
...
@@ -105,6 +105,9 @@ def build_model_and_enc(model_path):
n_samples
=
128
,
seqlen
=
512
,
)
if
args
.
dump_awq
:
dirpath
=
os
.
path
.
dirname
(
args
.
dump_awq
)
os
.
makedirs
(
dirpath
,
exist_ok
=
True
)
torch
.
save
(
awq_results
,
args
.
dump_awq
)
print
(
"AWQ results saved at"
,
args
.
dump_awq
)
...
...
@@ -134,6 +137,9 @@ def build_model_and_enc(model_path):
model
,
w_bit
=
args
.
w_bit
,
q_config
=
q_config
)
if
args
.
dump_quant
:
dirpath
=
os
.
path
.
dirname
(
args
.
dump_quant
)
os
.
makedirs
(
dirpath
,
exist_ok
=
True
)
print
(
f
"Saving the quantized model at
{
args
.
dump_quant
}
..."
)
torch
.
save
(
model
.
cpu
().
state_dict
(),
args
.
dump_quant
)
...
...
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