huggingface / huggingface_hub

The official Python client for the Huggingface Hub.
https://huggingface.co/docs/huggingface_hub
Apache License 2.0
2.02k stars 531 forks source link

Use extended path on Windows when downloading to local dir #2378

Closed mlinke-ai closed 2 months ago

mlinke-ai commented 3 months ago

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.

This addresses Issue #2374.

Also fixed a small typo.

HuggingFaceDocBuilderDev commented 2 months ago

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.

mlinke-ai commented 2 months ago

No problem.

Please excuse the back and forth; this is actually my first PR.

Wauplin commented 2 months ago

No problem at all! Going back and forth is the essence of open-source collaboration :) Glad to know your first PR is on huggingface_hub's repo :hugs:

Wauplin commented 2 months ago

Failing tests are unrelated to this PR so it's good to merge! :rocket: