@huggingface/tasks
Advanced tools
Comparing version 0.12.20 to 0.12.21
@@ -85,3 +85,3 @@ import type { ModelData } from "./model-data"; | ||
mainTask: "text-generation"; | ||
displayOnModelPage: typeof isLlamaCppGgufModel; | ||
displayOnModelPage: (model: ModelData) => boolean; | ||
deeplink: (model: ModelData, filepath: string | undefined) => URL; | ||
@@ -88,0 +88,0 @@ }; |
@@ -9,2 +9,3 @@ import type { ModelData } from "./model-data"; | ||
export declare const depth_anything_v2: (model: ModelData) => string[]; | ||
export declare const depth_pro: (model: ModelData) => string[]; | ||
export declare const diffusers: (model: ModelData) => string[]; | ||
@@ -11,0 +12,0 @@ export declare const diffusionkit: (model: ModelData) => string[]; |
@@ -164,2 +164,10 @@ import type { ModelData } from "./model-data"; | ||
}; | ||
"depth-pro": { | ||
prettyLabel: string; | ||
repoName: string; | ||
repoUrl: string; | ||
countDownloads: string; | ||
snippets: (model: ModelData) => string[]; | ||
filter: false; | ||
}; | ||
diffree: { | ||
@@ -748,4 +756,4 @@ prettyLabel: string; | ||
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS; | ||
export declare const ALL_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "deepforest" | "depth-anything-v2" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-nlp" | "k2" | "liveportrait" | "llama-cpp-python" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "py-feat" | "pythae" | "recurrentgemma" | "relik" | "refiners" | "reverb" | "saelens" | "sam2" | "sample-factory" | "sapiens" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "diffusion-single-file" | "seed-story" | "soloaudio" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[]; | ||
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "deepforest" | "depth-anything-v2" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-nlp" | "k2" | "liveportrait" | "llama-cpp-python" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "py-feat" | "pythae" | "recurrentgemma" | "relik" | "refiners" | "reverb" | "saelens" | "sam2" | "sample-factory" | "sapiens" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "diffusion-single-file" | "seed-story" | "soloaudio" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[]; | ||
export declare const ALL_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "deepforest" | "depth-anything-v2" | "depth-pro" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-nlp" | "k2" | "liveportrait" | "llama-cpp-python" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "py-feat" | "pythae" | "recurrentgemma" | "relik" | "refiners" | "reverb" | "saelens" | "sam2" | "sample-factory" | "sapiens" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "diffusion-single-file" | "seed-story" | "soloaudio" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[]; | ||
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "deepforest" | "depth-anything-v2" | "depth-pro" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-nlp" | "k2" | "liveportrait" | "llama-cpp-python" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "py-feat" | "pythae" | "recurrentgemma" | "relik" | "refiners" | "reverb" | "saelens" | "sam2" | "sample-factory" | "sapiens" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "diffusion-single-file" | "seed-story" | "soloaudio" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[]; | ||
//# sourceMappingURL=model-libraries.d.ts.map |
{ | ||
"name": "@huggingface/tasks", | ||
"packageManager": "pnpm@8.10.5", | ||
"version": "0.12.20", | ||
"version": "0.12.21", | ||
"description": "List of ML tasks for huggingface.co/tasks", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/huggingface/huggingface.js.git", |
@@ -85,2 +85,6 @@ import type { ModelData } from "./model-data"; | ||
function isMlxModel(model: ModelData) { | ||
return model.tags.includes("mlx"); | ||
} | ||
const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[] => { | ||
@@ -222,3 +226,3 @@ const command = (binary: string) => | ||
mainTask: "text-generation", | ||
displayOnModelPage: isLlamaCppGgufModel, | ||
displayOnModelPage: (model) => isLlamaCppGgufModel(model) || isMlxModel(model), | ||
deeplink: (model, filepath) => | ||
@@ -225,0 +229,0 @@ new URL(`lmstudio://open_from_hf?model=${model.id}${filepath ? `&file=${filepath}` : ""}`), |
@@ -142,2 +142,28 @@ import type { ModelData } from "./model-data"; | ||
export const depth_pro = (model: ModelData): string[] => { | ||
const installSnippet = `# Download checkpoint | ||
pip install huggingface-hub | ||
huggingface-cli download --local-dir checkpoints ${model.id}`; | ||
const inferenceSnippet = `import depth_pro | ||
# Load model and preprocessing transform | ||
model, transform = depth_pro.create_model_and_transforms() | ||
model.eval() | ||
# Load and preprocess an image. | ||
image, _, f_px = depth_pro.load_rgb("example.png") | ||
image = transform(image) | ||
# Run inference. | ||
prediction = model.infer(image, f_px=f_px) | ||
# Results: 1. Depth in meters | ||
depth = prediction["depth"] | ||
# Results: 2. Focal length in pixels | ||
focallength_px = prediction["focallength_px"]`; | ||
return [installSnippet, inferenceSnippet]; | ||
}; | ||
const diffusersDefaultPrompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"; | ||
@@ -144,0 +170,0 @@ |
@@ -168,2 +168,10 @@ import * as snippets from "./model-libraries-snippets"; | ||
}, | ||
"depth-pro": { | ||
prettyLabel: "Depth Pro", | ||
repoName: "Depth Pro", | ||
repoUrl: "https://github.com/apple/ml-depth-pro", | ||
countDownloads: `path_extension:"pt"`, | ||
snippets: snippets.depth_pro, | ||
filter: false, | ||
}, | ||
diffree: { | ||
@@ -170,0 +178,0 @@ prettyLabel: "Diffree", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1369636
33944