Skip to content

Doesn't seem to work with pytorch 2.0.1 #1

Description

@blksith0

This command results in this error:
translit = Translit('ml')

ℹ ml model downloading inside itranlit-models..
✔ ml model download successfull. model path itranlit-models/ml.pth
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/me/testtransliterategithubthing/venv/lib/python3.11/site-packages/itranslit/transliterate.py", line 582, in __init__
    self.model = load_pretrained(self.model, self.model_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/testtransliterategithubthing/venv/lib/python3.11/site-packages/itranslit/transliterate.py", line 525, in load_pretrained
    pretrain_dict = torch.load(weight_path, map_location=torch.device('cpu'))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/testtransliterategithubthing/venv/lib/python3.11/site-packages/torch/serialization.py", line 815, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/testtransliterategithubthing/venv/lib/python3.11/site-packages/torch/serialization.py", line 1033, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_pickle.UnpicklingError: invalid load key, '<'.```

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