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

Add list_adapters() to search for adapters #193

Merged
merged 6 commits into from
Jul 6, 2021

Conversation

calpt
Copy link
Member

@calpt calpt commented Jun 22, 2021

This PR includes two changes:

In theory, something like this should now be possible to load any adapter from any source:

from transformers import AutoModelWithHeads, list_adapters

adapter_infos = list_adapters(source="ah")  # "ah", "hf" or None (for both)

model = AutoModelWithHeads.from_pretrained(adapter_infos[0].model_name)
model.load_adapter(adapter_infos[0].adapter_id, source=adapter_infos[0].source)

Using huggingface_hub changes from huggingface/huggingface_hub#152.

cc @Aaronsom

@calpt calpt marked this pull request as ready for review July 2, 2021 10:18
@calpt calpt requested a review from hSterz July 2, 2021 10:18
@calpt calpt changed the title Add list_available_adapters() to search for adapters Add list_adapters() to search for adapters Jul 5, 2021
Copy link
Member

@hSterz hSterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@calpt calpt merged commit 4117402 into adapter-hub:develop Jul 6, 2021
@calpt calpt deleted the dev/adapter_list branch July 6, 2021 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants