@huggingface/tasks 0.10.20 → 0.10.22
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 +161 -38
- package/dist/index.js +161 -38
- package/dist/src/model-libraries-snippets.d.ts +3 -0
- package/dist/src/model-libraries-snippets.d.ts.map +1 -1
- package/dist/src/model-libraries.d.ts +22 -2
- package/dist/src/model-libraries.d.ts.map +1 -1
- package/dist/src/snippets/curl.d.ts +1 -0
- package/dist/src/snippets/curl.d.ts.map +1 -1
- package/dist/src/snippets/js.d.ts +1 -0
- package/dist/src/snippets/js.d.ts.map +1 -1
- package/dist/src/snippets/python.d.ts +2 -1
- package/dist/src/snippets/python.d.ts.map +1 -1
- package/dist/src/snippets/types.d.ts +1 -1
- package/dist/src/snippets/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/local-apps.ts +1 -1
- package/src/model-libraries-snippets.ts +37 -2
- package/src/model-libraries.ts +21 -0
- package/src/snippets/curl.ts +19 -1
- package/src/snippets/inputs.ts +25 -25
- package/src/snippets/js.ts +40 -6
- package/src/snippets/python.ts +27 -4
- package/src/snippets/types.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -4257,13 +4257,18 @@ var gliner = (model) => [
|
|
|
4257
4257
|
model = GLiNER.from_pretrained("${model.id}")`
|
|
4258
4258
|
];
|
|
4259
4259
|
var keras = (model) => [
|
|
4260
|
-
|
|
4260
|
+
`# Available backend options are: "jax", "tensorflow", "torch".
|
|
4261
|
+
import os
|
|
4262
|
+
os.environ["KERAS_BACKEND"] = "tensorflow"
|
|
4263
|
+
|
|
4264
|
+
import keras
|
|
4261
4265
|
|
|
4262
|
-
model =
|
|
4266
|
+
model = keras.saving.load_model("hf://${model.id}")
|
|
4263
4267
|
`
|
|
4264
4268
|
];
|
|
4265
4269
|
var keras_nlp = (model) => [
|
|
4266
4270
|
`# Available backend options are: "jax", "tensorflow", "torch".
|
|
4271
|
+
import os
|
|
4267
4272
|
os.environ["KERAS_BACKEND"] = "tensorflow"
|
|
4268
4273
|
|
|
4269
4274
|
import keras_nlp
|
|
@@ -4272,6 +4277,20 @@ tokenizer = keras_nlp.models.Tokenizer.from_preset("hf://${model.id}")
|
|
|
4272
4277
|
backbone = keras_nlp.models.Backbone.from_preset("hf://${model.id}")
|
|
4273
4278
|
`
|
|
4274
4279
|
];
|
|
4280
|
+
var tf_keras = (model) => [
|
|
4281
|
+
`# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy)
|
|
4282
|
+
# See https://github.com/keras-team/tf-keras for more details.
|
|
4283
|
+
from huggingface_hub import from_pretrained_keras
|
|
4284
|
+
|
|
4285
|
+
model = from_pretrained_keras("${model.id}")
|
|
4286
|
+
`
|
|
4287
|
+
];
|
|
4288
|
+
var mars5_tts = (model) => [
|
|
4289
|
+
`# Install from https://github.com/Camb-ai/MARS5-TTS
|
|
4290
|
+
|
|
4291
|
+
from inference import Mars5TTS
|
|
4292
|
+
mars5 = Mars5TTS.from_pretrained("${model.id}")`
|
|
4293
|
+
];
|
|
4275
4294
|
var open_clip = (model) => [
|
|
4276
4295
|
`import open_clip
|
|
4277
4296
|
|
|
@@ -4720,6 +4739,19 @@ var audiocraft = (model) => {
|
|
|
4720
4739
|
return [`# Type of model unknown.`];
|
|
4721
4740
|
}
|
|
4722
4741
|
};
|
|
4742
|
+
var whisperkit = () => [
|
|
4743
|
+
`# Install CLI with Homebrew on macOS device
|
|
4744
|
+
brew install whisperkit-cli
|
|
4745
|
+
|
|
4746
|
+
# View all available inference options
|
|
4747
|
+
whisperkit-cli transcribe --help
|
|
4748
|
+
|
|
4749
|
+
# Download and run inference using whisper base model
|
|
4750
|
+
whisperkit-cli transcribe --audio-path /path/to/audio.mp3
|
|
4751
|
+
|
|
4752
|
+
# Or use your preferred model variant
|
|
4753
|
+
whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose`
|
|
4754
|
+
];
|
|
4723
4755
|
|
|
4724
4756
|
// src/model-libraries.ts
|
|
4725
4757
|
var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
@@ -4754,7 +4786,8 @@ var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
4754
4786
|
repoName: "audiocraft",
|
|
4755
4787
|
repoUrl: "https://github.com/facebookresearch/audiocraft",
|
|
4756
4788
|
snippets: audiocraft,
|
|
4757
|
-
filter: false
|
|
4789
|
+
filter: false,
|
|
4790
|
+
countDownloads: `path:"state_dict.bin"`
|
|
4758
4791
|
},
|
|
4759
4792
|
audioseal: {
|
|
4760
4793
|
prettyLabel: "AudioSeal",
|
|
@@ -4906,6 +4939,16 @@ var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
4906
4939
|
docsUrl: "https://huggingface.co/docs/hub/keras",
|
|
4907
4940
|
snippets: keras,
|
|
4908
4941
|
filter: true,
|
|
4942
|
+
countDownloads: `path:"config.json" OR path_extension:"keras"`
|
|
4943
|
+
},
|
|
4944
|
+
"tf-keras": {
|
|
4945
|
+
// Legacy "Keras 2" library (tensorflow-only)
|
|
4946
|
+
prettyLabel: "TF-Keras",
|
|
4947
|
+
repoName: "TF-Keras",
|
|
4948
|
+
repoUrl: "https://github.com/keras-team/tf-keras",
|
|
4949
|
+
docsUrl: "https://huggingface.co/docs/hub/tf-keras",
|
|
4950
|
+
snippets: tf_keras,
|
|
4951
|
+
filter: true,
|
|
4909
4952
|
countDownloads: `path:"saved_model.pb"`
|
|
4910
4953
|
},
|
|
4911
4954
|
"keras-nlp": {
|
|
@@ -4925,6 +4968,14 @@ var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
4925
4968
|
repoName: "mindspore",
|
|
4926
4969
|
repoUrl: "https://github.com/mindspore-ai/mindspore"
|
|
4927
4970
|
},
|
|
4971
|
+
"mars5-tts": {
|
|
4972
|
+
prettyLabel: "MARS5-TTS",
|
|
4973
|
+
repoName: "MARS5-TTS",
|
|
4974
|
+
repoUrl: "https://github.com/Camb-ai/MARS5-TTS",
|
|
4975
|
+
filter: false,
|
|
4976
|
+
countDownloads: `path:"mars5_ar.safetensors"`,
|
|
4977
|
+
snippets: mars5_tts
|
|
4978
|
+
},
|
|
4928
4979
|
"ml-agents": {
|
|
4929
4980
|
prettyLabel: "ml-agents",
|
|
4930
4981
|
repoName: "ml-agents",
|
|
@@ -5160,6 +5211,8 @@ var MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
5160
5211
|
prettyLabel: "WhisperKit",
|
|
5161
5212
|
repoName: "WhisperKit",
|
|
5162
5213
|
repoUrl: "https://github.com/argmaxinc/WhisperKit",
|
|
5214
|
+
docsUrl: "https://github.com/argmaxinc/WhisperKit?tab=readme-ov-file#homebrew",
|
|
5215
|
+
snippets: whisperkit,
|
|
5163
5216
|
countDownloads: `path_filename:"model" AND path_extension:"mil" AND _exists_:"path_prefix"`
|
|
5164
5217
|
}
|
|
5165
5218
|
};
|
|
@@ -5207,39 +5260,39 @@ var inputsZeroShotClassification = () => `"Hi, I recently bought a device from y
|
|
|
5207
5260
|
var inputsTranslation = () => `"\u041C\u0435\u043D\u044F \u0437\u043E\u0432\u0443\u0442 \u0412\u043E\u043B\u044C\u0444\u0433\u0430\u043D\u0433 \u0438 \u044F \u0436\u0438\u0432\u0443 \u0432 \u0411\u0435\u0440\u043B\u0438\u043D\u0435"`;
|
|
5208
5261
|
var inputsSummarization = () => `"The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."`;
|
|
5209
5262
|
var inputsTableQuestionAnswering = () => `{
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5263
|
+
"query": "How many stars does the transformers repository have?",
|
|
5264
|
+
"table": {
|
|
5265
|
+
"Repository": ["Transformers", "Datasets", "Tokenizers"],
|
|
5266
|
+
"Stars": ["36542", "4512", "3934"],
|
|
5267
|
+
"Contributors": ["651", "77", "34"],
|
|
5268
|
+
"Programming language": [
|
|
5269
|
+
"Python",
|
|
5270
|
+
"Python",
|
|
5271
|
+
"Rust, Python and NodeJS"
|
|
5272
|
+
]
|
|
5273
|
+
}
|
|
5274
|
+
}`;
|
|
5222
5275
|
var inputsVisualQuestionAnswering = () => `{
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5276
|
+
"image": "cat.png",
|
|
5277
|
+
"question": "What is in this image?"
|
|
5278
|
+
}`;
|
|
5226
5279
|
var inputsQuestionAnswering = () => `{
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5280
|
+
"question": "What is my name?",
|
|
5281
|
+
"context": "My name is Clara and I live in Berkeley."
|
|
5282
|
+
}`;
|
|
5230
5283
|
var inputsTextClassification = () => `"I like you. I love you"`;
|
|
5231
5284
|
var inputsTokenClassification = () => `"My name is Sarah Jessica Parker but you can call me Jessica"`;
|
|
5232
5285
|
var inputsTextGeneration = () => `"Can you please let us know more details about your "`;
|
|
5233
5286
|
var inputsText2TextGeneration = () => `"The answer to the universe is"`;
|
|
5234
5287
|
var inputsFillMask = (model) => `"The answer to the universe is ${model.mask_token}."`;
|
|
5235
5288
|
var inputsSentenceSimilarity = () => `{
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5289
|
+
"source_sentence": "That is a happy person",
|
|
5290
|
+
"sentences": [
|
|
5291
|
+
"That is a happy dog",
|
|
5292
|
+
"That is a very happy person",
|
|
5293
|
+
"Today is a sunny day"
|
|
5294
|
+
]
|
|
5295
|
+
}`;
|
|
5243
5296
|
var inputsFeatureExtraction = () => `"Today is a sunny day and I will get some ice cream."`;
|
|
5244
5297
|
var inputsImageClassification = () => `"cats.jpg"`;
|
|
5245
5298
|
var inputsImageToText = () => `"cats.jpg"`;
|
|
@@ -5308,6 +5361,7 @@ __export(curl_exports, {
|
|
|
5308
5361
|
hasCurlInferenceSnippet: () => hasCurlInferenceSnippet,
|
|
5309
5362
|
snippetBasic: () => snippetBasic,
|
|
5310
5363
|
snippetFile: () => snippetFile,
|
|
5364
|
+
snippetTextGeneration: () => snippetTextGeneration,
|
|
5311
5365
|
snippetZeroShotClassification: () => snippetZeroShotClassification
|
|
5312
5366
|
});
|
|
5313
5367
|
var snippetBasic = (model, accessToken) => `curl https://api-inference.huggingface.co/models/${model.id} \\
|
|
@@ -5316,6 +5370,22 @@ var snippetBasic = (model, accessToken) => `curl https://api-inference.huggingfa
|
|
|
5316
5370
|
-H 'Content-Type: application/json' \\
|
|
5317
5371
|
-H "Authorization: Bearer ${accessToken || `{API_TOKEN}`}"
|
|
5318
5372
|
`;
|
|
5373
|
+
var snippetTextGeneration = (model, accessToken) => {
|
|
5374
|
+
if (model.config?.tokenizer_config?.chat_template) {
|
|
5375
|
+
return `curl 'https://api-inference.huggingface.co/models/${model.id}/v1/chat/completions' \\
|
|
5376
|
+
-H "Authorization: Bearer ${accessToken || `{API_TOKEN}`}" \\
|
|
5377
|
+
-H 'Content-Type: application/json' \\
|
|
5378
|
+
-d '{
|
|
5379
|
+
"model": "${model.id}",
|
|
5380
|
+
"messages": [{"role": "user", "content": "What is the capital of France?"}],
|
|
5381
|
+
"max_tokens": 500,
|
|
5382
|
+
"stream": false
|
|
5383
|
+
}'
|
|
5384
|
+
`;
|
|
5385
|
+
} else {
|
|
5386
|
+
return snippetBasic(model, accessToken);
|
|
5387
|
+
}
|
|
5388
|
+
};
|
|
5319
5389
|
var snippetZeroShotClassification = (model, accessToken) => `curl https://api-inference.huggingface.co/models/${model.id} \\
|
|
5320
5390
|
-X POST \\
|
|
5321
5391
|
-d '{"inputs": ${getModelInputSnippet(model, true)}, "parameters": {"candidate_labels": ["refund", "legal", "faq"]}}' \\
|
|
@@ -5337,7 +5407,7 @@ var curlSnippets = {
|
|
|
5337
5407
|
translation: snippetBasic,
|
|
5338
5408
|
summarization: snippetBasic,
|
|
5339
5409
|
"feature-extraction": snippetBasic,
|
|
5340
|
-
"text-generation":
|
|
5410
|
+
"text-generation": snippetTextGeneration,
|
|
5341
5411
|
"text2text-generation": snippetBasic,
|
|
5342
5412
|
"fill-mask": snippetBasic,
|
|
5343
5413
|
"sentence-similarity": snippetBasic,
|
|
@@ -5366,6 +5436,7 @@ __export(python_exports, {
|
|
|
5366
5436
|
hasPythonInferenceSnippet: () => hasPythonInferenceSnippet,
|
|
5367
5437
|
pythonSnippets: () => pythonSnippets,
|
|
5368
5438
|
snippetBasic: () => snippetBasic2,
|
|
5439
|
+
snippetConversational: () => snippetConversational,
|
|
5369
5440
|
snippetDocumentQuestionAnswering: () => snippetDocumentQuestionAnswering,
|
|
5370
5441
|
snippetFile: () => snippetFile2,
|
|
5371
5442
|
snippetTabular: () => snippetTabular,
|
|
@@ -5374,6 +5445,20 @@ __export(python_exports, {
|
|
|
5374
5445
|
snippetZeroShotClassification: () => snippetZeroShotClassification2,
|
|
5375
5446
|
snippetZeroShotImageClassification: () => snippetZeroShotImageClassification
|
|
5376
5447
|
});
|
|
5448
|
+
var snippetConversational = (model, accessToken) => `from huggingface_hub import InferenceClient
|
|
5449
|
+
|
|
5450
|
+
client = InferenceClient(
|
|
5451
|
+
"${model.id}",
|
|
5452
|
+
token="${accessToken || "{API_TOKEN}"}",
|
|
5453
|
+
)
|
|
5454
|
+
|
|
5455
|
+
for message in client.chat_completion(
|
|
5456
|
+
messages=[{"role": "user", "content": "What is the capital of France?"}],
|
|
5457
|
+
max_tokens=500,
|
|
5458
|
+
stream=True,
|
|
5459
|
+
):
|
|
5460
|
+
print(message.choices[0].delta.content, end="")
|
|
5461
|
+
`;
|
|
5377
5462
|
var snippetZeroShotClassification2 = (model) => `def query(payload):
|
|
5378
5463
|
response = requests.post(API_URL, headers=headers, json=payload)
|
|
5379
5464
|
return response.json()
|
|
@@ -5491,13 +5576,17 @@ var pythonSnippets = {
|
|
|
5491
5576
|
"zero-shot-image-classification": snippetZeroShotImageClassification
|
|
5492
5577
|
};
|
|
5493
5578
|
function getPythonInferenceSnippet(model, accessToken) {
|
|
5494
|
-
|
|
5495
|
-
|
|
5579
|
+
if (model.pipeline_tag === "text-generation" && model.config?.tokenizer_config?.chat_template) {
|
|
5580
|
+
return snippetConversational(model, accessToken);
|
|
5581
|
+
} else {
|
|
5582
|
+
const body = model.pipeline_tag && model.pipeline_tag in pythonSnippets ? pythonSnippets[model.pipeline_tag]?.(model, accessToken) ?? "" : "";
|
|
5583
|
+
return `import requests
|
|
5496
5584
|
|
|
5497
5585
|
API_URL = "https://api-inference.huggingface.co/models/${model.id}"
|
|
5498
5586
|
headers = {"Authorization": ${accessToken ? `"Bearer ${accessToken}"` : `f"Bearer {API_TOKEN}"`}}
|
|
5499
5587
|
|
|
5500
5588
|
${body}`;
|
|
5589
|
+
}
|
|
5501
5590
|
}
|
|
5502
5591
|
function hasPythonInferenceSnippet(model) {
|
|
5503
5592
|
return !!model.pipeline_tag && model.pipeline_tag in pythonSnippets;
|
|
@@ -5511,6 +5600,7 @@ __export(js_exports, {
|
|
|
5511
5600
|
jsSnippets: () => jsSnippets,
|
|
5512
5601
|
snippetBasic: () => snippetBasic3,
|
|
5513
5602
|
snippetFile: () => snippetFile3,
|
|
5603
|
+
snippetTextGeneration: () => snippetTextGeneration2,
|
|
5514
5604
|
snippetTextToAudio: () => snippetTextToAudio2,
|
|
5515
5605
|
snippetTextToImage: () => snippetTextToImage2,
|
|
5516
5606
|
snippetZeroShotClassification: () => snippetZeroShotClassification3
|
|
@@ -5519,7 +5609,10 @@ var snippetBasic3 = (model, accessToken) => `async function query(data) {
|
|
|
5519
5609
|
const response = await fetch(
|
|
5520
5610
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
5521
5611
|
{
|
|
5522
|
-
headers: {
|
|
5612
|
+
headers: {
|
|
5613
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
5614
|
+
"Content-Type": "application/json",
|
|
5615
|
+
},
|
|
5523
5616
|
method: "POST",
|
|
5524
5617
|
body: JSON.stringify(data),
|
|
5525
5618
|
}
|
|
@@ -5531,11 +5624,32 @@ var snippetBasic3 = (model, accessToken) => `async function query(data) {
|
|
|
5531
5624
|
query({"inputs": ${getModelInputSnippet(model)}}).then((response) => {
|
|
5532
5625
|
console.log(JSON.stringify(response));
|
|
5533
5626
|
});`;
|
|
5627
|
+
var snippetTextGeneration2 = (model, accessToken) => {
|
|
5628
|
+
if (model.config?.tokenizer_config?.chat_template) {
|
|
5629
|
+
return `import { HfInference } from "@huggingface/inference";
|
|
5630
|
+
|
|
5631
|
+
const inference = new HfInference("${accessToken || `{API_TOKEN}`}");
|
|
5632
|
+
|
|
5633
|
+
for await (const chunk of inference.chatCompletionStream({
|
|
5634
|
+
model: "${model.id}",
|
|
5635
|
+
messages: [{ role: "user", content: "What is the capital of France?" }],
|
|
5636
|
+
max_tokens: 500,
|
|
5637
|
+
})) {
|
|
5638
|
+
process.stdout.write(chunk.choices[0]?.delta?.content || "");
|
|
5639
|
+
}
|
|
5640
|
+
`;
|
|
5641
|
+
} else {
|
|
5642
|
+
return snippetBasic3(model, accessToken);
|
|
5643
|
+
}
|
|
5644
|
+
};
|
|
5534
5645
|
var snippetZeroShotClassification3 = (model, accessToken) => `async function query(data) {
|
|
5535
5646
|
const response = await fetch(
|
|
5536
5647
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
5537
5648
|
{
|
|
5538
|
-
headers: {
|
|
5649
|
+
headers: {
|
|
5650
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
5651
|
+
"Content-Type": "application/json",
|
|
5652
|
+
},
|
|
5539
5653
|
method: "POST",
|
|
5540
5654
|
body: JSON.stringify(data),
|
|
5541
5655
|
}
|
|
@@ -5553,7 +5667,10 @@ var snippetTextToImage2 = (model, accessToken) => `async function query(data) {
|
|
|
5553
5667
|
const response = await fetch(
|
|
5554
5668
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
5555
5669
|
{
|
|
5556
|
-
headers: {
|
|
5670
|
+
headers: {
|
|
5671
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
5672
|
+
"Content-Type": "application/json",
|
|
5673
|
+
},
|
|
5557
5674
|
method: "POST",
|
|
5558
5675
|
body: JSON.stringify(data),
|
|
5559
5676
|
}
|
|
@@ -5569,7 +5686,10 @@ var snippetTextToAudio2 = (model, accessToken) => {
|
|
|
5569
5686
|
const response = await fetch(
|
|
5570
5687
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
5571
5688
|
{
|
|
5572
|
-
headers: {
|
|
5689
|
+
headers: {
|
|
5690
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
5691
|
+
"Content-Type": "application/json",
|
|
5692
|
+
},
|
|
5573
5693
|
method: "POST",
|
|
5574
5694
|
body: JSON.stringify(data),
|
|
5575
5695
|
}
|
|
@@ -5598,7 +5718,10 @@ var snippetFile3 = (model, accessToken) => `async function query(filename) {
|
|
|
5598
5718
|
const response = await fetch(
|
|
5599
5719
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
5600
5720
|
{
|
|
5601
|
-
headers: {
|
|
5721
|
+
headers: {
|
|
5722
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
5723
|
+
"Content-Type": "application/json",
|
|
5724
|
+
},
|
|
5602
5725
|
method: "POST",
|
|
5603
5726
|
body: data,
|
|
5604
5727
|
}
|
|
@@ -5620,7 +5743,7 @@ var jsSnippets = {
|
|
|
5620
5743
|
translation: snippetBasic3,
|
|
5621
5744
|
summarization: snippetBasic3,
|
|
5622
5745
|
"feature-extraction": snippetBasic3,
|
|
5623
|
-
"text-generation":
|
|
5746
|
+
"text-generation": snippetTextGeneration2,
|
|
5624
5747
|
"text2text-generation": snippetBasic3,
|
|
5625
5748
|
"fill-mask": snippetBasic3,
|
|
5626
5749
|
"sentence-similarity": snippetBasic3,
|
|
@@ -6082,7 +6205,7 @@ var LOCAL_APPS = {
|
|
|
6082
6205
|
docsUrl: "https://lmstudio.ai",
|
|
6083
6206
|
mainTask: "text-generation",
|
|
6084
6207
|
displayOnModelPage: isGgufModel,
|
|
6085
|
-
deeplink: (model, filepath) => new URL(`lmstudio://open_from_hf?model=${model.id}
|
|
6208
|
+
deeplink: (model, filepath) => new URL(`lmstudio://open_from_hf?model=${model.id}${filepath ? `&file=${filepath}` : ""}`)
|
|
6086
6209
|
},
|
|
6087
6210
|
jan: {
|
|
6088
6211
|
prettyLabel: "Jan",
|
|
@@ -15,6 +15,8 @@ export declare const flair: (model: ModelData) => string[];
|
|
|
15
15
|
export declare const gliner: (model: ModelData) => string[];
|
|
16
16
|
export declare const keras: (model: ModelData) => string[];
|
|
17
17
|
export declare const keras_nlp: (model: ModelData) => string[];
|
|
18
|
+
export declare const tf_keras: (model: ModelData) => string[];
|
|
19
|
+
export declare const mars5_tts: (model: ModelData) => string[];
|
|
18
20
|
export declare const open_clip: (model: ModelData) => string[];
|
|
19
21
|
export declare const paddlenlp: (model: ModelData) => string[];
|
|
20
22
|
export declare const pyannote_audio_pipeline: (model: ModelData) => string[];
|
|
@@ -45,4 +47,5 @@ export declare const mlxim: (model: ModelData) => string[];
|
|
|
45
47
|
export declare const nemo: (model: ModelData) => string[];
|
|
46
48
|
export declare const pythae: (model: ModelData) => string[];
|
|
47
49
|
export declare const audiocraft: (model: ModelData) => string[];
|
|
50
|
+
export declare const whisperkit: () => string[];
|
|
48
51
|
//# sourceMappingURL=model-libraries-snippets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAY9C,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAKjD,CAAC;AAkBF,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAKjD,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EAkBlD,CAAC;AAMF,eAAO,MAAM,QAAQ,UAAW,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,SAAS,KAAG,MAAM,EAI9C,CAAC;AA+BF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EAUlD,CAAC;AAEF,eAAO,MAAM,MAAM,UAAW,SAAS,KAAG,MAAM,EAgB/C,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EAMlD,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,KAAG,MAAM,EASlD,CAAC;AAIF,eAAO,MAAM,MAAM,UAAW,SAAS,KAAG,MAAM,EAO/C,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,SAAS,KAAG,MAAM,EAMhD,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,MAAM,UAAW,SAAS,KAAG,MAAM,EAI/C,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,SAAS,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAY9C,eAAO,MAAM,QA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C;AAEF,eAAO,MAAM,MAAM,QAA6B,MAAM,EAMrD,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,SAAS,KAAG,MAAM,EAInD,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,MAAM,EAYhC,CAAC;AAEF,eAAO,MAAM,GAAG,UAAW,SAAS,KAAG,MAAM,EAK5C,CAAC;AAEF,eAAO,MAAM,KAAK,UAAW,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,SAAS,KAAG,MAAM,EAQ7C,CAAC;AAEF,eAAO,MAAM,MAAM,UAAW,SAAS,KAAG,MAAM,EAI/C,CAAC;AA6BF,eAAO,MAAM,UAAU,UAAW,SAAS,KAAG,MAAM,EAUnD,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAYnC,CAAC"}
|
|
@@ -86,6 +86,7 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
86
86
|
repoUrl: string;
|
|
87
87
|
snippets: (model: ModelData) => string[];
|
|
88
88
|
filter: false;
|
|
89
|
+
countDownloads: string;
|
|
89
90
|
};
|
|
90
91
|
audioseal: {
|
|
91
92
|
prettyLabel: string;
|
|
@@ -238,6 +239,15 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
238
239
|
filter: true;
|
|
239
240
|
countDownloads: string;
|
|
240
241
|
};
|
|
242
|
+
"tf-keras": {
|
|
243
|
+
prettyLabel: string;
|
|
244
|
+
repoName: string;
|
|
245
|
+
repoUrl: string;
|
|
246
|
+
docsUrl: string;
|
|
247
|
+
snippets: (model: ModelData) => string[];
|
|
248
|
+
filter: true;
|
|
249
|
+
countDownloads: string;
|
|
250
|
+
};
|
|
241
251
|
"keras-nlp": {
|
|
242
252
|
prettyLabel: string;
|
|
243
253
|
repoName: string;
|
|
@@ -255,6 +265,14 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
255
265
|
repoName: string;
|
|
256
266
|
repoUrl: string;
|
|
257
267
|
};
|
|
268
|
+
"mars5-tts": {
|
|
269
|
+
prettyLabel: string;
|
|
270
|
+
repoName: string;
|
|
271
|
+
repoUrl: string;
|
|
272
|
+
filter: false;
|
|
273
|
+
countDownloads: string;
|
|
274
|
+
snippets: (model: ModelData) => string[];
|
|
275
|
+
};
|
|
258
276
|
"ml-agents": {
|
|
259
277
|
prettyLabel: string;
|
|
260
278
|
repoName: string;
|
|
@@ -490,10 +508,12 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
490
508
|
prettyLabel: string;
|
|
491
509
|
repoName: string;
|
|
492
510
|
repoUrl: string;
|
|
511
|
+
docsUrl: string;
|
|
512
|
+
snippets: () => string[];
|
|
493
513
|
countDownloads: string;
|
|
494
514
|
};
|
|
495
515
|
};
|
|
496
516
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
497
|
-
export declare const ALL_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "bm25s" | "chat_tts" | "diffusers" | "doctr" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hunyuan-dit" | "keras" | "keras-nlp" | "k2" | "mindspore" | "ml-agents" | "mlx" | "mlx-image" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "pythae" | "recurrentgemma" | "sample-factory" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "stable-audio-tools" | "diffusion-single-file" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "voicecraft" | "whisperkit")[];
|
|
498
|
-
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "bm25s" | "chat_tts" | "diffusers" | "doctr" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hunyuan-dit" | "keras" | "keras-nlp" | "k2" | "mindspore" | "ml-agents" | "mlx" | "mlx-image" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "pythae" | "recurrentgemma" | "sample-factory" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "stable-audio-tools" | "diffusion-single-file" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "voicecraft" | "whisperkit")[];
|
|
517
|
+
export declare const ALL_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "bm25s" | "chat_tts" | "diffusers" | "doctr" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hunyuan-dit" | "keras" | "tf-keras" | "keras-nlp" | "k2" | "mindspore" | "mars5-tts" | "ml-agents" | "mlx" | "mlx-image" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "pythae" | "recurrentgemma" | "sample-factory" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "stable-audio-tools" | "diffusion-single-file" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "voicecraft" | "whisperkit")[];
|
|
518
|
+
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "asteroid" | "audiocraft" | "audioseal" | "bertopic" | "big_vision" | "bm25s" | "chat_tts" | "diffusers" | "doctr" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hunyuan-dit" | "keras" | "tf-keras" | "keras-nlp" | "k2" | "mindspore" | "mars5-tts" | "ml-agents" | "mlx" | "mlx-image" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "pythae" | "recurrentgemma" | "sample-factory" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "stable-audio-tools" | "diffusion-single-file" | "stable-baselines3" | "stanza" | "tensorflowtts" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "unity-sentis" | "voicecraft" | "whisperkit")[];
|
|
499
519
|
//# 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,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"model-libraries.d.ts","sourceRoot":"","sources":["../../src/model-libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAA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BAA8B,8zBAQ1B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PipelineType } from "../pipelines.js";
|
|
2
2
|
import type { ModelDataMinimal } from "./types.js";
|
|
3
3
|
export declare const snippetBasic: (model: ModelDataMinimal, accessToken: string) => string;
|
|
4
|
+
export declare const snippetTextGeneration: (model: ModelDataMinimal, accessToken: string) => string;
|
|
4
5
|
export declare const snippetZeroShotClassification: (model: ModelDataMinimal, accessToken: string) => string;
|
|
5
6
|
export declare const snippetFile: (model: ModelDataMinimal, accessToken: string) => string;
|
|
6
7
|
export declare const curlSnippets: Partial<Record<PipelineType, (model: ModelDataMinimal, accessToken: string) => string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/snippets/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,YAAY,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAM3E,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAM5F,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAK1E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC,CAwBhH,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI5F;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,cAAc,CAAC,GAAG,OAAO,CAE9F"}
|
|
1
|
+
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/snippets/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,YAAY,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAM3E,CAAC;AAEF,eAAO,MAAM,qBAAqB,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAgBpF,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAM5F,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAK1E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC,CAwBhH,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI5F;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,cAAc,CAAC,GAAG,OAAO,CAE9F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PipelineType } from "../pipelines.js";
|
|
2
2
|
import type { ModelDataMinimal } from "./types.js";
|
|
3
3
|
export declare const snippetBasic: (model: ModelDataMinimal, accessToken: string) => string;
|
|
4
|
+
export declare const snippetTextGeneration: (model: ModelDataMinimal, accessToken: string) => string;
|
|
4
5
|
export declare const snippetZeroShotClassification: (model: ModelDataMinimal, accessToken: string) => string;
|
|
5
6
|
export declare const snippetTextToImage: (model: ModelDataMinimal, accessToken: string) => string;
|
|
6
7
|
export declare const snippetTextToAudio: (model: ModelDataMinimal, accessToken: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/snippets/js.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,YAAY,UAAW,gBAAgB,eAAe,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/snippets/js.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,YAAY,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAmBxE,CAAC;AAEL,eAAO,MAAM,qBAAqB,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAkBpF,CAAC;AACF,eAAO,MAAM,6BAA6B,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAqBzF,CAAC;AAEL,eAAO,MAAM,kBAAkB,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAkB9E,CAAC;AAEL,eAAO,MAAM,kBAAkB,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAqCjF,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,eAAe,MAAM,KAAG,MAoBvE,CAAC;AAEL,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC,CAwB9G,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI1F;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAEtE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PipelineType } from "../pipelines.js";
|
|
2
2
|
import type { ModelDataMinimal } from "./types.js";
|
|
3
|
+
export declare const snippetConversational: (model: ModelDataMinimal, accessToken: string) => string;
|
|
3
4
|
export declare const snippetZeroShotClassification: (model: ModelDataMinimal) => string;
|
|
4
5
|
export declare const snippetZeroShotImageClassification: (model: ModelDataMinimal) => string;
|
|
5
6
|
export declare const snippetBasic: (model: ModelDataMinimal) => string;
|
|
@@ -8,7 +9,7 @@ export declare const snippetTextToImage: (model: ModelDataMinimal) => string;
|
|
|
8
9
|
export declare const snippetTabular: (model: ModelDataMinimal) => string;
|
|
9
10
|
export declare const snippetTextToAudio: (model: ModelDataMinimal) => string;
|
|
10
11
|
export declare const snippetDocumentQuestionAnswering: (model: ModelDataMinimal) => string;
|
|
11
|
-
export declare const pythonSnippets: Partial<Record<PipelineType, (model: ModelDataMinimal) => string>>;
|
|
12
|
+
export declare const pythonSnippets: Partial<Record<PipelineType, (model: ModelDataMinimal, accessToken: string) => string>>;
|
|
12
13
|
export declare function getPythonInferenceSnippet(model: ModelDataMinimal, accessToken: string): string;
|
|
13
14
|
export declare function hasPythonInferenceSnippet(model: ModelDataMinimal): boolean;
|
|
14
15
|
//# sourceMappingURL=python.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../../src/snippets/python.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,6BAA6B,UAAW,gBAAgB,KAAG,MAQrE,CAAC;AAEJ,eAAO,MAAM,kCAAkC,UAAW,gBAAgB,KAAG,MAc1E,CAAC;AAEJ,eAAO,MAAM,YAAY,UAAW,gBAAgB,KAAG,MAOpD,CAAC;AAEJ,eAAO,MAAM,WAAW,UAAW,gBAAgB,KAAG,MAOP,CAAC;AAEhD,eAAO,MAAM,kBAAkB,UAAW,gBAAgB,KA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,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAiB9F;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAE1E"}
|
|
@@ -4,5 +4,5 @@ import type { ModelData } from "../model-data";
|
|
|
4
4
|
*
|
|
5
5
|
* Add more fields as needed.
|
|
6
6
|
*/
|
|
7
|
-
export type ModelDataMinimal = Pick<ModelData, "id" | "pipeline_tag" | "mask_token" | "library_name">;
|
|
7
|
+
export type ModelDataMinimal = Pick<ModelData, "id" | "pipeline_tag" | "mask_token" | "library_name" | "config">;
|
|
8
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/snippets/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/snippets/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,GAAG,QAAQ,CAAC,CAAC"}
|
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.10.
|
|
4
|
+
"version": "0.10.22",
|
|
5
5
|
"description": "List of ML tasks for huggingface.co/tasks",
|
|
6
6
|
"repository": "https://github.com/huggingface/huggingface.js.git",
|
|
7
7
|
"publishConfig": {
|
package/src/local-apps.ts
CHANGED
|
@@ -97,7 +97,7 @@ export const LOCAL_APPS = {
|
|
|
97
97
|
mainTask: "text-generation",
|
|
98
98
|
displayOnModelPage: isGgufModel,
|
|
99
99
|
deeplink: (model, filepath) =>
|
|
100
|
-
new URL(`lmstudio://open_from_hf?model=${model.id}
|
|
100
|
+
new URL(`lmstudio://open_from_hf?model=${model.id}${filepath ? `&file=${filepath}` : ""}`),
|
|
101
101
|
},
|
|
102
102
|
jan: {
|
|
103
103
|
prettyLabel: "Jan",
|
|
@@ -192,14 +192,19 @@ model = GLiNER.from_pretrained("${model.id}")`,
|
|
|
192
192
|
];
|
|
193
193
|
|
|
194
194
|
export const keras = (model: ModelData): string[] => [
|
|
195
|
-
|
|
195
|
+
`# Available backend options are: "jax", "tensorflow", "torch".
|
|
196
|
+
import os
|
|
197
|
+
os.environ["KERAS_BACKEND"] = "tensorflow"
|
|
198
|
+
|
|
199
|
+
import keras
|
|
196
200
|
|
|
197
|
-
model =
|
|
201
|
+
model = keras.saving.load_model("hf://${model.id}")
|
|
198
202
|
`,
|
|
199
203
|
];
|
|
200
204
|
|
|
201
205
|
export const keras_nlp = (model: ModelData): string[] => [
|
|
202
206
|
`# Available backend options are: "jax", "tensorflow", "torch".
|
|
207
|
+
import os
|
|
203
208
|
os.environ["KERAS_BACKEND"] = "tensorflow"
|
|
204
209
|
|
|
205
210
|
import keras_nlp
|
|
@@ -209,6 +214,22 @@ backbone = keras_nlp.models.Backbone.from_preset("hf://${model.id}")
|
|
|
209
214
|
`,
|
|
210
215
|
];
|
|
211
216
|
|
|
217
|
+
export const tf_keras = (model: ModelData): string[] => [
|
|
218
|
+
`# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy)
|
|
219
|
+
# See https://github.com/keras-team/tf-keras for more details.
|
|
220
|
+
from huggingface_hub import from_pretrained_keras
|
|
221
|
+
|
|
222
|
+
model = from_pretrained_keras("${model.id}")
|
|
223
|
+
`,
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
export const mars5_tts = (model: ModelData): string[] => [
|
|
227
|
+
`# Install from https://github.com/Camb-ai/MARS5-TTS
|
|
228
|
+
|
|
229
|
+
from inference import Mars5TTS
|
|
230
|
+
mars5 = Mars5TTS.from_pretrained("${model.id}")`,
|
|
231
|
+
];
|
|
232
|
+
|
|
212
233
|
export const open_clip = (model: ModelData): string[] => [
|
|
213
234
|
`import open_clip
|
|
214
235
|
|
|
@@ -715,4 +736,18 @@ export const audiocraft = (model: ModelData): string[] => {
|
|
|
715
736
|
return [`# Type of model unknown.`];
|
|
716
737
|
}
|
|
717
738
|
};
|
|
739
|
+
|
|
740
|
+
export const whisperkit = (): string[] => [
|
|
741
|
+
`# Install CLI with Homebrew on macOS device
|
|
742
|
+
brew install whisperkit-cli
|
|
743
|
+
|
|
744
|
+
# View all available inference options
|
|
745
|
+
whisperkit-cli transcribe --help
|
|
746
|
+
|
|
747
|
+
# Download and run inference using whisper base model
|
|
748
|
+
whisperkit-cli transcribe --audio-path /path/to/audio.mp3
|
|
749
|
+
|
|
750
|
+
# Or use your preferred model variant
|
|
751
|
+
whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose`,
|
|
752
|
+
];
|
|
718
753
|
//#endregion
|