Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Lightning upgrades permanently causes SHA256 checks to fail in future #449

Closed
kyleboddy opened this issue Aug 31, 2023 · 5 comments · Fixed by #1003
Closed

Running Lightning upgrades permanently causes SHA256 checks to fail in future #449

kyleboddy opened this issue Aug 31, 2023 · 5 comments · Fixed by #1003

Comments

@kyleboddy
Copy link

In the warnings, if you actually run this command to upgrade the loaded checkpoint:

Lightning automatically upgraded your loaded checkpoint from v1.5.4 to v2.0.6. To apply the upgrade to your files permanently, run python -m pytorch_lightning.utilities.upgrade_checkpoint --file ../.cache/torch/whisperx-vad-segmentation.bin

Then in the future you will have SHA256 model checksum issues:

RuntimeError: Model has been downloaded but the SHA256 checksum does not not match. Please retry loading the model.

Then you have to delete the models in ~/.cache/torch and it will run fine.

Unsure what the workaround is if you want to permanently upgrade.

@AdolfVonKleist
Copy link

@kyleboddy you probably solved this already, but the sha256 check is run 'externally' by the library against the baked in s3 url. This is why the checksum fails after upgrade. Either the check needs to be skipped, or preferably updated against the updated checkpoint:

if hashlib.sha256(model_bytes).hexdigest() != VAD_SEGMENTATION_URL.split('/')[-2]:

@FreeTymeKiyan
Copy link

So no fix?

@FreeTymeKiyan
Copy link

I removed ~/.cache/torch/whisperx-vad-segmentation.bin and it resumed working.

@transfluxus
Copy link

transfluxus commented Nov 18, 2024

yes, but this comes after running that permanent update
Lightning automatically upgraded your loaded checkpoint from v1.5.4 to v2.4.0. To apply the upgrade to your files permanently, run python -m pytorch_lightning.utilities.upgrade_checkpoint ../../.cache/torch/whisperx-vad-segmentation.bin

@diaskz
Copy link

diaskz commented Dec 25, 2024

yes, but this comes after running that permanent update Lightning automatically upgraded your loaded checkpoint from v1.5.4 to v2.4.0. To apply the upgrade to your files permanently, run python -m pytorch_lightning.utilities.upgrade_checkpoint ../../.cache/torch/whisperx-vad-segmentation.bin

1 RUN ( with activated you venv)

python -m pytorch_lightning.utilities.upgrade_checkpoint ../../.cache/torch/whisperx-vad-segmentation.bin

2 RUN
sha256sum ../../.cache/torch/whisperx-vad-segmentation.bin

3 Modify ( cat ../venv/lib/python3.12/site-packages/whisperx/vad.py)
nano ../venv/lib/python3.12/site-packages/whisperx/vad.py

and in 19 line change

from:
VAD_SEGMENTATION_URL = "https://whisperx.s3.eu-west-2.amazonaws.com/model_weights/segmentation/0b5b3216d60a2d32fc086b47ea8c67589aaeb26b7e07fcbe620d6d0b83e209ea/pytorch_model.bin"

to:
VAD_SEGMENTATION_URL = "https://whisperx.s3.eu-west-2.amazonaws.com/model_weights/segmentation/ed7051b55315bfb3581da02c63c3e55fbb1eb93b951127d591a2fb95e4d956c6/pytorch_model.bin"

and try to re-run-code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants