mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Make llava/minigpt-4 work with AutoGPTQ
This commit is contained in:
parent
f4defde752
commit
e471919e6d
@ -51,4 +51,15 @@ def load_quantized(model_name):
|
||||
|
||||
logger.info(f"The AutoGPTQ params are: {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
|
||||
|
Loading…
Reference in New Issue
Block a user