Make llava/minigpt-4 work with AutoGPTQ
This commit is contained in:
parent
f4defde752
commit
e471919e6d
1 changed files with 11 additions and 0 deletions
|
@ -51,4 +51,15 @@ def load_quantized(model_name):
|
||||||
|
|
||||||
logger.info(f"The AutoGPTQ params are: {params}")
|
logger.info(f"The AutoGPTQ params are: {params}")
|
||||||
model = AutoGPTQForCausalLM.from_quantized(path_to_model, **params)
|
model = AutoGPTQForCausalLM.from_quantized(path_to_model, **params)
|
||||||
|
|
||||||
|
# These lines fix the multimodal extension when used with AutoGPTQ
|
||||||
|
if not hasattr(model, 'dtype'):
|
||||||
|
model.dtype = model.model.dtype
|
||||||
|
|
||||||
|
if not hasattr(model, 'embed_tokens'):
|
||||||
|
model.embed_tokens = model.model.model.embed_tokens
|
||||||
|
|
||||||
|
if not hasattr(model.model, 'embed_tokens'):
|
||||||
|
model.model.embed_tokens = model.model.model.embed_tokens
|
||||||
|
|
||||||
return model
|
return model
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue