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

Documentation Revamp #156

Merged
merged 41 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
410e4a9
Docs Revamp: new "Main" page for hub-docs (#88)
NimaBoscarino Apr 6, 2022
bd3f950
Docs Revamp: new "Repositories" page for hub-docs (#92)
NimaBoscarino Apr 18, 2022
b8c3d76
Docs Revamp: new "Main" page for hub-docs (#88)
NimaBoscarino Apr 6, 2022
f0ad663
Docs Revamp: Models documentation (#117)
NimaBoscarino May 11, 2022
60c3d39
Docs Revamp: Spaces documentation (#144)
NimaBoscarino May 14, 2022
337642a
Docs Revamp: Datasets docs (#146)
NimaBoscarino May 18, 2022
5ce8393
Docs Revamp: Organizations and Security (#150)
NimaBoscarino May 20, 2022
aae4d12
Split webhook into its own page
NimaBoscarino May 20, 2022
0e17520
Modify for doc-builder (#145)
mishig25 May 24, 2022
3283cf0
[Spaces] Changelog update (#152)
cbensimon May 24, 2022
5aee683
Fix some links, address Omar-notes.
NimaBoscarino May 25, 2022
60fbe46
Split some Spaces pages, fix images
NimaBoscarino May 25, 2022
7fa007e
More polishing and page-splitting
NimaBoscarino May 25, 2022
85522a3
Move some model pages to 'advanced'
NimaBoscarino May 25, 2022
1974e1d
Note regarding dataset preview
NimaBoscarino May 25, 2022
ff5b704
Update _toctree.yml
NimaBoscarino May 25, 2022
36be2c4
Some initial doc about pull-requests and discussions (#143)
julien-c May 25, 2022
df8948d
Fix toctree
mishig25 May 25, 2022
127a51c
Fix pr headings
mishig25 May 25, 2022
d392d7c
Add pr to reposutors card
mishig25 May 25, 2022
422f7a8
Fix spacing issue
mishig25 May 25, 2022
36c91d3
Fix broken pr link
mishig25 May 25, 2022
7e83fae
Fix imgs
mishig25 May 25, 2022
c355deb
PR sections use imgs correctly
mishig25 May 25, 2022
1f9dfe6
Better img sizes
mishig25 May 25, 2022
7df2ebb
Better imgs sizing
mishig25 May 25, 2022
7d7d314
Better img sizing
mishig25 May 25, 2022
788680f
Rename without -main
osanseviero May 25, 2022
9ac1527
Fix renamess
osanseviero May 25, 2022
be20e55
Fix `-main` references
mishig25 May 25, 2022
94e65ad
Minor edits in getting started
osanseviero May 25, 2022
a5f6526
Fix broken link
osanseviero May 25, 2022
5566430
Apply suggestions from code review
NimaBoscarino May 25, 2022
bfb234f
Split models FAQ to its own page
NimaBoscarino May 25, 2022
31d7778
Add BigScience BLOOM RAIL 1.0 to licenses (#155)
julien-c May 28, 2022
ea06bad
Apply suggestions from code review
NimaBoscarino May 28, 2022
0f1dd65
Minor adjustments to phrasing and formatting
NimaBoscarino May 28, 2022
10b59b6
Gif images have darkmodes too
mishig25 May 30, 2022
ec429ae
Add docs for library integrations (#118)
osanseviero May 31, 2022
3ad0bba
High level pass for new docs (#163)
osanseviero Jun 1, 2022
62e8a48
Split models-interacting into two pages
NimaBoscarino Jun 1, 2022
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
20 changes: 20 additions & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build documentation

on:
push:
paths:
- "docs/hub/**"
branches:
- main

jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
with:
commit_sha: ${{ github.sha }}
package: hub-docs
package_name: hub
path_to_docs: hub-docs/docs/hub/
additional_args: --not_python_module
secrets:
token: ${{ secrets.HUGGINGFACE_PUSH }}
19 changes: 19 additions & 0 deletions .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build PR Documentation

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
with:
commit_sha: ${{ github.event.pull_request.head.sha }}
pr_number: ${{ github.event.number }}
package: hub-docs
package_name: hub
path_to_docs: hub-docs/docs/hub/
additional_args: --not_python_module
13 changes: 13 additions & 0 deletions .github/workflows/delete_doc_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Delete dev documentation

on:
pull_request:
types: [ closed ]


jobs:
delete:
uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main
with:
pr_number: ${{ github.event.number }}
package: hub-docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
.vscode/
.idea/

.DS_Store
Binary file removed docs/assets/asteroid_repo.png
Binary file not shown.
Binary file removed docs/assets/asteroid_snippet.png
Binary file not shown.
Binary file removed docs/assets/hub/access-tokens.png
Binary file not shown.
Binary file removed docs/assets/hub/add-file.png
Binary file not shown.
Binary file removed docs/assets/hub/cli-login.png
Binary file not shown.
Binary file removed docs/assets/hub/code_snippet.png
Binary file not shown.
Binary file removed docs/assets/hub/commit-file.png
Binary file not shown.
Binary file removed docs/assets/hub/delete-token.png
Binary file not shown.
Binary file removed docs/assets/hub/eicar-hub-file-view.png
Binary file not shown.
Binary file removed docs/assets/hub/eicar-hub-tree-view.png
Binary file not shown.
Binary file removed docs/assets/hub/empty_repo.png
Binary file not shown.
Binary file removed docs/assets/hub/eval-results.jpg
Binary file not shown.
Binary file removed docs/assets/hub/explore_history.gif
Binary file not shown.
Binary file removed docs/assets/hub/files.png
Binary file not shown.
Binary file removed docs/assets/hub/hub_filters.png
Binary file not shown.
46 changes: 0 additions & 46 deletions docs/assets/hub/icon-space.svg

This file was deleted.

Binary file removed docs/assets/hub/inference_api_snippet.png
Binary file not shown.
Binary file removed docs/assets/hub/libraries-tags.png
Binary file not shown.
Binary file removed docs/assets/hub/new-space.gif
Binary file not shown.
Binary file removed docs/assets/hub/new-token.png
Binary file not shown.
Binary file removed docs/assets/hub/new_repo.png
Binary file not shown.
Binary file removed docs/assets/hub/notebook_login.png
Binary file not shown.
Binary file removed docs/assets/hub/org-card.png
Binary file not shown.
Binary file removed docs/assets/hub/org-members-page.png
Binary file not shown.
Binary file removed docs/assets/hub/repo.png
Binary file not shown.
Binary file removed docs/assets/hub/repo_readme.png
Diff not rendered.
Binary file removed docs/assets/hub/repo_with_files.png
Diff not rendered.
Binary file removed docs/assets/hub/search_glue.gif
Diff not rendered.
Binary file removed docs/assets/hub/search_text_classification.gif
Diff not rendered.
Binary file removed docs/assets/hub/secrets.png
Diff not rendered.
Binary file removed docs/assets/hub/spaces-landing.png
Diff not rendered.
Binary file removed docs/assets/hub/tasks.png
Diff not rendered.
Binary file removed docs/assets/hub/tensorboard.png
Diff not rendered.
Binary file removed docs/assets/hub/widget_input_examples.gif
Diff not rendered.
44 changes: 0 additions & 44 deletions docs/hub/_sections.yml

This file was deleted.

138 changes: 138 additions & 0 deletions docs/hub/_toctree.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
- local: index
title: 🤗 Hugging Face Hub
- local: repositories
title: Repositories
sections:
- local: repositories-getting-started
title: Getting Started with Repositories
- local: repositories-settings
title: Repository Settings
- local: repositories-pull-requests-discussions
title: Pull Requests & Discussions
- local: repositories-next-steps
title: Next Steps
- local: repositories-licenses
title: Licenses
- title: Models
local: models
sections:
- local: models-the-hub
title: The Model Hub
- local: models-cards
title: Model Cards
sections:
- local: models-cards-co2
title: Carbon Emissions
- local: models-libraries
title: Libraries
sections:
- local: spacy
title: SpaCy
- local: transformers
title: transformers
- local: adapter-transformers
title: adapter-transformers
- local: allennlp
title: AllenNLP
- local: asteroid
title: Asteroid
- local: espnet
title: ESPnet
- local: fastai
title: FastAI
- local: keras
title: Keras
- local: sentence-transformers
title: Sentence Transformers
- local: stanza
title: Stanza
- local: speechbrain
title: SpeechBrain
- local: tensorboard
title: TensorBoard
- local: models-uploading
title: Uploading Models
- local: models-downloading
title: Downloading Models
- local: models-widgets
title: Model Widgets
- local: models-inference
title: Inference API docs
- local: models-faq
title: Frequently Asked Questions
- local: models-advanced
title: Advanced Topics
sections:
- local: models-adding-libraries
title: Integrate a library with the Hub
- local: models-tasks
title: Tasks
- title: Datasets
local: datasets
sections:
- local: datasets-overview
title: Datasets Overview
- local: datasets-cards
title: Dataset Cards
- local: datasets-gated
title: Gated Datasets
- local: datasets-usage
title: Using Datasets
- local: datasets-adding
title: Adding New Datasets
- local: spaces
title: Spaces
sections:
- local: spaces-overview
title: Spaces Overview
sections:
- local: spaces-dependencies
title: Handling Spaces Dependencies
- local: spaces-settings
title: Spaces Settings
- local: spaces-using-opencv
title: Using OpenCV in Spaces
- local: spaces-organization-cards
title: Using Spaces for Organization Cards
- local: spaces-more-ways-to-create
title: More ways to create Spaces
- local: spaces-github-actions
title: Managing Spaces with Github Actions
- local: spaces-sdks-gradio
title: Gradio Spaces
- local: spaces-sdks-streamlit
title: Streamlit Spaces
- local: spaces-sdks-static
title: Static HTML Spaces
- local: spaces-sdks-python
title: Custom Python Spaces
- local: spaces-config-reference
title: Spaces Configuration Reference
- local: spaces-changelog
title: Spaces Changelog
- local: other
title: Other
sections:
- local: organizations
title: Organizations
sections:
- local: organizations-managing
title: Managing Organizations
- local: organizations-cards
title: Organization Cards
- local: organizations-security
title: Access control in organizations
- local: security
title: Security
sections:
- local: security-tokens
title: User Access Tokens
- local: security-gpg
title: Signing commits with GPG
- local: security-malware
title: Malware Scanning
- local: api
title: Hub API Endpoints
sections:
- local: api-webhook
title: Webhook
67 changes: 67 additions & 0 deletions docs/hub/adapter-transformers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Using Adapter Transformers at Hugging Face

`adapter-transformers` is a library that extends 🤗 `transformers` by allowing to integrate, train and use Adapters and other efficient fine-tuning methods. The library is fully compatible with 🤗 `transformers`. Adapters are small learnt layers inserted within each layer of a pre-trained model. You can learn more about this in the [original paper](https://arxiv.org/abs/2007.07779).

## Exploring adapter-transformers in the Hub

You can find over a hundred `adapter-transformer` models by filtering at the left of the [models page](https://huggingface.co/models?library=adapter-transformers&sort=download). Some adapter models can be found in the Adapter Hub [repository](https://github.com/adapter-hub/hub). Models from both sources are then aggregated in the [AdapterHub](https://adapterhub.ml/explore/).


## Using existing models

For a full guide on loading pre-trained adapters, we recommend checking out the [official guide](https://docs.adapterhub.ml/loading.html).

As a brief summary, once you load a model with the usual `*Model` classes from 🤗`transformers`, you can use the `load_adapter` method to load and activate the Adapter (remember `adapter-transformers` extends 🤗`transformers`.).

```py
from transformers import AutoModelWithHeads

model = AutoModelWithHeads.from_pretrained("bert-base-uncased")
adapter_name = model.load_adapter("AdapterHub/bert-base-uncased-pf-imdb", source="hf")
model.active_adapters = adapter_name
```

You can also use `list_adapters` to find all Adapter Models programmatically

```py
from transformers import list_adapters

# source can be "ah" (AdapterHub), "hf" (hf.co) or None (for both, default)
adapter_infos = list_adapters(source="hf", model_name="bert-base-uncased")
```

If you want to see how to load a specific model, you can click `Use in Adapter Transformers` and you will be given a working snippet that you can load it!

<div class="flex justify-center">
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-adapter_transformers_snippet1.png"/>
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-adapter_transformers-snippet1-dark.png"/>
</div>

<div class="flex justify-center">
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-adapter_transformers_snippet2.png"/>
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-adapter_transformers-snippet2-dark.png"/>
</div>

## Sharing your models

For a full guide on sharing models with `adapter-transformers`, we recommend checking out the [official guide](https://docs.adapterhub.ml/huggingface_hub.html#uploading-to-the-hub).

You can share your Adapter by using the `push_adapter_to_hub` method from a model that already contains an adapter.

```py
model.push_adapter_to_hub(
"my-awesome-adapter",
"awesome_adapter",
adapterhub_tag="sentiment/imdb",
datasets_tag="imdb"
)
```

This command creates a repository with an automatically generated model card and all necessary metadata.


## Additional resources

* Adapter Transformers [library]((https://github.com/adapter-hub/adapter-transformers).
* Adapter Transformers [docs](https://docs.adapterhub.ml/index.html).
* Integration with Hub [docs](https://docs.adapterhub.ml/huggingface_hub.html).
Loading