CLIP/clip
scott-vsi 45afa5f92c
fix torch.load after torch.jit.load
If we try to load a CLIP model that has not been traced (and is saved as a state_dict), then this first tries to load it with `torch.jit.load(opened_file)` while will eventually raise a RuntimeError, which is then caught and handled and you re-try loading the model with `torch.load(opened_file)`. However, the file pointer, `opened_file` has been advanced by `torch.jit.load`, so this attempt fails with a `EOFError: Ran out of input` exception. To fix this, we simply need to reset the file pointer to the beginning of the file with `.fseek(0)`
2024-09-17 21:21:22 -04:00
..
__init__.py Make the repo installable as a package (#26) 2021-01-30 03:05:01 +09:00
bpe_simple_vocab_16e6.txt.gz Make the repo installable as a package (#26) 2021-01-30 03:05:01 +09:00
clip.py fix torch.load after torch.jit.load 2024-09-17 21:21:22 -04:00
model.py Removed another unused f-string (#276) 2022-07-27 12:42:37 -07:00
simple_tokenizer.py Make the repo installable as a package (#26) 2021-01-30 03:05:01 +09:00