Skip to content
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
8 changes: 8 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,14 @@ export const keras_hub = (model: ModelData): string[] => {
return snippets;
};

export const kernels = (model: ModelData): string[] => [
`# !pip install kernels
from kernels import get_kernel
kernel = get_kernel("${model.id}")`,
];

export const kimi_audio = (model: ModelData): string[] => [
`# Example usage for KimiAudio
# pip install git+https://github.com/MoonshotAI/Kimi-Audio.git
Expand Down
8 changes: 8 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
snippets: snippets.keras_hub,
filter: true,
},
kernels: {
Copy link
Contributor

Choose a reason for hiding this comment

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

For this to work you'll have to tag repos with kernels instead of kernel in the model cards. At the moment:

prettyLabel: "Kernels",
repoName: "Kernels",
repoUrl: "https://github.com/huggingface/kernels",
docsUrl: "https://huggingface.co/docs/kernels",
snippets: snippets.kernels,
countDownloads: `path_filename:"_ops" AND path_extension:"py"`,
},
"kimi-audio": {
prettyLabel: "KimiAudio",
repoName: "KimiAudio",
Expand Down
Loading