@huggingface/tasks 0.12.21 → 0.12.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +113 -11
- package/dist/index.js +113 -11
- package/dist/src/local-apps.d.ts +23 -0
- package/dist/src/local-apps.d.ts.map +1 -1
- package/dist/src/model-libraries-snippets.d.ts.map +1 -1
- package/dist/src/model-libraries.d.ts +9 -2
- package/dist/src/model-libraries.d.ts.map +1 -1
- package/dist/src/tasks/image-segmentation/data.d.ts.map +1 -1
- package/dist/src/tasks/object-detection/data.d.ts.map +1 -1
- package/dist/src/tasks/token-classification/inference.d.ts +8 -5
- package/dist/src/tasks/token-classification/inference.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/local-apps.ts +80 -0
- package/src/model-libraries-snippets.ts +21 -2
- package/src/model-libraries.ts +7 -0
- package/src/tasks/image-segmentation/about.md +1 -1
- package/src/tasks/image-segmentation/data.ts +7 -6
- package/src/tasks/object-detection/data.ts +5 -4
- package/src/tasks/token-classification/inference.ts +8 -5
- package/src/tasks/token-classification/spec/output.json +6 -2
package/dist/index.cjs
CHANGED
|
@@ -2311,21 +2311,21 @@ var taskData12 = {
|
|
|
2311
2311
|
models: [
|
|
2312
2312
|
{
|
|
2313
2313
|
// TO DO: write description
|
|
2314
|
-
description: "Solid
|
|
2315
|
-
id: "
|
|
2314
|
+
description: "Solid semantic segmentation model trained on ADE20k.",
|
|
2315
|
+
id: "openmmlab/upernet-convnext-small"
|
|
2316
2316
|
},
|
|
2317
2317
|
{
|
|
2318
2318
|
description: "Background removal model.",
|
|
2319
2319
|
id: "briaai/RMBG-1.4"
|
|
2320
2320
|
},
|
|
2321
|
-
{
|
|
2322
|
-
description: "Semantic segmentation model trained on ADE20k benchmark dataset with 512x512 resolution.",
|
|
2323
|
-
id: "nvidia/segformer-b0-finetuned-ade-512-512"
|
|
2324
|
-
},
|
|
2325
2321
|
{
|
|
2326
2322
|
description: "A multipurpose image segmentation model for high resolution images.",
|
|
2327
2323
|
id: "ZhengPeng7/BiRefNet"
|
|
2328
2324
|
},
|
|
2325
|
+
{
|
|
2326
|
+
description: "Semantic segmentation model trained on ADE20k dataset.",
|
|
2327
|
+
id: "nvidia/segformer-b0-finetuned-ade-512-512"
|
|
2328
|
+
},
|
|
2329
2329
|
{
|
|
2330
2330
|
description: "Panoptic segmentation model trained COCO (common objects) dataset.",
|
|
2331
2331
|
id: "facebook/mask2former-swin-large-coco-panoptic"
|
|
@@ -2457,15 +2457,15 @@ var taskData14 = {
|
|
|
2457
2457
|
],
|
|
2458
2458
|
models: [
|
|
2459
2459
|
{
|
|
2460
|
-
description: "Solid object detection model trained on the
|
|
2460
|
+
description: "Solid object detection model pre-trained on the COCO 2017 dataset.",
|
|
2461
2461
|
id: "facebook/detr-resnet-50"
|
|
2462
2462
|
},
|
|
2463
2463
|
{
|
|
2464
|
-
description: "
|
|
2465
|
-
id: "
|
|
2464
|
+
description: "Real-time and accurate object detection model.",
|
|
2465
|
+
id: "jameslahm/yolov10x"
|
|
2466
2466
|
},
|
|
2467
2467
|
{
|
|
2468
|
-
description: "Fast and accurate object detection model trained on COCO
|
|
2468
|
+
description: "Fast and accurate object detection model trained on COCO and Object365 datasets.",
|
|
2469
2469
|
id: "PekingU/rtdetr_r18vd_coco_o365"
|
|
2470
2470
|
}
|
|
2471
2471
|
],
|
|
@@ -5118,12 +5118,30 @@ with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
|
5118
5118
|
var sampleFactory = (model) => [
|
|
5119
5119
|
`python -m sample_factory.huggingface.load_from_hub -r ${model.id} -d ./train_dir`
|
|
5120
5120
|
];
|
|
5121
|
+
function get_widget_examples_from_st_model(model) {
|
|
5122
|
+
const widgetExample = model.widgetData?.[0];
|
|
5123
|
+
if (widgetExample) {
|
|
5124
|
+
return [widgetExample.source_sentence, ...widgetExample.sentences];
|
|
5125
|
+
}
|
|
5126
|
+
}
|
|
5121
5127
|
var sentenceTransformers = (model) => {
|
|
5122
5128
|
const remote_code_snippet = model.tags.includes(TAG_CUSTOM_CODE) ? ", trust_remote_code=True" : "";
|
|
5129
|
+
const exampleSentences = get_widget_examples_from_st_model(model) ?? [
|
|
5130
|
+
"The weather is lovely today.",
|
|
5131
|
+
"It's so sunny outside!",
|
|
5132
|
+
"He drove to the stadium."
|
|
5133
|
+
];
|
|
5123
5134
|
return [
|
|
5124
5135
|
`from sentence_transformers import SentenceTransformer
|
|
5125
5136
|
|
|
5126
|
-
model = SentenceTransformer("${model.id}"${remote_code_snippet})
|
|
5137
|
+
model = SentenceTransformer("${model.id}"${remote_code_snippet})
|
|
5138
|
+
|
|
5139
|
+
sentences = ${JSON.stringify(exampleSentences, null, 4)}
|
|
5140
|
+
embeddings = model.encode(sentences)
|
|
5141
|
+
|
|
5142
|
+
similarities = model.similarity(embeddings, embeddings)
|
|
5143
|
+
print(similarities.shape)
|
|
5144
|
+
# [${exampleSentences.length}, ${exampleSentences.length}]`
|
|
5127
5145
|
];
|
|
5128
5146
|
};
|
|
5129
5147
|
var setfit = (model) => [
|
|
@@ -6039,6 +6057,13 @@ var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
6039
6057
|
filter: true,
|
|
6040
6058
|
countDownloads: `path:"models/default.zip"`
|
|
6041
6059
|
},
|
|
6060
|
+
"f5-tts": {
|
|
6061
|
+
prettyLabel: "F5-TTS",
|
|
6062
|
+
repoName: "F5-TTS",
|
|
6063
|
+
repoUrl: "https://github.com/SWivid/F5-TTS",
|
|
6064
|
+
filter: false,
|
|
6065
|
+
countDownloads: `path_extension:"safetensors" OR path_extension:"pt"`
|
|
6066
|
+
},
|
|
6042
6067
|
tensorflowtts: {
|
|
6043
6068
|
prettyLabel: "TensorFlowTTS",
|
|
6044
6069
|
repoName: "TensorFlowTTS",
|
|
@@ -7177,6 +7202,7 @@ var SKUS = {
|
|
|
7177
7202
|
};
|
|
7178
7203
|
|
|
7179
7204
|
// src/local-apps.ts
|
|
7205
|
+
var import_gguf = require("@huggingface/gguf");
|
|
7180
7206
|
function isAwqModel(model) {
|
|
7181
7207
|
return model.config?.quantization_config?.quant_method === "awq";
|
|
7182
7208
|
}
|
|
@@ -7192,6 +7218,9 @@ function isMarlinModel(model) {
|
|
|
7192
7218
|
function isTransformersModel(model) {
|
|
7193
7219
|
return model.tags.includes("transformers");
|
|
7194
7220
|
}
|
|
7221
|
+
function isTgiModel(model) {
|
|
7222
|
+
return model.tags.includes("text-generation-inference");
|
|
7223
|
+
}
|
|
7195
7224
|
function isLlamaCppGgufModel(model) {
|
|
7196
7225
|
return !!model.gguf?.context_length;
|
|
7197
7226
|
}
|
|
@@ -7233,6 +7262,30 @@ var snippetLlamacpp = (model, filepath) => {
|
|
|
7233
7262
|
}
|
|
7234
7263
|
];
|
|
7235
7264
|
};
|
|
7265
|
+
var snippetNodeLlamaCppCli = (model, filepath) => {
|
|
7266
|
+
return [
|
|
7267
|
+
{
|
|
7268
|
+
title: "Chat with the model",
|
|
7269
|
+
content: [
|
|
7270
|
+
`npx -y node-llama-cpp chat \\`,
|
|
7271
|
+
` --model "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}" \\`,
|
|
7272
|
+
` --prompt 'Hi there!'`
|
|
7273
|
+
].join("\n")
|
|
7274
|
+
},
|
|
7275
|
+
{
|
|
7276
|
+
title: "Estimate the model compatibility with your hardware",
|
|
7277
|
+
content: `npx -y node-llama-cpp inspect estimate "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}"`
|
|
7278
|
+
}
|
|
7279
|
+
];
|
|
7280
|
+
};
|
|
7281
|
+
var snippetOllama = (model, filepath) => {
|
|
7282
|
+
if (filepath) {
|
|
7283
|
+
const quantLabel = (0, import_gguf.parseGGUFQuantLabel)(filepath);
|
|
7284
|
+
const ollamatag = quantLabel ? `:${quantLabel}` : "";
|
|
7285
|
+
return `ollama run hf.co/${model.id}${ollamatag}`;
|
|
7286
|
+
}
|
|
7287
|
+
return `ollama run hf.co/${model.id}{{OLLAMA_TAG}}`;
|
|
7288
|
+
};
|
|
7236
7289
|
var snippetLocalAI = (model, filepath) => {
|
|
7237
7290
|
const command = (binary) => ["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
|
|
7238
7291
|
return [
|
|
@@ -7294,6 +7347,34 @@ docker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
|
|
|
7294
7347
|
}
|
|
7295
7348
|
];
|
|
7296
7349
|
};
|
|
7350
|
+
var snippetTgi = (model) => {
|
|
7351
|
+
const runCommand = [
|
|
7352
|
+
"# Call the server using curl:",
|
|
7353
|
+
`curl -X POST "http://localhost:8000/v1/chat/completions" \\`,
|
|
7354
|
+
` -H "Content-Type: application/json" \\`,
|
|
7355
|
+
` --data '{`,
|
|
7356
|
+
` "model": "${model.id}",`,
|
|
7357
|
+
` "messages": [`,
|
|
7358
|
+
` {"role": "user", "content": "What is the capital of France?"}`,
|
|
7359
|
+
` ]`,
|
|
7360
|
+
` }'`
|
|
7361
|
+
];
|
|
7362
|
+
return [
|
|
7363
|
+
{
|
|
7364
|
+
title: "Use Docker images",
|
|
7365
|
+
setup: [
|
|
7366
|
+
"# Deploy with docker on Linux:",
|
|
7367
|
+
`docker run --gpus all \\`,
|
|
7368
|
+
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
|
|
7369
|
+
` -e HF_TOKEN="<secret>" \\`,
|
|
7370
|
+
` -p 8000:80 \\`,
|
|
7371
|
+
` ghcr.io/huggingface/text-generation-inference:latest \\`,
|
|
7372
|
+
` --model-id ${model.id}`
|
|
7373
|
+
].join("\n"),
|
|
7374
|
+
content: [runCommand.join("\n")]
|
|
7375
|
+
}
|
|
7376
|
+
];
|
|
7377
|
+
};
|
|
7297
7378
|
var LOCAL_APPS = {
|
|
7298
7379
|
"llama.cpp": {
|
|
7299
7380
|
prettyLabel: "llama.cpp",
|
|
@@ -7302,6 +7383,13 @@ var LOCAL_APPS = {
|
|
|
7302
7383
|
displayOnModelPage: isLlamaCppGgufModel,
|
|
7303
7384
|
snippet: snippetLlamacpp
|
|
7304
7385
|
},
|
|
7386
|
+
"node-llama-cpp": {
|
|
7387
|
+
prettyLabel: "node-llama-cpp",
|
|
7388
|
+
docsUrl: "https://node-llama-cpp.withcat.ai",
|
|
7389
|
+
mainTask: "text-generation",
|
|
7390
|
+
displayOnModelPage: isLlamaCppGgufModel,
|
|
7391
|
+
snippet: snippetNodeLlamaCppCli
|
|
7392
|
+
},
|
|
7305
7393
|
vllm: {
|
|
7306
7394
|
prettyLabel: "vLLM",
|
|
7307
7395
|
docsUrl: "https://docs.vllm.ai",
|
|
@@ -7309,6 +7397,13 @@ var LOCAL_APPS = {
|
|
|
7309
7397
|
displayOnModelPage: (model) => (isAwqModel(model) || isGptqModel(model) || isAqlmModel(model) || isMarlinModel(model) || isLlamaCppGgufModel(model) || isTransformersModel(model)) && (model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
|
|
7310
7398
|
snippet: snippetVllm
|
|
7311
7399
|
},
|
|
7400
|
+
tgi: {
|
|
7401
|
+
prettyLabel: "TGI",
|
|
7402
|
+
docsUrl: "https://huggingface.co/docs/text-generation-inference/",
|
|
7403
|
+
mainTask: "text-generation",
|
|
7404
|
+
displayOnModelPage: isTgiModel,
|
|
7405
|
+
snippet: snippetTgi
|
|
7406
|
+
},
|
|
7312
7407
|
lmstudio: {
|
|
7313
7408
|
prettyLabel: "LM Studio",
|
|
7314
7409
|
docsUrl: "https://lmstudio.ai",
|
|
@@ -7410,6 +7505,13 @@ var LOCAL_APPS = {
|
|
|
7410
7505
|
mainTask: "text-to-image",
|
|
7411
7506
|
displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
|
|
7412
7507
|
deeplink: (model) => new URL(`https://models.invoke.ai/huggingface/${model.id}`)
|
|
7508
|
+
},
|
|
7509
|
+
ollama: {
|
|
7510
|
+
prettyLabel: "Ollama",
|
|
7511
|
+
docsUrl: "https://ollama.com",
|
|
7512
|
+
mainTask: "text-generation",
|
|
7513
|
+
displayOnModelPage: isLlamaCppGgufModel,
|
|
7514
|
+
snippet: snippetOllama
|
|
7413
7515
|
}
|
|
7414
7516
|
};
|
|
7415
7517
|
|
package/dist/index.js
CHANGED
|
@@ -2273,21 +2273,21 @@ var taskData12 = {
|
|
|
2273
2273
|
models: [
|
|
2274
2274
|
{
|
|
2275
2275
|
// TO DO: write description
|
|
2276
|
-
description: "Solid
|
|
2277
|
-
id: "
|
|
2276
|
+
description: "Solid semantic segmentation model trained on ADE20k.",
|
|
2277
|
+
id: "openmmlab/upernet-convnext-small"
|
|
2278
2278
|
},
|
|
2279
2279
|
{
|
|
2280
2280
|
description: "Background removal model.",
|
|
2281
2281
|
id: "briaai/RMBG-1.4"
|
|
2282
2282
|
},
|
|
2283
|
-
{
|
|
2284
|
-
description: "Semantic segmentation model trained on ADE20k benchmark dataset with 512x512 resolution.",
|
|
2285
|
-
id: "nvidia/segformer-b0-finetuned-ade-512-512"
|
|
2286
|
-
},
|
|
2287
2283
|
{
|
|
2288
2284
|
description: "A multipurpose image segmentation model for high resolution images.",
|
|
2289
2285
|
id: "ZhengPeng7/BiRefNet"
|
|
2290
2286
|
},
|
|
2287
|
+
{
|
|
2288
|
+
description: "Semantic segmentation model trained on ADE20k dataset.",
|
|
2289
|
+
id: "nvidia/segformer-b0-finetuned-ade-512-512"
|
|
2290
|
+
},
|
|
2291
2291
|
{
|
|
2292
2292
|
description: "Panoptic segmentation model trained COCO (common objects) dataset.",
|
|
2293
2293
|
id: "facebook/mask2former-swin-large-coco-panoptic"
|
|
@@ -2419,15 +2419,15 @@ var taskData14 = {
|
|
|
2419
2419
|
],
|
|
2420
2420
|
models: [
|
|
2421
2421
|
{
|
|
2422
|
-
description: "Solid object detection model trained on the
|
|
2422
|
+
description: "Solid object detection model pre-trained on the COCO 2017 dataset.",
|
|
2423
2423
|
id: "facebook/detr-resnet-50"
|
|
2424
2424
|
},
|
|
2425
2425
|
{
|
|
2426
|
-
description: "
|
|
2427
|
-
id: "
|
|
2426
|
+
description: "Real-time and accurate object detection model.",
|
|
2427
|
+
id: "jameslahm/yolov10x"
|
|
2428
2428
|
},
|
|
2429
2429
|
{
|
|
2430
|
-
description: "Fast and accurate object detection model trained on COCO
|
|
2430
|
+
description: "Fast and accurate object detection model trained on COCO and Object365 datasets.",
|
|
2431
2431
|
id: "PekingU/rtdetr_r18vd_coco_o365"
|
|
2432
2432
|
}
|
|
2433
2433
|
],
|
|
@@ -5080,12 +5080,30 @@ with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
|
5080
5080
|
var sampleFactory = (model) => [
|
|
5081
5081
|
`python -m sample_factory.huggingface.load_from_hub -r ${model.id} -d ./train_dir`
|
|
5082
5082
|
];
|
|
5083
|
+
function get_widget_examples_from_st_model(model) {
|
|
5084
|
+
const widgetExample = model.widgetData?.[0];
|
|
5085
|
+
if (widgetExample) {
|
|
5086
|
+
return [widgetExample.source_sentence, ...widgetExample.sentences];
|
|
5087
|
+
}
|
|
5088
|
+
}
|
|
5083
5089
|
var sentenceTransformers = (model) => {
|
|
5084
5090
|
const remote_code_snippet = model.tags.includes(TAG_CUSTOM_CODE) ? ", trust_remote_code=True" : "";
|
|
5091
|
+
const exampleSentences = get_widget_examples_from_st_model(model) ?? [
|
|
5092
|
+
"The weather is lovely today.",
|
|
5093
|
+
"It's so sunny outside!",
|
|
5094
|
+
"He drove to the stadium."
|
|
5095
|
+
];
|
|
5085
5096
|
return [
|
|
5086
5097
|
`from sentence_transformers import SentenceTransformer
|
|
5087
5098
|
|
|
5088
|
-
model = SentenceTransformer("${model.id}"${remote_code_snippet})
|
|
5099
|
+
model = SentenceTransformer("${model.id}"${remote_code_snippet})
|
|
5100
|
+
|
|
5101
|
+
sentences = ${JSON.stringify(exampleSentences, null, 4)}
|
|
5102
|
+
embeddings = model.encode(sentences)
|
|
5103
|
+
|
|
5104
|
+
similarities = model.similarity(embeddings, embeddings)
|
|
5105
|
+
print(similarities.shape)
|
|
5106
|
+
# [${exampleSentences.length}, ${exampleSentences.length}]`
|
|
5089
5107
|
];
|
|
5090
5108
|
};
|
|
5091
5109
|
var setfit = (model) => [
|
|
@@ -6001,6 +6019,13 @@ var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
6001
6019
|
filter: true,
|
|
6002
6020
|
countDownloads: `path:"models/default.zip"`
|
|
6003
6021
|
},
|
|
6022
|
+
"f5-tts": {
|
|
6023
|
+
prettyLabel: "F5-TTS",
|
|
6024
|
+
repoName: "F5-TTS",
|
|
6025
|
+
repoUrl: "https://github.com/SWivid/F5-TTS",
|
|
6026
|
+
filter: false,
|
|
6027
|
+
countDownloads: `path_extension:"safetensors" OR path_extension:"pt"`
|
|
6028
|
+
},
|
|
6004
6029
|
tensorflowtts: {
|
|
6005
6030
|
prettyLabel: "TensorFlowTTS",
|
|
6006
6031
|
repoName: "TensorFlowTTS",
|
|
@@ -7139,6 +7164,7 @@ var SKUS = {
|
|
|
7139
7164
|
};
|
|
7140
7165
|
|
|
7141
7166
|
// src/local-apps.ts
|
|
7167
|
+
import { parseGGUFQuantLabel } from "@huggingface/gguf";
|
|
7142
7168
|
function isAwqModel(model) {
|
|
7143
7169
|
return model.config?.quantization_config?.quant_method === "awq";
|
|
7144
7170
|
}
|
|
@@ -7154,6 +7180,9 @@ function isMarlinModel(model) {
|
|
|
7154
7180
|
function isTransformersModel(model) {
|
|
7155
7181
|
return model.tags.includes("transformers");
|
|
7156
7182
|
}
|
|
7183
|
+
function isTgiModel(model) {
|
|
7184
|
+
return model.tags.includes("text-generation-inference");
|
|
7185
|
+
}
|
|
7157
7186
|
function isLlamaCppGgufModel(model) {
|
|
7158
7187
|
return !!model.gguf?.context_length;
|
|
7159
7188
|
}
|
|
@@ -7195,6 +7224,30 @@ var snippetLlamacpp = (model, filepath) => {
|
|
|
7195
7224
|
}
|
|
7196
7225
|
];
|
|
7197
7226
|
};
|
|
7227
|
+
var snippetNodeLlamaCppCli = (model, filepath) => {
|
|
7228
|
+
return [
|
|
7229
|
+
{
|
|
7230
|
+
title: "Chat with the model",
|
|
7231
|
+
content: [
|
|
7232
|
+
`npx -y node-llama-cpp chat \\`,
|
|
7233
|
+
` --model "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}" \\`,
|
|
7234
|
+
` --prompt 'Hi there!'`
|
|
7235
|
+
].join("\n")
|
|
7236
|
+
},
|
|
7237
|
+
{
|
|
7238
|
+
title: "Estimate the model compatibility with your hardware",
|
|
7239
|
+
content: `npx -y node-llama-cpp inspect estimate "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}"`
|
|
7240
|
+
}
|
|
7241
|
+
];
|
|
7242
|
+
};
|
|
7243
|
+
var snippetOllama = (model, filepath) => {
|
|
7244
|
+
if (filepath) {
|
|
7245
|
+
const quantLabel = parseGGUFQuantLabel(filepath);
|
|
7246
|
+
const ollamatag = quantLabel ? `:${quantLabel}` : "";
|
|
7247
|
+
return `ollama run hf.co/${model.id}${ollamatag}`;
|
|
7248
|
+
}
|
|
7249
|
+
return `ollama run hf.co/${model.id}{{OLLAMA_TAG}}`;
|
|
7250
|
+
};
|
|
7198
7251
|
var snippetLocalAI = (model, filepath) => {
|
|
7199
7252
|
const command = (binary) => ["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
|
|
7200
7253
|
return [
|
|
@@ -7256,6 +7309,34 @@ docker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
|
|
|
7256
7309
|
}
|
|
7257
7310
|
];
|
|
7258
7311
|
};
|
|
7312
|
+
var snippetTgi = (model) => {
|
|
7313
|
+
const runCommand = [
|
|
7314
|
+
"# Call the server using curl:",
|
|
7315
|
+
`curl -X POST "http://localhost:8000/v1/chat/completions" \\`,
|
|
7316
|
+
` -H "Content-Type: application/json" \\`,
|
|
7317
|
+
` --data '{`,
|
|
7318
|
+
` "model": "${model.id}",`,
|
|
7319
|
+
` "messages": [`,
|
|
7320
|
+
` {"role": "user", "content": "What is the capital of France?"}`,
|
|
7321
|
+
` ]`,
|
|
7322
|
+
` }'`
|
|
7323
|
+
];
|
|
7324
|
+
return [
|
|
7325
|
+
{
|
|
7326
|
+
title: "Use Docker images",
|
|
7327
|
+
setup: [
|
|
7328
|
+
"# Deploy with docker on Linux:",
|
|
7329
|
+
`docker run --gpus all \\`,
|
|
7330
|
+
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
|
|
7331
|
+
` -e HF_TOKEN="<secret>" \\`,
|
|
7332
|
+
` -p 8000:80 \\`,
|
|
7333
|
+
` ghcr.io/huggingface/text-generation-inference:latest \\`,
|
|
7334
|
+
` --model-id ${model.id}`
|
|
7335
|
+
].join("\n"),
|
|
7336
|
+
content: [runCommand.join("\n")]
|
|
7337
|
+
}
|
|
7338
|
+
];
|
|
7339
|
+
};
|
|
7259
7340
|
var LOCAL_APPS = {
|
|
7260
7341
|
"llama.cpp": {
|
|
7261
7342
|
prettyLabel: "llama.cpp",
|
|
@@ -7264,6 +7345,13 @@ var LOCAL_APPS = {
|
|
|
7264
7345
|
displayOnModelPage: isLlamaCppGgufModel,
|
|
7265
7346
|
snippet: snippetLlamacpp
|
|
7266
7347
|
},
|
|
7348
|
+
"node-llama-cpp": {
|
|
7349
|
+
prettyLabel: "node-llama-cpp",
|
|
7350
|
+
docsUrl: "https://node-llama-cpp.withcat.ai",
|
|
7351
|
+
mainTask: "text-generation",
|
|
7352
|
+
displayOnModelPage: isLlamaCppGgufModel,
|
|
7353
|
+
snippet: snippetNodeLlamaCppCli
|
|
7354
|
+
},
|
|
7267
7355
|
vllm: {
|
|
7268
7356
|
prettyLabel: "vLLM",
|
|
7269
7357
|
docsUrl: "https://docs.vllm.ai",
|
|
@@ -7271,6 +7359,13 @@ var LOCAL_APPS = {
|
|
|
7271
7359
|
displayOnModelPage: (model) => (isAwqModel(model) || isGptqModel(model) || isAqlmModel(model) || isMarlinModel(model) || isLlamaCppGgufModel(model) || isTransformersModel(model)) && (model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
|
|
7272
7360
|
snippet: snippetVllm
|
|
7273
7361
|
},
|
|
7362
|
+
tgi: {
|
|
7363
|
+
prettyLabel: "TGI",
|
|
7364
|
+
docsUrl: "https://huggingface.co/docs/text-generation-inference/",
|
|
7365
|
+
mainTask: "text-generation",
|
|
7366
|
+
displayOnModelPage: isTgiModel,
|
|
7367
|
+
snippet: snippetTgi
|
|
7368
|
+
},
|
|
7274
7369
|
lmstudio: {
|
|
7275
7370
|
prettyLabel: "LM Studio",
|
|
7276
7371
|
docsUrl: "https://lmstudio.ai",
|
|
@@ -7372,6 +7467,13 @@ var LOCAL_APPS = {
|
|
|
7372
7467
|
mainTask: "text-to-image",
|
|
7373
7468
|
displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
|
|
7374
7469
|
deeplink: (model) => new URL(`https://models.invoke.ai/huggingface/${model.id}`)
|
|
7470
|
+
},
|
|
7471
|
+
ollama: {
|
|
7472
|
+
prettyLabel: "Ollama",
|
|
7473
|
+
docsUrl: "https://ollama.com",
|
|
7474
|
+
mainTask: "text-generation",
|
|
7475
|
+
displayOnModelPage: isLlamaCppGgufModel,
|
|
7476
|
+
snippet: snippetOllama
|
|
7375
7477
|
}
|
|
7376
7478
|
};
|
|
7377
7479
|
|
package/dist/src/local-apps.d.ts
CHANGED
|
@@ -48,9 +48,11 @@ export type LocalApp = {
|
|
|
48
48
|
/**
|
|
49
49
|
* And if not (mostly llama.cpp), snippet to copy/paste in your terminal
|
|
50
50
|
* Support the placeholder {{GGUF_FILE}} that will be replaced by the gguf file path or the list of available files.
|
|
51
|
+
* Support the placeholder {{OLLAMA_TAG}} that will be replaced by the list of available quant tags or will be removed if there are no multiple quant files in a same repo.
|
|
51
52
|
*/
|
|
52
53
|
snippet: (model: ModelData, filepath?: string) => string | string[] | LocalAppSnippet | LocalAppSnippet[];
|
|
53
54
|
});
|
|
55
|
+
declare function isTgiModel(model: ModelData): boolean;
|
|
54
56
|
declare function isLlamaCppGgufModel(model: ModelData): boolean;
|
|
55
57
|
/**
|
|
56
58
|
* Add your new local app here.
|
|
@@ -71,6 +73,13 @@ export declare const LOCAL_APPS: {
|
|
|
71
73
|
displayOnModelPage: typeof isLlamaCppGgufModel;
|
|
72
74
|
snippet: (model: ModelData, filepath?: string) => LocalAppSnippet[];
|
|
73
75
|
};
|
|
76
|
+
"node-llama-cpp": {
|
|
77
|
+
prettyLabel: string;
|
|
78
|
+
docsUrl: string;
|
|
79
|
+
mainTask: "text-generation";
|
|
80
|
+
displayOnModelPage: typeof isLlamaCppGgufModel;
|
|
81
|
+
snippet: (model: ModelData, filepath?: string) => LocalAppSnippet[];
|
|
82
|
+
};
|
|
74
83
|
vllm: {
|
|
75
84
|
prettyLabel: string;
|
|
76
85
|
docsUrl: string;
|
|
@@ -78,6 +87,13 @@ export declare const LOCAL_APPS: {
|
|
|
78
87
|
displayOnModelPage: (model: ModelData) => boolean;
|
|
79
88
|
snippet: (model: ModelData) => LocalAppSnippet[];
|
|
80
89
|
};
|
|
90
|
+
tgi: {
|
|
91
|
+
prettyLabel: string;
|
|
92
|
+
docsUrl: string;
|
|
93
|
+
mainTask: "text-generation";
|
|
94
|
+
displayOnModelPage: typeof isTgiModel;
|
|
95
|
+
snippet: (model: ModelData) => LocalAppSnippet[];
|
|
96
|
+
};
|
|
81
97
|
lmstudio: {
|
|
82
98
|
prettyLabel: string;
|
|
83
99
|
docsUrl: string;
|
|
@@ -166,6 +182,13 @@ export declare const LOCAL_APPS: {
|
|
|
166
182
|
displayOnModelPage: (model: ModelData) => boolean;
|
|
167
183
|
deeplink: (model: ModelData) => URL;
|
|
168
184
|
};
|
|
185
|
+
ollama: {
|
|
186
|
+
prettyLabel: string;
|
|
187
|
+
docsUrl: string;
|
|
188
|
+
mainTask: "text-generation";
|
|
189
|
+
displayOnModelPage: typeof isLlamaCppGgufModel;
|
|
190
|
+
snippet: (model: ModelData, filepath?: string) => string;
|
|
191
|
+
};
|
|
169
192
|
};
|
|
170
193
|
export type LocalAppKey = keyof typeof LOCAL_APPS;
|
|
171
194
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;CACtD,GACD;IACA;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM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AEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAYnC,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,SAAS,KAAG,MAAM,EAKvD,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,SAAS,KAAG,MAAM,EAI9C,CAAC"}
|
|
@@ -660,6 +660,13 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
660
660
|
filter: true;
|
|
661
661
|
countDownloads: string;
|
|
662
662
|
};
|
|
663
|
+
"f5-tts": {
|
|
664
|
+
prettyLabel: string;
|
|
665
|
+
repoName: string;
|
|
666
|
+
repoUrl: string;
|
|
667
|
+
filter: false;
|
|
668
|
+
countDownloads: string;
|
|
669
|
+
};
|
|
663
670
|
tensorflowtts: {
|
|
664
671
|
prettyLabel: string;
|
|
665
672
|
repoName: string;
|
|
@@ -752,6 +759,6 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
752
759
|
};
|
|
753
760
|
};
|
|
754
761
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
755
|
-
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")[];
|
|
756
|
-
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")[];
|
|
762
|
+
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" | "f5-tts" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[];
|
|
763
|
+
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" | "f5-tts" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "vfi-mamba" | "voicecraft" | "yolov10" | "whisperkit" | "3dtopia-xl")[];
|
|
757
764
|
//# sourceMappingURL=model-libraries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries.d.ts","sourceRoot":"","sources":["../../src/model-libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,EAAE,CAAC;IAC1C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;OAGG;IACH,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAksBI,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,gyCAAgE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,gyCAQ1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-segmentation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-segmentation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA+Ff,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/object-detection/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/object-detection/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAkFf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -60,12 +60,15 @@ export interface TokenClassificationOutputElement {
|
|
|
60
60
|
/**
|
|
61
61
|
* The character position in the input where this group ends.
|
|
62
62
|
*/
|
|
63
|
-
end
|
|
63
|
+
end: number;
|
|
64
64
|
/**
|
|
65
|
-
* The predicted label for
|
|
65
|
+
* The predicted label for a single token
|
|
66
|
+
*/
|
|
67
|
+
entity?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The predicted label for a group of one or more tokens
|
|
66
70
|
*/
|
|
67
71
|
entity_group?: string;
|
|
68
|
-
label: unknown;
|
|
69
72
|
/**
|
|
70
73
|
* The associated score / probability
|
|
71
74
|
*/
|
|
@@ -73,11 +76,11 @@ export interface TokenClassificationOutputElement {
|
|
|
73
76
|
/**
|
|
74
77
|
* The character position in the input where this group begins.
|
|
75
78
|
*/
|
|
76
|
-
start
|
|
79
|
+
start: number;
|
|
77
80
|
/**
|
|
78
81
|
* The corresponding text
|
|
79
82
|
*/
|
|
80
|
-
word
|
|
83
|
+
word: string;
|
|
81
84
|
[property: string]: unknown;
|
|
82
85
|
}
|
|
83
86
|
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/token-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,oBAAoB,CAAC,EAAE,sCAAsC,CAAC;IAC9D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sCAAsC,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;AACrG,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,GAAG,
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/token-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,oBAAoB,CAAC,EAAE,sCAAsC,CAAC;IAC9D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sCAAsC,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;AACrG,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huggingface/tasks",
|
|
3
3
|
"packageManager": "pnpm@8.10.5",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.23",
|
|
5
5
|
"description": "List of ML tasks for huggingface.co/tasks",
|
|
6
6
|
"repository": "https://github.com/huggingface/huggingface.js.git",
|
|
7
7
|
"publishConfig": {
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
"quicktype-core": "https://github.com/huggingface/quicktype/raw/pack-18.0.17/packages/quicktype-core/quicktype-core-18.0.17.tgz",
|
|
37
37
|
"type-fest": "^3.13.1"
|
|
38
38
|
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@huggingface/gguf": "^0.1.12"
|
|
41
|
+
},
|
|
39
42
|
"scripts": {
|
|
40
43
|
"lint": "eslint --quiet --fix --ext .cjs,.ts .",
|
|
41
44
|
"lint:check": "eslint --ext .cjs,.ts .",
|
package/src/local-apps.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ModelData } from "./model-data";
|
|
2
2
|
import type { PipelineType } from "./pipelines";
|
|
3
|
+
import { parseGGUFQuantLabel } from "@huggingface/gguf";
|
|
3
4
|
|
|
4
5
|
export interface LocalAppSnippet {
|
|
5
6
|
/**
|
|
@@ -53,6 +54,7 @@ export type LocalApp = {
|
|
|
53
54
|
/**
|
|
54
55
|
* And if not (mostly llama.cpp), snippet to copy/paste in your terminal
|
|
55
56
|
* Support the placeholder {{GGUF_FILE}} that will be replaced by the gguf file path or the list of available files.
|
|
57
|
+
* Support the placeholder {{OLLAMA_TAG}} that will be replaced by the list of available quant tags or will be removed if there are no multiple quant files in a same repo.
|
|
56
58
|
*/
|
|
57
59
|
snippet: (model: ModelData, filepath?: string) => string | string[] | LocalAppSnippet | LocalAppSnippet[];
|
|
58
60
|
}
|
|
@@ -77,6 +79,9 @@ function isMarlinModel(model: ModelData): boolean {
|
|
|
77
79
|
function isTransformersModel(model: ModelData): boolean {
|
|
78
80
|
return model.tags.includes("transformers");
|
|
79
81
|
}
|
|
82
|
+
function isTgiModel(model: ModelData): boolean {
|
|
83
|
+
return model.tags.includes("text-generation-inference");
|
|
84
|
+
}
|
|
80
85
|
|
|
81
86
|
function isLlamaCppGgufModel(model: ModelData) {
|
|
82
87
|
return !!model.gguf?.context_length;
|
|
@@ -123,6 +128,32 @@ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[]
|
|
|
123
128
|
];
|
|
124
129
|
};
|
|
125
130
|
|
|
131
|
+
const snippetNodeLlamaCppCli = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
title: "Chat with the model",
|
|
135
|
+
content: [
|
|
136
|
+
`npx -y node-llama-cpp chat \\`,
|
|
137
|
+
` --model "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}" \\`,
|
|
138
|
+
` --prompt 'Hi there!'`,
|
|
139
|
+
].join("\n"),
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
title: "Estimate the model compatibility with your hardware",
|
|
143
|
+
content: `npx -y node-llama-cpp inspect estimate "hf:${model.id}/${filepath ?? "{{GGUF_FILE}}"}"`,
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const snippetOllama = (model: ModelData, filepath?: string): string => {
|
|
149
|
+
if (filepath) {
|
|
150
|
+
const quantLabel = parseGGUFQuantLabel(filepath);
|
|
151
|
+
const ollamatag = quantLabel ? `:${quantLabel}` : "";
|
|
152
|
+
return `ollama run hf.co/${model.id}${ollamatag}`;
|
|
153
|
+
}
|
|
154
|
+
return `ollama run hf.co/${model.id}{{OLLAMA_TAG}}`;
|
|
155
|
+
};
|
|
156
|
+
|
|
126
157
|
const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
|
|
127
158
|
const command = (binary: string) =>
|
|
128
159
|
["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
|
|
@@ -184,6 +215,34 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
|
|
|
184
215
|
},
|
|
185
216
|
];
|
|
186
217
|
};
|
|
218
|
+
const snippetTgi = (model: ModelData): LocalAppSnippet[] => {
|
|
219
|
+
const runCommand = [
|
|
220
|
+
"# Call the server using curl:",
|
|
221
|
+
`curl -X POST "http://localhost:8000/v1/chat/completions" \\`,
|
|
222
|
+
` -H "Content-Type: application/json" \\`,
|
|
223
|
+
` --data '{`,
|
|
224
|
+
` "model": "${model.id}",`,
|
|
225
|
+
` "messages": [`,
|
|
226
|
+
` {"role": "user", "content": "What is the capital of France?"}`,
|
|
227
|
+
` ]`,
|
|
228
|
+
` }'`,
|
|
229
|
+
];
|
|
230
|
+
return [
|
|
231
|
+
{
|
|
232
|
+
title: "Use Docker images",
|
|
233
|
+
setup: [
|
|
234
|
+
"# Deploy with docker on Linux:",
|
|
235
|
+
`docker run --gpus all \\`,
|
|
236
|
+
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
|
|
237
|
+
` -e HF_TOKEN="<secret>" \\`,
|
|
238
|
+
` -p 8000:80 \\`,
|
|
239
|
+
` ghcr.io/huggingface/text-generation-inference:latest \\`,
|
|
240
|
+
` --model-id ${model.id}`,
|
|
241
|
+
].join("\n"),
|
|
242
|
+
content: [runCommand.join("\n")],
|
|
243
|
+
},
|
|
244
|
+
];
|
|
245
|
+
};
|
|
187
246
|
|
|
188
247
|
/**
|
|
189
248
|
* Add your new local app here.
|
|
@@ -204,6 +263,13 @@ export const LOCAL_APPS = {
|
|
|
204
263
|
displayOnModelPage: isLlamaCppGgufModel,
|
|
205
264
|
snippet: snippetLlamacpp,
|
|
206
265
|
},
|
|
266
|
+
"node-llama-cpp": {
|
|
267
|
+
prettyLabel: "node-llama-cpp",
|
|
268
|
+
docsUrl: "https://node-llama-cpp.withcat.ai",
|
|
269
|
+
mainTask: "text-generation",
|
|
270
|
+
displayOnModelPage: isLlamaCppGgufModel,
|
|
271
|
+
snippet: snippetNodeLlamaCppCli,
|
|
272
|
+
},
|
|
207
273
|
vllm: {
|
|
208
274
|
prettyLabel: "vLLM",
|
|
209
275
|
docsUrl: "https://docs.vllm.ai",
|
|
@@ -218,6 +284,13 @@ export const LOCAL_APPS = {
|
|
|
218
284
|
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
|
|
219
285
|
snippet: snippetVllm,
|
|
220
286
|
},
|
|
287
|
+
tgi: {
|
|
288
|
+
prettyLabel: "TGI",
|
|
289
|
+
docsUrl: "https://huggingface.co/docs/text-generation-inference/",
|
|
290
|
+
mainTask: "text-generation",
|
|
291
|
+
displayOnModelPage: isTgiModel,
|
|
292
|
+
snippet: snippetTgi,
|
|
293
|
+
},
|
|
221
294
|
lmstudio: {
|
|
222
295
|
prettyLabel: "LM Studio",
|
|
223
296
|
docsUrl: "https://lmstudio.ai",
|
|
@@ -327,6 +400,13 @@ export const LOCAL_APPS = {
|
|
|
327
400
|
displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
|
|
328
401
|
deeplink: (model) => new URL(`https://models.invoke.ai/huggingface/${model.id}`),
|
|
329
402
|
},
|
|
403
|
+
ollama: {
|
|
404
|
+
prettyLabel: "Ollama",
|
|
405
|
+
docsUrl: "https://ollama.com",
|
|
406
|
+
mainTask: "text-generation",
|
|
407
|
+
displayOnModelPage: isLlamaCppGgufModel,
|
|
408
|
+
snippet: snippetOllama,
|
|
409
|
+
},
|
|
330
410
|
} satisfies Record<string, LocalApp>;
|
|
331
411
|
|
|
332
412
|
export type LocalAppKey = keyof typeof LOCAL_APPS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelData } from "./model-data";
|
|
2
|
-
import type { WidgetExampleTextInput } from "./widget-example";
|
|
2
|
+
import type { WidgetExampleTextInput, WidgetExampleSentenceSimilarityInput } from "./widget-example";
|
|
3
3
|
import { LIBRARY_TASK_MAPPING } from "./library-to-tasks";
|
|
4
4
|
|
|
5
5
|
const TAG_CUSTOM_CODE = "custom_code";
|
|
@@ -704,13 +704,32 @@ export const sampleFactory = (model: ModelData): string[] => [
|
|
|
704
704
|
`python -m sample_factory.huggingface.load_from_hub -r ${model.id} -d ./train_dir`,
|
|
705
705
|
];
|
|
706
706
|
|
|
707
|
+
function get_widget_examples_from_st_model(model: ModelData): string[] | undefined {
|
|
708
|
+
const widgetExample = model.widgetData?.[0] as WidgetExampleSentenceSimilarityInput | undefined;
|
|
709
|
+
if (widgetExample) {
|
|
710
|
+
return [widgetExample.source_sentence, ...widgetExample.sentences];
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
707
714
|
export const sentenceTransformers = (model: ModelData): string[] => {
|
|
708
715
|
const remote_code_snippet = model.tags.includes(TAG_CUSTOM_CODE) ? ", trust_remote_code=True" : "";
|
|
716
|
+
const exampleSentences = get_widget_examples_from_st_model(model) ?? [
|
|
717
|
+
"The weather is lovely today.",
|
|
718
|
+
"It's so sunny outside!",
|
|
719
|
+
"He drove to the stadium.",
|
|
720
|
+
];
|
|
709
721
|
|
|
710
722
|
return [
|
|
711
723
|
`from sentence_transformers import SentenceTransformer
|
|
712
724
|
|
|
713
|
-
model = SentenceTransformer("${model.id}"${remote_code_snippet})
|
|
725
|
+
model = SentenceTransformer("${model.id}"${remote_code_snippet})
|
|
726
|
+
|
|
727
|
+
sentences = ${JSON.stringify(exampleSentences, null, 4)}
|
|
728
|
+
embeddings = model.encode(sentences)
|
|
729
|
+
|
|
730
|
+
similarities = model.similarity(embeddings, embeddings)
|
|
731
|
+
print(similarities.shape)
|
|
732
|
+
# [${exampleSentences.length}, ${exampleSentences.length}]`,
|
|
714
733
|
];
|
|
715
734
|
};
|
|
716
735
|
|
package/src/model-libraries.ts
CHANGED
|
@@ -666,6 +666,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
666
666
|
filter: true,
|
|
667
667
|
countDownloads: `path:"models/default.zip"`,
|
|
668
668
|
},
|
|
669
|
+
"f5-tts": {
|
|
670
|
+
prettyLabel: "F5-TTS",
|
|
671
|
+
repoName: "F5-TTS",
|
|
672
|
+
repoUrl: "https://github.com/SWivid/F5-TTS",
|
|
673
|
+
filter: false,
|
|
674
|
+
countDownloads: `path_extension:"safetensors" OR path_extension:"pt"`,
|
|
675
|
+
},
|
|
669
676
|
tensorflowtts: {
|
|
670
677
|
prettyLabel: "TensorFlowTTS",
|
|
671
678
|
repoName: "TensorFlowTTS",
|
|
@@ -48,7 +48,7 @@ import { HfInference } from "@huggingface/inference";
|
|
|
48
48
|
const inference = new HfInference(HF_TOKEN);
|
|
49
49
|
await inference.imageSegmentation({
|
|
50
50
|
data: await (await fetch("https://picsum.photos/300/300")).blob(),
|
|
51
|
-
model: "facebook/
|
|
51
|
+
model: "facebook/mask2former-swin-base-coco-panoptic",
|
|
52
52
|
});
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -44,21 +44,22 @@ const taskData: TaskDataCustom = {
|
|
|
44
44
|
models: [
|
|
45
45
|
{
|
|
46
46
|
// TO DO: write description
|
|
47
|
-
description:
|
|
48
|
-
|
|
47
|
+
description:
|
|
48
|
+
"Solid semantic segmentation model trained on ADE20k.",
|
|
49
|
+
id: "openmmlab/upernet-convnext-small",
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
52
|
description: "Background removal model.",
|
|
52
53
|
id: "briaai/RMBG-1.4",
|
|
53
54
|
},
|
|
54
|
-
{
|
|
55
|
-
description: "Semantic segmentation model trained on ADE20k benchmark dataset with 512x512 resolution.",
|
|
56
|
-
id: "nvidia/segformer-b0-finetuned-ade-512-512",
|
|
57
|
-
},
|
|
58
55
|
{
|
|
59
56
|
description: "A multipurpose image segmentation model for high resolution images.",
|
|
60
57
|
id: "ZhengPeng7/BiRefNet",
|
|
61
58
|
},
|
|
59
|
+
{
|
|
60
|
+
description: "Semantic segmentation model trained on ADE20k dataset.",
|
|
61
|
+
id: "nvidia/segformer-b0-finetuned-ade-512-512",
|
|
62
|
+
},
|
|
62
63
|
{
|
|
63
64
|
description: "Panoptic segmentation model trained COCO (common objects) dataset.",
|
|
64
65
|
id: "facebook/mask2former-swin-large-coco-panoptic",
|
|
@@ -43,15 +43,16 @@ const taskData: TaskDataCustom = {
|
|
|
43
43
|
],
|
|
44
44
|
models: [
|
|
45
45
|
{
|
|
46
|
-
description: "Solid object detection model trained on the
|
|
46
|
+
description: "Solid object detection model pre-trained on the COCO 2017 dataset.",
|
|
47
47
|
id: "facebook/detr-resnet-50",
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
description: "
|
|
51
|
-
id: "
|
|
50
|
+
description: "Real-time and accurate object detection model.",
|
|
51
|
+
id: "jameslahm/yolov10x",
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
description:
|
|
54
|
+
description:
|
|
55
|
+
"Fast and accurate object detection model trained on COCO and Object365 datasets.",
|
|
55
56
|
id: "PekingU/rtdetr_r18vd_coco_o365",
|
|
56
57
|
},
|
|
57
58
|
],
|
|
@@ -60,12 +60,15 @@ export interface TokenClassificationOutputElement {
|
|
|
60
60
|
/**
|
|
61
61
|
* The character position in the input where this group ends.
|
|
62
62
|
*/
|
|
63
|
-
end
|
|
63
|
+
end: number;
|
|
64
64
|
/**
|
|
65
|
-
* The predicted label for
|
|
65
|
+
* The predicted label for a single token
|
|
66
|
+
*/
|
|
67
|
+
entity?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The predicted label for a group of one or more tokens
|
|
66
70
|
*/
|
|
67
71
|
entity_group?: string;
|
|
68
|
-
label: unknown;
|
|
69
72
|
/**
|
|
70
73
|
* The associated score / probability
|
|
71
74
|
*/
|
|
@@ -73,10 +76,10 @@ export interface TokenClassificationOutputElement {
|
|
|
73
76
|
/**
|
|
74
77
|
* The character position in the input where this group begins.
|
|
75
78
|
*/
|
|
76
|
-
start
|
|
79
|
+
start: number;
|
|
77
80
|
/**
|
|
78
81
|
* The corresponding text
|
|
79
82
|
*/
|
|
80
|
-
word
|
|
83
|
+
word: string;
|
|
81
84
|
[property: string]: unknown;
|
|
82
85
|
}
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
"properties": {
|
|
10
10
|
"entity_group": {
|
|
11
11
|
"type": "string",
|
|
12
|
-
"description": "The predicted label for
|
|
12
|
+
"description": "The predicted label for a group of one or more tokens"
|
|
13
|
+
},
|
|
14
|
+
"entity": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The predicted label for a single token"
|
|
13
17
|
},
|
|
14
18
|
"score": {
|
|
15
19
|
"type": "number",
|
|
@@ -28,6 +32,6 @@
|
|
|
28
32
|
"description": "The character position in the input where this group ends."
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
|
-
"required": ["
|
|
35
|
+
"required": ["score", "word", "start", "end"]
|
|
32
36
|
}
|
|
33
37
|
}
|