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 huggingface downloader Windows support (#564) #575

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

Macil
Copy link
Contributor

@Macil Macil commented Aug 2, 2023

Pull Request Template

Checklist

  • Confirm that run-checks.sh has been executed. (I'm not sure if this can be run on Windows. In the burn-dataset directory, I have manually tried "cargo test --all-features" which has the unrelated tests "dataset::sqlite::tests::sqlite_writer_write" and "dataset::sqlite::tests::sqlite_writer_write_multi_thread" fail, and tried "cargo doc --all-features" which works fine.)

Related Issues/PRs

Fixes #564

Changes

The path that the huggingface dataset downloader runs Python from has been changed to support how Python VirtualEnv arranges its files on Windows (which is arbitrarily different).

Testing

The commands cargo run --example mnist --release --features ndarray and cargo run --example mnist --release --features wgpu have been tested. They both now get past the download step and successfully train and finish with this PR's changes.

@nathanielsimard
Copy link
Member

We have an issue to rewrite the CI in Rust so that it can be run on all devices #552.

@@ -10,6 +10,10 @@ use thiserror::Error;

const PYTHON: &str = "python3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is used anymore, if this is the case, we should delete this line.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code, I think this installs venv. Which makes me think that python3 works on Windows as well but probably python is used under venv.

Copy link
Contributor Author

@Macil Macil Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the "python3" constant is still successfully used to create the virtual env to begin with, but then that virtual env contains a "Scripts/python.exe" (no python3.exe present there) file which is used to do stuff inside of the virtual env.

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works on windows, I am okay to merge it.

@@ -10,6 +10,10 @@ use thiserror::Error;

const PYTHON: &str = "python3";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code, I think this installs venv. Which makes me think that python3 works on Windows as well but probably python is used under venv.

@mashirooooo
Copy link
Contributor

If possible, please add code to initialize a "venv" environment and check if it is properly initialized to ensure the code runs smoothly.

@nathanielsimard nathanielsimard merged commit 706a6ea into tracel-ai:main Aug 3, 2023
@Macil Macil deleted the fixWindowsDownloader branch August 3, 2023 20:14
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 this pull request may close these issues.

Windows: Downloading Python dependencies Error
4 participants