Huggingface-hub

Latest version: v0.26.2

Safety actively analyzes 682416 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 16

0.20.2

A concurrency issue when using `userdata.get` to retrieve `HF_TOKEN` token led to deadlocks when downloading files in parallel. This hot-fix release fixes this issue by using a global lock before trying to get the token from the secrets vault. More details in https://github.com/huggingface/huggingface_hub/pull/1953.

**Full Changelog**: https://github.com/huggingface/huggingface_hub/compare/v0.20.1...v0.20.2

0.20.1

This hot-fix release fixes a circular import error happening when import `login` or `logout` helpers from `huggingface_hub`.

Related PR: https://github.com/huggingface/huggingface_hub/pull/1930

**Full Changelog**: https://github.com/huggingface/huggingface_hub/compare/v0.20.0...v0.20.1

0.20.0

(Discuss about the release [in our Community Tab](https://huggingface.co/spaces/Wauplin/huggingface_hub/discussions/3). Feedback welcome!! 🤗)

🔐 Authentication

Authentication has been greatly improved in **Google Colab**. The best way to authenticate in a Colab notebook is to define a `HF_TOKEN` secret in your personal secrets. When a notebook tries to reach the Hub, a pop-up will ask you if you want to share the `HF_TOKEN` secret with this notebook -as an opt-in mechanism. This way, no need to call `huggingface_hub.login` and copy-paste your token anymore! 🔥🔥🔥

In addition to the Google Colab integration, the login guide has been revisited to focus on security. It is recommended to authenticate either using `huggingface_hub.login` or the `HF_TOKEN` environment variable, rather than passing a hardcoded token in your scripts. Check out the new guide [here](https://huggingface.co/docs/huggingface_hub/quick-start#login).

* Login/authentication enhancements by Wauplin in 1895
* Catch `SecretNotFoundError` in google colab login by Wauplin in 1912

🏎️ Faster `HfFileSystem`

`HfFileSystem` is a pythonic [fsspec](https://filesystem-spec.readthedocs.io/en/latest/)-compatible file interface to the Hugging Face Hub. Implementation has been greatly improved to optimize `fs.find` performances.

Here is a quick benchmark with the [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup) dataset:

0.19.4

On Python3.8, it is fairly easy to get a corrupted install of pydantic (more specificially, pydantic 2.x cannot run if tensorflow is installed because of an incompatible requirement on `typing_extensions`). Since `pydantic` is an optional dependency of `huggingface_hub`, we do not want to crash at `huggingface_hub` import time if pydantic install is corrupted. However this was the case because of how imports are made in `huggingface_hub`. This hot-fix releases fixes this bug. If pydantic is not correctly installed, we only raise a warning and continue as if it was not installed at all.

Related PR: https://github.com/huggingface/huggingface_hub/pull/1829

**Full Changelog**: https://github.com/huggingface/huggingface_hub/compare/v0.19.3...v0.19.4

0.19.3

Hot-fix release after https://github.com/huggingface/huggingface_hub/pull/1828.

In `0.19.0` we've loosen pydantic requirements to accept both 1.x and 2.x since `huggingface_hub` is compatible with both. However, it started to cause issues when installing both `huggingface_hub[inference]` and `tensorflow` in a Python3.8 environment. The problem comes from the fact that on Python3.8, Pydantic>=2.x and tensorflow don't seem to be compatible. Tensorflow depends on
`typing_extension<=4.5.0` while pydantic 2.x requires `typing_extensions>=4.6`. This causes a `ImportError: cannot import name 'TypeAliasType' from 'typing_extensions'.` when importing huggingface_hub.

As a side note, tensorflow support for Python3.8 [has been dropped since 2.14.0](https://github.com/tensorflow/tensorflow/releases/tag/v2.14.0). Therefore this issue should affect less and less users over time.

**Full Changelog**: https://github.com/huggingface/huggingface_hub/compare/v0.19.2...v0.19.3

0.19.2

Not a hot-fix.

In https://github.com/huggingface/huggingface_hub/pull/1786 (already release in `0.19.0`), we harmonized the environment variables in the HF ecosystem with the goal to propagate this harmonization to other HF libraries. In this work, we forgot to expose `HF_HOME` as a constant value that can be reused, especially by `transformers` or `datasets`. This release fixes this (see https://github.com/huggingface/huggingface_hub/pull/1825).

**Full Changelog**: https://github.com/huggingface/huggingface_hub/compare/v0.19.1...v0.19.2

Page 6 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.