Repository navigation
Description
Notebook: https://colab.research.google.com/drive/1Dyauq4kTZoLewQ1cApceUQVNcnnNTzg_?usp=sharing
After using the option: if True: model.save_pretrained_merged("x", tokenizer, save_method = "merged_16bit",) to save the model to the Colab local disk, i have tried to use it with the code below.
model = AutoModelForCausalLM.from_pretrained( "/content/x", load_in_8bit=True, device_map={"": 0}, )
and I received this error:
UnpicklingError: Weights only load failed. Re-running torch.loadwithweights_onlyset toFalse will likely succeed, but it can result in arbitrary code execution.Do it only if you get the file from a trusted source. WeightsUnpickler error: Unsupported operand 149 During handling of the above exception, another exception occurred: UnicodeDecodeError Traceback (most recent call last) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 128: invalid start byte During handling of the above exception, another exception occurred: OSError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py](https://localhost:8080/#) in load_state_dict(checkpoint_file) 552 ) from e 553 except (UnicodeDecodeError, ValueError): --> 554 raise OSError( 555 f"Unable to load weights from pytorch checkpoint file for '{checkpoint_file}' " 556 f"at '{checkpoint_file}'. " OSError: Unable to load weights from pytorch checkpoint file for '/content/x/pytorch_model-00001-of-00003.bin' at '/content/x/pytorch_model-00001-of-00003.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.
I also tried to add from_tf=True,
After that, I got: ValueError: Converting into 4-bit or 8-bit weights from tf/flax weights is currently not supported, please make sure the weights are in PyTorch format.
Activity
danielhanchen commentedon Jan 20, 2024
@bibidentuhanoi Sorry on the delay! Oh yep someone brought this up - its should be fixed now! But on ur model specifically - if you go to
config.json, edit it, and delete the entirety ofthen save it.
It should function!
bibidentuhanoi commentedon Jan 20, 2024
I have checked the model config but there is no
quantization_config:The problem is still there.
I have tried this 10-minute commit from your last commit.
danielhanchen commentedon Jan 21, 2024
@bibidentuhanoi Oops you're actually correct - I'll push a fix today! Sorry again! Thanks for the report as well!
danielhanchen commentedon Jan 21, 2024
@bibidentuhanoi Fixed it!! Sorry you might have to reinstall Unsloth - again sorry on the issue!
pip install --upgrade --force-reinstall --no-cache-dir git+https://github.com/unslothai/unsloth.git(no dependencies will get updated)I confirmed it was my fault, as HF does not like
pickle.HIGHEST_PROTOCOLbibidentuhanoi commentedon Jan 21, 2024
Everything's running smoothly on my end! Thank you for the quick fix. This project is absolutely amazing and has been a real time-saver for me.
Thank you.
danielhanchen commentedon Jan 21, 2024
@bibidentuhanoi Thanks for the kind words!! :))
Lift dark tooltips to #111 and their secondary text to #e0e0e0