fix: import os before updating sys.path in DIT latent script#87
Open
peter941221 wants to merge 1 commit into
Open
fix: import os before updating sys.path in DIT latent script#87peter941221 wants to merge 1 commit into
peter941221 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
create_imagenet_latents.pyappends tosys.pathwithos.path.join(...)beforeimport os.On current
main, that crashes at import time with:NameError: name 'os' is not definedvae_hf_cs.pyalready fixed the same import-order bug, but this DIT latent script still has the broken order.Fix
Move
import osabove thesys.path.append(...)call increate_imagenet_latents.py.This keeps the script behavior the same apart from removing the import-time failure.
Verification
On
origin/main:python3 src/cerebras/modelzoo/data_preparation/vision/dit/create_imagenet_latents.pyfails immediately with:
NameError: name 'os' is not definedOn this branch, the same command gets past that line and fails later in the current environment with:
ModuleNotFoundError: No module named 'torch'I also ran:
python3 -m py_compile src/cerebras/modelzoo/data_preparation/vision/dit/create_imagenet_latents.py