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

♻️ Change library name: Adapter-Transformers -> Adapters #459

Merged
merged 1 commit into from
Feb 1, 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
18 changes: 9 additions & 9 deletions packages/tasks/src/library-ui-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ function nameWithoutNamespace(modelId: string): string {

//#region snippets

const adapter_transformers = (model: ModelData) => [
`from transformers import ${model.config?.adapter_transformers?.model_class}
const adapters = (model: ModelData) => [
`from adapters import AutoAdapterModel

model = ${model.config?.adapter_transformers?.model_class}.from_pretrained("${model.config?.adapter_transformers?.model_name}")
model.load_adapter("${model.id}", source="hf")`,
model = AutoAdapterModel.from_pretrained("${model.config?.adapter_transformers?.model_name}")
model.load_adapter("${model.id}", set_active=True)`,
];

const allennlpUnknown = (model: ModelData) => [
Expand Down Expand Up @@ -576,11 +576,11 @@ model = AutoModel.load_from_hf_hub("${model.id}")`,

export const MODEL_LIBRARIES_UI_ELEMENTS: Partial<Record<ModelLibraryKey, LibraryUiElement>> = {
"adapter-transformers": {
btnLabel: "Adapter Transformers",
repoName: "adapter-transformers",
repoUrl: "https://github.com/Adapter-Hub/adapter-transformers",
docsUrl: "https://huggingface.co/docs/hub/adapter-transformers",
snippets: adapter_transformers,
btnLabel: "Adapters",
repoName: "adapters",
repoUrl: "https://github.com/Adapter-Hub/adapters",
docsUrl: "https://huggingface.co/docs/hub/adapters",
snippets: adapters,
},
allennlp: {
btnLabel: "AllenNLP",
Expand Down
2 changes: 1 addition & 1 deletion packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* File formats live in an enum inside the internal codebase.
*/
export enum ModelLibrary {
"adapter-transformers" = "Adapter Transformers",
"adapter-transformers" = "Adapters",
"allennlp" = "allenNLP",
"asteroid" = "Asteroid",
"bertopic" = "BERTopic",
Expand Down
Loading