Skip to content

Commit

Permalink
Change library name: Adapter-Transformers -> Adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
calpt committed Jan 25, 2024
1 parent de90a9e commit c3075ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit c3075ac

Please sign in to comment.