Skip to content

Commit

Permalink
add cp/ edge to supported libs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavs10 committed Aug 24, 2024
1 parent 207340f commit 055f065
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ export const diffusers = (model: ModelData): string[] => {
}
};

export const edge = (model: ModelData): string[] => [
`# pip install --no-binary :all: cartesia-pytorch
from cartesia_pytorch import ReneLMHeadModel
from transformers import AutoTokenizer
model = ReneLMHeadModel.from_pretrained("${model.id}").half().cuda()
tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-1B-hf")
in_message = ["Rene Descartes was"]
inputs = tokenizer(in_message, return_tensors="pt")
outputs = model.generate(inputs.input_ids.cuda(), max_length=50, top_k=100, top_p=0.99)
out_message = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
print(out_message)
)`,
];

export const edsnlp = (model: ModelData): string[] => {
const packageName = nameWithoutNamespace(model.id).replaceAll("-", "_");
return [
Expand Down
8 changes: 7 additions & 1 deletion packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
snippets: snippets.bm25s,
filter: false,
countDownloads: `path:"params.index.json"`,
},
},
champ: {
prettyLabel: "Champ",
repoName: "Champ",
Expand Down Expand Up @@ -179,6 +179,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
repoName: "doctr",
repoUrl: "https://github.com/mindee/doctr",
},
edge: {
prettyLabel: "Edge",
repoName: "Edge",
repoUrl: "https://github.com/cartesia-ai/edge",
snippets: snippets.edge,
},
edsnlp: {
prettyLabel: "EDS-NLP",
repoName: "edsnlp",
Expand Down

0 comments on commit 055f065

Please sign in to comment.