Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d40e4ac
[1.0] Httpx migration (#3328)
Wauplin Sep 10, 2025
63278df
Bump minimal version to Python3.9 (#3343)
Wauplin Sep 10, 2025
7213f97
Remove `HfFolder` and `InferenceAPI` classes (#3344)
Wauplin Sep 11, 2025
966df29
[v1.0] Remove more deprecated stuff (#3345)
Wauplin Sep 11, 2025
72c53f4
[v1.0] Remove `Repository` class (#3346)
Wauplin Sep 12, 2025
e56ba6e
bump to 1.0.0.dev0
Wauplin Sep 12, 2025
ccca22e
Remove _deprecate_positional_args on login methods (#3349)
Wauplin Sep 12, 2025
98aa8ba
Merge branch 'main' into v1.0-release
Wauplin Sep 12, 2025
b679858
[v1.0] Remove imports kept only for backward compatibility (#3350)
Wauplin Sep 12, 2025
aef9df2
Merge branch 'v1.0-release' of github.com:huggingface/huggingface_hub…
Wauplin Sep 12, 2025
877955d
[v1.0] Remove keras2 utilities (#3352)
Wauplin Sep 12, 2025
9cb1955
[v1.0] Remove anything tensorflow-related + deps (#3354)
Wauplin Sep 12, 2025
84de3c5
Merge branch 'main' into v1.0-release
Wauplin Sep 12, 2025
3b562ca
Release: v1.0.0.rc0
Wauplin Sep 15, 2025
4a460be
[v1.0] Update "HTTP backend" docs + `git_vs_http` guide (#3357)
Wauplin Sep 17, 2025
16f3ad1
Refactor CLI implementation using Typer (#3372)
hanouticelina Sep 18, 2025
6d5e24a
add hf repo delete command
hanouticelina Sep 23, 2025
0b90a3f
add repo settings, repo move, repo branch commands
hanouticelina Sep 23, 2025
ebdf121
fix test
hanouticelina Sep 23, 2025
2cbafbb
Apply suggestions from code review
hanouticelina Sep 24, 2025
a716d47
Merge branch 'v1.0-release' of github.com:huggingface/huggingface_hub…
hanouticelina Sep 24, 2025
34e23af
Merge branch 'new-hf-commands' of github.com:huggingface/huggingface_…
hanouticelina Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirements:
- pip
- fsspec
- filelock
- requests
- httpx
- tqdm
- typing-extensions
- packaging
Expand All @@ -26,7 +26,7 @@ requirements:
- python
- pip
- filelock
- requests
- httpx
- tqdm
- typing-extensions
- packaging
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

# Install pip
- name: Install pip
Expand Down
50 changes: 10 additions & 40 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.13"]
test_name:
[
"Repository only",
"Everything else",
"Inference only",
"Xet only"
]
python-version: ["3.9", "3.13"]
test_name: ["Everything else", "Inference only", "Xet only"]
include:
- python-version: "3.13" # LFS not ran on 3.8
- python-version: "3.13" # LFS not ran on 3.9
test_name: "lfs"
- python-version: "3.8"
- python-version: "3.9"
test_name: "fastai"
- python-version: "3.10" # fastai not supported on 3.12 and 3.11 -> test it on 3.10
test_name: "fastai"
- python-version: "3.8"
test_name: "tensorflow"
- python-version: "3.10" # tensorflow not supported on 3.12 -> test it on 3.10
test_name: "tensorflow"
- python-version: "3.8" # test torch~=1.11 on python 3.8 only.
test_name: "Python 3.8, torch_1.11"
- python-version: "3.9" # test torch~=1.11 on python 3.9 only.
test_name: "Python 3.9, torch_1.11"
- python-version: "3.12" # test torch latest on python 3.12 only.
test_name: "torch_latest"
steps:
Expand All @@ -65,7 +55,7 @@ jobs:

case "${{ matrix.test_name }}" in

"Repository only" | "Everything else" | "Inference only")
"Everything else" | "Inference only")
sudo apt update
sudo apt install -y libsndfile1-dev
;;
Expand All @@ -84,17 +74,11 @@ jobs:
uv pip install --upgrade torch
;;

"Python 3.8, torch_1.11")
"Python 3.9, torch_1.11")
uv pip install "huggingface_hub[torch] @ ."
uv pip install torch~=1.11
;;

tensorflow)
sudo apt update
sudo apt install -y graphviz
uv pip install "huggingface_hub[tensorflow-testing] @ ."
;;

esac

# If not "Xet only", we want to test upload/download with regular LFS workflow
Expand All @@ -112,13 +96,6 @@ jobs:

case "${{ matrix.test_name }}" in

"Repository only")
# Run repo tests concurrently
PYTEST="$PYTEST ../tests -k 'TestRepository' -n 4"
echo $PYTEST
eval $PYTEST
;;

"Inference only")
# Run inference tests concurrently
PYTEST="$PYTEST ../tests -k 'test_inference' -n 4"
Expand All @@ -140,14 +117,7 @@ jobs:
eval "$PYTEST ../tests/test_fastai*"
;;

tensorflow)
# Cannot be on same line since '_tf*' checks if tensorflow is NOT imported by default
eval "$PYTEST ../tests/test_tf*"
eval "$PYTEST ../tests/test_keras*"
eval "$PYTEST ../tests/test_serialization.py"
;;

"Python 3.8, torch_1.11" | torch_latest)
"Python 3.9, torch_1.11" | torch_latest)
eval "$PYTEST ../tests/test_hub_mixin*"
eval "$PYTEST ../tests/test_serialization.py"
;;
Expand Down Expand Up @@ -178,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.9", "3.11"]
test_name: ["Everything else", "Xet only"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
auto-update-conda: true
auto-activate-base: false
python-version: 3.8
python-version: 3.9
activate-environment: "build-hub"

- name: Setup conda env
Expand Down
5 changes: 1 addition & 4 deletions docs/source/cn/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@
title: 概览
- local: guides/hf_file_system
title: Hugging Face 文件系统
- title: "concepts"
sections:
- local: concepts/git_vs_http
title: Git vs HTTP 范式

40 changes: 0 additions & 40 deletions docs/source/cn/concepts/git_vs_http.md

This file was deleted.

88 changes: 0 additions & 88 deletions docs/source/cn/guides/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,91 +156,3 @@ GitRefs(
>>> from huggingface_hub import move_repo
>>> move_repo(from_id="Wauplin/cool-model", to_id="huggingface/cool-model")
```

## 管理存储库的本地副本

上述所有操作都可以通过HTTP请求完成。然而,在某些情况下,您可能希望在本地拥有存储库的副本,并使用您熟悉的Git命令与之交互。

[`Repository`] 类允许您使用类似于Git命令的函数与Hub上的文件和存储库进行交互。它是对Git和Git-LFS方法的包装,以使用您已经了解和喜爱的Git命令。在开始之前,请确保已安装Git-LFS(请参阅[此处](https://git-lfs.github.com/)获取安装说明)。

### 使用本地存储库

使用本地存储库路径实例化一个 [`Repository`] 对象:

请运行以下代码:

```py
>>> from huggingface_hub import Repository
>>> repo = Repository(local_dir="<path>/<to>/<folder>")
```

### 克隆

`clone_from`参数将一个存储库从Hugging Face存储库ID克隆到由 `local_dir`参数指定的本地目录:

请运行以下代码:

```py
>>> from huggingface_hub import Repository
>>> repo = Repository(local_dir="w2v2", clone_from="facebook/wav2vec2-large-960h-lv60")
```
`clone_from`还可以使用URL克隆存储库:

请运行以下代码:

```py
>>> repo = Repository(local_dir="huggingface-hub", clone_from="https://huggingface.co/facebook/wav2vec2-large-960h-lv60")
```

你可以将`clone_from`参数与[`create_repo`]结合使用,以创建并克隆一个存储库:

请运行以下代码:

```py
>>> repo_url = create_repo(repo_id="repo_name")
>>> repo = Repository(local_dir="repo_local_path", clone_from=repo_url)
```

当你克隆一个存储库时,通过在克隆时指定`git_user`和`git_email`参数,你还可以为克隆的存储库配置Git用户名和电子邮件。当用户提交到该存储库时,Git将知道提交的作者是谁。

请运行以下代码:

```py
>>> repo = Repository(
... "my-dataset",
... clone_from="<user>/<dataset_id>",
... token=True,
... repo_type="dataset",
... git_user="MyName",
... git_email="me@cool.mail"
... )
```

### 分支

分支对于协作和实验而不影响当前文件和代码非常重要。使用[`~Repository.git_checkout`]来在不同的分支之间切换。例如,如果你想从 `branch1`切换到 `branch2`:

请运行以下代码:

```py
>>> from huggingface_hub import Repository
>>> repo = Repository(local_dir="huggingface-hub", clone_from="<user>/<dataset_id>", revision='branch1')
>>> repo.git_checkout("branch2")
```

### 拉取

[`~Repository.git_pull`] 允许你使用远程存储库的更改更新当前本地分支:

请运行以下代码:

```py
>>> from huggingface_hub import Repository
>>> repo.git_pull()
```

如果你希望本地的提交发生在你的分支被远程的新提交更新之后,请设置`rebase=True`:

```py
>>> repo.git_pull(rebase=True)
```
10 changes: 3 additions & 7 deletions docs/source/cn/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rendered properly in your Markdown viewer.

在开始之前,您需要通过安装适当的软件包来设置您的环境

huggingface_hub 在 Python 3.8 或更高版本上进行了测试,可以保证在这些版本上正常运行。如果您使用的是 Python 3.7 或更低版本,可能会出现兼容性问题
huggingface_hub 在 Python 3.9 或更高版本上进行了测试,可以保证在这些版本上正常运行。如果您使用的是 Python 3.7 或更低版本,可能会出现兼容性问题

## 使用 pip 安装

Expand Down Expand Up @@ -48,19 +48,15 @@ pip install --upgrade huggingface_hub
您可以通过`pip`安装可选依赖项,请运行以下代码:

```bash
# 安装 TensorFlow 特定功能的依赖项
# /!\ 注意:这不等同于 `pip install tensorflow`
pip install 'huggingface_hub[tensorflow]'

# 安装 TensorFlow 特定功能和 CLI 特定功能的依赖项
# 安装 Torch 特定功能和 CLI 特定功能的依赖项
pip install 'huggingface_hub[cli,torch]'
```

这里列出了 `huggingface_hub` 的可选依赖项:

- `cli`:为 `huggingface_hub` 提供更方便的命令行界面

- `fastai`,` torch`, `tensorflow`: 运行框架特定功能所需的依赖项
- `fastai`,` torch`: 运行框架特定功能所需的依赖项

- `dev`:用于为库做贡献的依赖项。包括 `testing`(用于运行测试)、`typing`(用于运行类型检查器)和 `quality`(用于运行 linter)

Expand Down
4 changes: 0 additions & 4 deletions docs/source/de/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@
title: Integrieren einer Bibliothek
- local: guides/webhooks_server
title: Webhooks server
- title: "Konzeptionelle Anleitungen"
sections:
- local: concepts/git_vs_http
title: Git vs. HTTP-Paradigma
69 changes: 0 additions & 69 deletions docs/source/de/concepts/git_vs_http.md

This file was deleted.

Loading
Loading