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
6e0bde15
Commit
6e0bde15
authored
Sep 13, 2023
by
Casper Hansen
Browse files
Set AWQ_BATCH_SIZE environment variable
parent
a2aa804c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
awq/models/auto.py
awq/models/auto.py
+4
-1
No files found.
awq/models/auto.py
View file @
6e0bde15
import
os
from
transformers
import
AutoConfig
from
transformers
import
AutoConfig
from
awq.models
import
*
from
awq.models
import
*
from
awq.models.base
import
BaseAWQForCausalLM
from
awq.models.base
import
BaseAWQForCausalLM
...
@@ -35,7 +36,9 @@ class AutoAWQForCausalLM:
...
@@ -35,7 +36,9 @@ class AutoAWQForCausalLM:
@
classmethod
@
classmethod
def
from_quantized
(
self
,
quant_path
,
quant_filename
,
max_new_tokens
=
None
,
def
from_quantized
(
self
,
quant_path
,
quant_filename
,
max_new_tokens
=
None
,
device
=
'balanced'
,
trust_remote_code
=
True
,
fuse_layers
=
True
)
->
BaseAWQForCausalLM
:
device
=
'balanced'
,
trust_remote_code
=
True
,
fuse_layers
=
True
,
batch_size
=
1
)
->
BaseAWQForCausalLM
:
os
.
environ
[
"AWQ_BATCH_SIZE"
]
=
str
(
batch_size
)
model_type
=
check_and_get_model_type
(
quant_path
,
trust_remote_code
)
model_type
=
check_and_get_model_type
(
quant_path
,
trust_remote_code
)
return
AWQ_CAUSAL_LM_MODEL_MAP
[
model_type
].
from_quantized
(
return
AWQ_CAUSAL_LM_MODEL_MAP
[
model_type
].
from_quantized
(
...
...
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