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

Fix torchdata import error #2242

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

NicolasHug
Copy link
Member

This PR moves all the torchdata imports as lazy imports to avoid import error when torchdata is not present.

Smoke test is passing when torchdata is not present:

(text) ➜  text git:(lajenflajenfljanefljanefljajnef) ✗ python -c "import torchdata"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'torchdata'


(text) ➜  text git:(lajenflajenfljanefljanefljajnef) ✗ python test/smoke_tests/smoke_tests.py
torchtext version is  0.17.0a0+51f373d

@NicolasHug NicolasHug requested a review from atalman March 22, 2024 16:57
Copy link

pytorch-bot bot commented Mar 22, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/text/2242

Note: Links to docs will display an error until the docs builds have been completed.

❌ 9 New Failures, 4 Unrelated Failures

As of commit 7d494b1 with merge base 51f373d (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@NicolasHug NicolasHug merged commit ecb9ebc into pytorch:main Mar 22, 2024
22 of 35 checks passed
@NicolasHug NicolasHug deleted the lajenflajenfljanefljanefljajnef branch March 22, 2024 17:05
PaliC pushed a commit that referenced this pull request Mar 22, 2024
* Remove stuff

* stuff

* lint
PaliC added a commit that referenced this pull request Mar 22, 2024
Co-authored-by: Nicolas Hug <[email protected]>
Fix torchdata import error (#2242)
PaliC pushed a commit that referenced this pull request Mar 23, 2024
* Remove stuff

* stuff

* lint
huydhn pushed a commit that referenced this pull request Mar 23, 2024
* Remove stuff

* stuff

* lint
huydhn added a commit that referenced this pull request Mar 23, 2024
* Remove torchdata dependency from package and from CI (#2241)

* Fix torchdata import error (#2242)

* Remove stuff

* stuff

* lint

---------

Co-authored-by: Nicolas Hug <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants