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

Newer pre-commit #1987

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ Some notes:

<!--
Keep on adding more as you go 🔥
-->
-->
2 changes: 1 addition & 1 deletion .github/workflows/build_repocard_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
pip install --upgrade pip
pip install .
pip install Jinja2
pip install Jinja2

# Push cards
- name: Push cards
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/model_card_consistency_reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- [datasetcard.md](https://github.com/huggingface/hub-docs/blob/main/datasetcard.md) (`hub-docs` repo)
- [docs/hub/datasets-cards.md](https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-cards.md) (`hub-docs` repo)
token: ${{ secrets.comment_bot_token }}
body-include: '<!-- Created by actions-cool/maintain-one-comment -->'
body-include: '<!-- Created by actions-cool/maintain-one-comment -->'
2 changes: 1 addition & 1 deletion .github/workflows/upload_pr_documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
package_name: huggingface_hub
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ dmypy.json
.ruff_cache

# Spell checker config
cspell.json
cspell.json
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.5.0
hooks:
- id: check-yaml
exclude: .github/conda/meta.yaml
exclude: .github/conda/meta.yaml|tests/cassettes/
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict
- repo: https://github.com/charliermarsh/ruff-pre-commit # https://github.com/charliermarsh/ruff#usage
rev: 'v0.1.3'
rev: v0.1.13
hooks:
- id: ruff
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<p>
<b>English</b> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_de.md">Deutsch</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_ko.md">한국어</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<p>
</h4>
---
Expand Down
2 changes: 1 addition & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<p>
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README.md">English</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_de.md">Deutsch</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_ko.md">한국어</a> |
<b>中文(简体)</b>
<p>
Expand Down
2 changes: 1 addition & 1 deletion README_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<b>Deutsch</b> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_ko.md">한국인</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<p>
</h4>
---
Expand Down
2 changes: 1 addition & 1 deletion README_hi.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_de.md">Deutsch</a> |
<b>हिंदी</b> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_ko.md">한국어</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<p>
</h4>

Expand Down
2 changes: 1 addition & 1 deletion README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_de.md">Deutsch</a> |
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
<b>한국어</b>|
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
<p>
</h4>

Expand Down
2 changes: 1 addition & 1 deletion contrib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Tests must be ran individually for each dependent library. Here is an example to
Before running tests, a virtual env must be setup for each contrib library. To do so, run:

```sh
# Run setup in parallel to save time
# Run setup in parallel to save time
make contrib_setup -j4
```

Expand Down
2 changes: 1 addition & 1 deletion contrib/sentence_transformers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git+https://github.com/UKPLab/sentence-transformers.git#egg=sentence-transformers
git+https://github.com/UKPLab/sentence-transformers.git#egg=sentence-transformers
2 changes: 1 addition & 1 deletion contrib/spacy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git+https://github.com/explosion/spacy-huggingface-hub.git#egg=spacy-huggingface-hub
git+https://github.com/explosion/spacy-huggingface-hub.git#egg=spacy-huggingface-hub
2 changes: 1 addition & 1 deletion contrib/timm/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Timm
git+https://github.com/rwightman/pytorch-image-models.git#egg=timm
safetensors
safetensors
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ check how they look before committing for instance). You don't have to commit th

## Building the documentation

Once you have setup the `doc-builder` and additional packages with the pip install command above,
Once you have setup the `doc-builder` and additional packages with the pip install command above,
you can generate the documentation by typing the following command:

```bash
Expand Down Expand Up @@ -116,7 +116,7 @@ although we can write them directly in Markdown.

Adding a new tutorial or section is done in two steps:

- Add a new Markdown (.md) file under `./source`.
- Add a new Markdown (.md) file under `./source`.
- Link that file in `./source/_toctree.yml` on the correct toc-tree.

Make sure to put your new file under the proper section. If you have a doubt, feel free to ask in a Github Issue or PR.
Expand All @@ -131,7 +131,7 @@ Values that should be put in `code` should either be surrounded by backticks: \`
and objects like True, None, or any strings should usually be put in `code`.

When mentioning a class, function, or method, it is recommended to use our syntax for internal links so that our tool
adds a link to its documentation with this syntax: \[\`XXXClass\`\] or \[\`function\`\]. This requires the class or
adds a link to its documentation with this syntax: \[\`XXXClass\`\] or \[\`function\`\]. This requires the class or
function to be in the main package.

If you want to create a link to some internal class or function, you need to
Expand Down Expand Up @@ -266,9 +266,9 @@ The syntax for Example docstrings can look as follows:
```
```

The docstring should give a minimal, clear example of how the respective model
The docstring should give a minimal, clear example of how the respective model
is to be used in inference and also include the expected (ideally sensible)
output.
Often, readers will try out the example before even going through the function
or class definitions. Therefore, it is of utmost importance that the example
works as expected.
Often, readers will try out the example before even going through the function
or class definitions. Therefore, it is of utmost importance that the example
works as expected.
4 changes: 2 additions & 2 deletions docs/TRANSLATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Here, `LANG-ID` should be one of the ISO 639-1 or ISO 639-2 language codes -- se

The fun part comes - translating the text!

The first thing we recommend is translating the part of the `_toctree.yml` file that corresponds to your doc chapter. This file is used to render the table of contents on the website.
The first thing we recommend is translating the part of the `_toctree.yml` file that corresponds to your doc chapter. This file is used to render the table of contents on the website.

> 🙋 If the `_toctree.yml` file doesn't yet exist for your language, you can create one by copy-pasting from the English version and deleting the sections unrelated to your chapter. Just make sure it exists in the `docs/source/LANG-ID/` directory!

Expand All @@ -54,4 +54,4 @@ The fields you should add are `local` (with the name of the file containing the

Once you have translated the `_toctree.yml` file, you can start translating the Markdown files associated with your docs chapter.

> 🙋 If you'd like others to help you with the translation, you should [open an issue](https://github.com/huggingface/huggingface_hub/issues) and tag @Wauplin.
> 🙋 If you'd like others to help you with the translation, you should [open an issue](https://github.com/huggingface/huggingface_hub/issues) and tag @Wauplin.
8 changes: 4 additions & 4 deletions docs/source/cn/_toctree.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
- title: "Starten"
- title: "Starten"
sections:
- local: index
title: 索引
- local: quick-start
title: 快速入门指南
- local: installation
title: 安装
- title: "guides"
- title: "guides"
sections:
- local: guides/repository
title: 储存库
- title: "concepts"
- title: "concepts"
sections:
- local: concepts/git_vs_http
title: Git vs HTTP 范式
title: Git vs HTTP 范式
2 changes: 1 addition & 1 deletion docs/source/cn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rendered properly in your Markdown viewer.

通过 `huggingface_hub`库,您可以与面向机器学习开发者和协作者的平台 [Hugging Face Hub](https://huggingface.co/)进行交互,找到适用于您所在项目的预训练模型和数据集,体验在平台托管的数百个机器学习应用,还可以创建或分享自己的模型和数据集并于社区共享。以上所有都可以用Python在 `huggingface_hub`库中轻松实现。

<!--
<!--
<a class="!no-underline border dark:border-gray-700 p-5 rounded-lg shadow hover:shadow-lg" href="./tutorials/overview"
><div class="w-full text-center bg-gradient-to-br from-blue-400 to-blue-500 rounded-lg py-1.5 font-semibold mb-5 text-white text-lg leading-relaxed">Tutorials</div>
<p class="text-gray-700">Learn the basics and become familiar with using huggingface_hub to programmatically interact with the 🤗 Hub!</p>
Expand Down
20 changes: 10 additions & 10 deletions docs/source/cn/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,42 @@ huggingface_hub 在 Python 3.8 或更高版本上进行了测试,可以保证
首先在你的项目目录中创建一个虚拟环境,请运行以下代码:

```bash
python -m venv .env
python -m venv .env
```

在Linux和macOS上,请运行以下代码激活虚拟环境:

```bash
source .env/bin/activate
source .env/bin/activate
```

在 Windows 上,请运行以下代码激活虚拟环境:

```bash
.env/Scripts/activate
.env/Scripts/activate
```

现在您可以从[PyPi注册表](https://pypi.org/project/huggingface-hub/)安装 `huggingface_hub`:

```bash
pip install --upgrade huggingface_hub
pip install --upgrade huggingface_hub
```

完成后,[检查安装](#check-installation)是否正常工作

### 安装可选依赖项

`huggingface_hub`的某些依赖项是 [可选](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies) 的,因为它们不是运行`huggingface_hub`的核心功能所必需的.但是,如果没有安装可选依赖项, `huggingface_hub` 的某些功能可能会无法使用
`huggingface_hub`的某些依赖项是 [可选](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies) 的,因为它们不是运行`huggingface_hub`的核心功能所必需的.但是,如果没有安装可选依赖项, `huggingface_hub` 的某些功能可能会无法使用

您可以通过`pip`安装可选依赖项,请运行以下代码:

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

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

这里列出了 `huggingface_hub` 的可选依赖项:
Expand Down Expand Up @@ -93,7 +93,7 @@ pip install git+https://github.com/huggingface/huggingface_hub@my-feature-branch
git clone https://github.com/huggingface/huggingface_hub.git

# 然后,使用以下命令启动虚拟环境
cd huggingface_hub
cd huggingface_hub
pip install -e .
```

Expand All @@ -115,7 +115,7 @@ conda install -c conda-forge huggingface_hub
安装完成后,通过运行以下命令检查`huggingface_hub`是否正常工作:

```bash
python -c "from huggingface_hub import model_info; print(model_info('gpt2'))"
python -c "from huggingface_hub import model_info; print(model_info('gpt2'))"
```

这个命令将从 Hub 获取有关 [gpt2](https://huggingface.co/gpt2) 模型的信息。
Expand All @@ -139,4 +139,4 @@ Task: text-generation 任务:文本生成

## 后记

一旦您在机器上正确安装了`huggingface_hub`,您可能需要[配置环境变量](package_reference/environment_variables)或者[查看我们的指南之一](guides/overview)以开始使用。
一旦您在机器上正确安装了`huggingface_hub`,您可能需要[配置环境变量](package_reference/environment_variables)或者[查看我们的指南之一](guides/overview)以开始使用。
Loading
Loading