You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:\Users\windo\neil\Janus\load_janus_pro.py", line 21, in <module>
vl_gpt: MultiModalityCausalLM = AutoModelForCausalLM.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\transformers\models\auto\auto_factory.py", line 564, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\transformers\modeling_utils.py", line 4224, in from_pretrained
) = cls._load_pretrained_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\transformers\modeling_utils.py", line 4794, in _load_pretrained_model
new_error_msgs, offload_index, state_dict_index = _load_state_dict_into_meta_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\transformers\modeling_utils.py", line 875, in _load_state_dict_into_meta_model
hf_quantizer.create_quantized_param(model, param, param_name, param_device, state_dict, unexpected_keys)
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\transformers\quantizers\quantizer_bnb_4bit.py", line 226, in create_quantized_param
new_value = bnb.nn.Params4bit.from_prequantized(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\bitsandbytes\nn\modules.py", line 280, in from_prequantized
self.quant_state = QuantState.from_dict(qs_dict=quantized_stats, device=device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\windo\neil\Janus\.venv\Lib\site-packages\bitsandbytes\functional.py", line 756, in from_dict
raise ValueError(
ValueError: There should be exactly one `quant_state` item with ending from ['bitsandbytes__fp4', 'bitsandbytes__nf4'].
Detected ['aligner.layers.0.weight.quant_state.bitsandbytes__fp4', 'gen_aligner.layers.0.weight.quant_state.bitsandbytes__fp4'].
Here are the keys in qs_dict at the source of the error:
The model runs just fine when it's quantized without being saved.
Seems like it's a shortcoming when writing the config file or validating the keys? Especially since the model runs just fine when quantized on-the-fly.
Expected behavior
I would expect the model to load, since it can load and quantize just fine when it has access to the full weights.
The text was updated successfully, but these errors were encountered:
System Info
Windows 11 Home
x64
python 3.11.9
env:
Reproduction
Clone the Janus repo:
https://github.com/deepseek-ai/Janus . The rest of the examples are run from the root of that repo.
Download and run quantized model:
Error:
Here are the keys in qs_dict at the source of the error:
For reference, the original config.json:
https://huggingface.co/deepseek-ai/Janus-Pro-7B/blob/main/config.json
the quantized config.json:
https://huggingface.co/neilmehta24/janus-pro-7b-4bit/blob/main/config.json
the model upload code:
Notes:
Expected behavior
I would expect the model to load, since it can load and quantize just fine when it has access to the full weights.
The text was updated successfully, but these errors were encountered: