Skip to content

push_to_hub is broken due to some tensors sharing memory #48

@sergiopaniego

Description

@sergiopaniego

Currently, when saving a model and its processor after training, the following error is thrown:

...
RuntimeError: 
            Some tensors share memory, this will lead to duplicate memory on disk and potential differences when loading them again: [{'language_model.lm_head.weight', 'language_model.model.embed_tokens.weight'}].
            A potential way to correctly save your model is to use `save_model`.
            More information at https://huggingface.co/docs/safetensors/torch_shared_tensors

This error indicated that 2 layers tensors are sharing memory and this issue prevents it from saving it correctly.

It has already been reported in #42 and addressed #45.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions