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

torch extra requires for safetensors dep #2371

Merged
merged 1 commit into from
Jul 11, 2024
Merged

torch extra requires for safetensors dep #2371

merged 1 commit into from
Jul 11, 2024

Conversation

qgallouedec
Copy link
Member

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Thanks @qgallouedec !

@Wauplin Wauplin merged commit 51d03b2 into main Jul 11, 2024
15 of 17 checks passed
@Wauplin Wauplin deleted the qgallouedec-patch-1 branch July 11, 2024 11:07
Wauplin added a commit that referenced this pull request Jul 11, 2024
* Use extended path on Windows when downloading to local dir

Change the path of the local dir to an extended path by prepending
"\\?\" to the absolute path, when the absolute path is longer
than 255 characters on Windows.

Also fixed a small typo.

* Use extended path on Windows when downloading to local dir

Change the path of the local dir to an extended path by prepending
"\\?\" to the absolute path, when the absolute path is longer
than 255 characters on Windows.

Also fixed a small typo.

* Move path handling to `get_local_download_paths()` for robustness

On Windows we check the length of `lock_path` and if it is longer than
255 characters we prepend the `\\?\` prefix to all paths if it does not
already exist.

We only need to check the length of `lock_path` because it is guaranteed
to be the longest path.

* `safetensors[torch]` (#2371)

* Fix token=False not respected in file download (#2386)

* Fix token=False not respected in file download

* lint

* Handle shared layers in `save_torch_state_dict` + add `save_torch_model` (#2373)

* Handle shared layers in save_torch_state_dict + save_torch_model + some helpers

* fix pytest rerun

* more reruns

* Support `expand` parameter in `xxx_info` and `list_xxxs` (model/dataset/Space) (#2333)

* First draft to support `expand` parameter for models

* add expand support for dataset

* add expand support for Space

* Use extended path on Windows when downloading to local dir

Change the path of the local dir to an extended path by prepending
"\\?\" to the absolute path, when the absolute path is longer
than 255 characters on Windows.

Also fixed a small typo.

* Move path handling to `get_local_download_paths()` for robustness

On Windows we check the length of `lock_path` and if it is longer than
255 characters we prepend the `\\?\` prefix to all paths if it does not
already exist.

We only need to check the length of `lock_path` because it is guaranteed
to be the longest path.

* Use extended path on Windows when downloading to local dir

Change the path of the local dir to an extended path by prepending
"\\?\" to the absolute path, when the absolute path is longer
than 255 characters on Windows.

Also fixed a small typo.

* Removed old path handling

* Reorder path check; add tests

* Skip test if opn Windows

The test now shows up a `skipped` if executed on a non-Windows machine

Co-authored-by: Lucain <lucainp@gmail.com>

* Fix indentation for test_local_folder.py

* Fix code style

---------

Co-authored-by: Lucain <lucain@huggingface.co>
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Co-authored-by: Lucain <lucainp@gmail.com>
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.

3 participants