Skip to content

Commit cc24443

Browse files
authored
Add Zero-shot-image-classification and image-classification. (#1545)
1 parent 0e2b369 commit cc24443

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,15 @@ export const transformers = (model: ModelData): string[] => {
12801280
pipelineSnippet.push("messages = [", ' {"role": "user", "content": "Who are you?"},', "]");
12811281
pipelineSnippet.push("pipe(messages)");
12821282
}
1283+
} else if (model.pipeline_tag === "zero-shot-image-classification") {
1284+
pipelineSnippet.push(
1285+
"pipe(",
1286+
' "https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png",',
1287+
' candidate_labels=["animals", "humans", "landscape"],',
1288+
")"
1289+
);
1290+
} else if (model.pipeline_tag === "image-classification") {
1291+
pipelineSnippet.push('pipe("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")');
12831292
}
12841293

12851294
return [pipelineSnippet.join("\n"), autoSnippet];

0 commit comments

Comments
 (0)