Huggingface-hub

Latest version: v0.23.0

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

Scan your dependencies

Page 3 of 13

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

0.19.1

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

Fixes a regression bug (PR https://github.com/huggingface/huggingface_hub/pull/1821) introduced in `0.19.0` that made looping over models with `list_models` fail. The problem came from the fact that we are now parsing the data returned by the server into Python objects. However for some models the metadata in the model card is not valid. This is usually checked by the server but some models created before we started to enforce correct metadata are not valid. This hot-fix fixes the issue by ignoring the corrupted data, if any.

Page 3 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.