Skip to content

Commit

Permalink
Minor update in hub integration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
calpt committed Jun 29, 2024
1 parent 5a2c697 commit ac74998
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/huggingface_hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@ This document describes how to interact with the Model Hub when working with ada

## Downloading from the Hub

The Hugging Face Model Hub already provides a few pre-trained adapters available for download.
To search for available adapters, use the _Adapter Transformers_ library filter on the Model Hub website or use this link: [https://huggingface.co/models?filter=adapters](https://huggingface.co/models?filter=adapters).
The Hugging Face Model Hub already provides hundreds of pre-trained adapters available for download.
To search for available adapters, use the _Adapters_ library filter on the Model Hub website or use this link: [https://huggingface.co/models?library=adapter-transformers](https://huggingface.co/models?library=adapter-transformers).
Alternatively, all adapters on the Hugging Face Model Hub are also listed on [https://adapterhub.ml/explore](https://adapterhub.ml/explore) together with all adapters directly uploaded to AdapterHub.

After you have found an adapter you would like to use, loading it into a Transformer model is very similar to [loading adapters from AdapterHub](loading.md).
After you have found an adapter you would like to use, loading it into a Transformer model is easy.
For example, for loading and activating the adapter [`AdapterHub/roberta-base-pf-sick`](https://huggingface.co/AdapterHub/roberta-base-pf-sick), write:
```python
from adapters import AutoAdapterModel

model = AutoAdapterModel.from_pretrained("roberta-base")
adapter_name = model.load_adapter("AdapterHub/roberta-base-pf-sick", source="hf")
adapter_name = model.load_adapter("AdapterHub/roberta-base-pf-sick")
model.active_adapters = adapter_name
```
Note that `source="hf"` is the only change from loading an adapter from AdapterHub.

## Uploading to the Hub

Expand All @@ -34,9 +33,9 @@ In the following, we'll go through the fastest way of uploading an adapter direc
For more options and information, e.g. for managing models via the CLI and Git, refer to [HugginFace's documentation](https://huggingface.co/transformers/model_sharing.html).

1. **Prepare access credentials**: Before being able to push to the Hugging Face Model Hub for the first time, we have to store our access token in the cache.
This can be done via the `transformers-cli` by running:
This can be done via the `huggingface-cli` by running:
```
transformers-cli login
huggingface-cli login
```
2. **Push an adapter**: Next, we can proceed to upload our first adapter.
Expand Down

0 comments on commit ac74998

Please sign in to comment.