-
Notifications
You must be signed in to change notification settings - Fork 640
Fix gptqmodel backend check #2420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
feac642
228215b
e94a212
2c95366
0101682
33334e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ | |
| from accelerate.hooks import remove_hook_from_module | ||
|
|
||
| if is_gptqmodel_available(): | ||
| from gptqmodel import BACKEND, QuantizeConfig, exllama_set_max_input_length | ||
| from gptqmodel import BACKEND, QuantizeConfig | ||
| from gptqmodel.quantization import FORMAT, GPTQ, METHOD | ||
| from gptqmodel.utils.importer import hf_select_quant_linear_v2 | ||
| from gptqmodel.utils.model import hf_convert_gptq_v1_to_v2_format, hf_convert_gptq_v2_to_v1_format | ||
|
|
@@ -669,8 +669,18 @@ class StoreAttr(object): | |
| model.quantize_config = StoreAttr() | ||
| model.quantize_config.desc_act = self.desc_act | ||
| model = gptq_post_init(model, use_act_order=self.desc_act) | ||
| if self.desc_act and self.backend == BACKEND.EXLLAMA_V1 and self.max_input_length is not None: | ||
| # Keep this compatibility guard for older gptqmodel versions where EXLLAMA_V1 still exists. | ||
| # This branch can be removed once we bump the minimum gptqmodel version and drop v1 support. | ||
| if ( | ||
| hasattr(BACKEND, "EXLLAMA_V1") | ||
| and self.backend == BACKEND.EXLLAMA_V1 | ||
| and self.desc_act | ||
| and self.max_input_length is not None | ||
| ): | ||
| from gptqmodel import exllama_set_max_input_length | ||
|
|
||
| model = exllama_set_max_input_length(model, self.max_input_length) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jiqing-feng Can you check if anyone stil uses this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checked no use of this func, removed. Thanks for the review. |
||
|
|
||
| return model | ||
|
|
||
| def pack_model( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.