@huggingface/tasks 0.16.5 → 0.16.6
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/commonjs/model-libraries.d.ts +7 -1
- package/dist/commonjs/model-libraries.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.js +6 -0
- package/dist/commonjs/snippets/inputs.d.ts.map +1 -1
- package/dist/commonjs/snippets/inputs.js +2 -0
- package/dist/commonjs/snippets/js.d.ts +1 -0
- package/dist/commonjs/snippets/js.d.ts.map +1 -1
- package/dist/commonjs/snippets/js.js +25 -1
- package/dist/commonjs/snippets/python.d.ts +1 -0
- package/dist/commonjs/snippets/python.d.ts.map +1 -1
- package/dist/commonjs/snippets/python.js +19 -1
- package/dist/commonjs/tasks/text-to-video/data.js +1 -1
- package/dist/esm/model-libraries.d.ts +7 -1
- package/dist/esm/model-libraries.d.ts.map +1 -1
- package/dist/esm/model-libraries.js +6 -0
- package/dist/esm/snippets/inputs.d.ts.map +1 -1
- package/dist/esm/snippets/inputs.js +2 -0
- package/dist/esm/snippets/js.d.ts +1 -0
- package/dist/esm/snippets/js.d.ts.map +1 -1
- package/dist/esm/snippets/js.js +23 -0
- package/dist/esm/snippets/python.d.ts +1 -0
- package/dist/esm/snippets/python.d.ts.map +1 -1
- package/dist/esm/snippets/python.js +17 -0
- package/dist/esm/tasks/text-to-video/data.js +1 -1
- package/package.json +1 -1
- package/src/model-libraries.ts +6 -0
- package/src/snippets/inputs.ts +3 -0
- package/src/snippets/js.ts +28 -0
- package/src/snippets/python.ts +22 -0
- package/src/tasks/text-to-video/data.ts +1 -1
|
@@ -389,6 +389,12 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
389
389
|
repoUrl: string;
|
|
390
390
|
countDownloads: string;
|
|
391
391
|
};
|
|
392
|
+
"hunyuan3d-2": {
|
|
393
|
+
prettyLabel: string;
|
|
394
|
+
repoName: string;
|
|
395
|
+
repoUrl: string;
|
|
396
|
+
countDownloads: string;
|
|
397
|
+
};
|
|
392
398
|
imstoucan: {
|
|
393
399
|
prettyLabel: string;
|
|
394
400
|
repoName: string;
|
|
@@ -914,5 +920,5 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
914
920
|
};
|
|
915
921
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
916
922
|
export declare const ALL_MODEL_LIBRARY_KEYS: ModelLibraryKey[];
|
|
917
|
-
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "anemoi" | "asteroid" | "audiocraft" | "audioseal" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cosyvoice" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "htrflow" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-hub" | "k2" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "merlin" | "mitie" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open-oasis" | "open_clip" | "paddlenlp" | "peft" | "pxia" | "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" | "swarmformer" | "f5-tts" | "genmo" | "tensorflowtts" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "unity-sentis" | "sana" | "vfi-mamba" | "voicecraft" | "whisperkit" | "yolov10" | "3dtopia-xl")[];
|
|
923
|
+
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "anemoi" | "asteroid" | "audiocraft" | "audioseal" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cosyvoice" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "htrflow" | "hunyuan-dit" | "hunyuan3d-2" | "imstoucan" | "keras" | "tf-keras" | "keras-hub" | "k2" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "merlin" | "mitie" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open-oasis" | "open_clip" | "paddlenlp" | "peft" | "pxia" | "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" | "swarmformer" | "f5-tts" | "genmo" | "tensorflowtts" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "unity-sentis" | "sana" | "vfi-mamba" | "voicecraft" | "whisperkit" | "yolov10" | "3dtopia-xl")[];
|
|
918
924
|
//# 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,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;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,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;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,KAA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;;;;;;CAs2BI,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,EAA+C,eAAe,EAAE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,wkDAQ1B,CAAC"}
|
|
@@ -376,6 +376,12 @@ exports.MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
376
376
|
repoUrl: "https://github.com/Tencent/HunyuanDiT",
|
|
377
377
|
countDownloads: `path:"pytorch_model_ema.pt" OR path:"pytorch_model_distill.pt"`,
|
|
378
378
|
},
|
|
379
|
+
"hunyuan3d-2": {
|
|
380
|
+
prettyLabel: "Hunyuan3D-2",
|
|
381
|
+
repoName: "Hunyuan3D-2",
|
|
382
|
+
repoUrl: "https://github.com/Tencent/Hunyuan3D-2",
|
|
383
|
+
countDownloads: `path:"model_index.json" OR path:"config.yaml"`,
|
|
384
|
+
},
|
|
379
385
|
imstoucan: {
|
|
380
386
|
prettyLabel: "IMS Toucan",
|
|
381
387
|
repoName: "IMS-Toucan",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/snippets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/snippets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAgJnD,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,gBAAgB,EACvB,MAAM,UAAQ,EACd,QAAQ,UAAQ,GACd,MAAM,GAAG,0BAA0B,EAAE,CAmBvC"}
|
|
@@ -69,6 +69,7 @@ const inputsObjectDetection = () => `"cats.jpg"`;
|
|
|
69
69
|
const inputsAudioToAudio = () => `"sample1.flac"`;
|
|
70
70
|
const inputsAudioClassification = () => `"sample1.flac"`;
|
|
71
71
|
const inputsTextToImage = () => `"Astronaut riding a horse"`;
|
|
72
|
+
const inputsTextToVideo = () => `"A young man walking on the street"`;
|
|
72
73
|
const inputsTextToSpeech = () => `"The answer to the universe is 42"`;
|
|
73
74
|
const inputsTextToAudio = () => `"liquid drum and bass, atmospheric synths, airy sounds"`;
|
|
74
75
|
const inputsAutomaticSpeechRecognition = () => `"sample1.flac"`;
|
|
@@ -95,6 +96,7 @@ const modelInputSnippets = {
|
|
|
95
96
|
"text-generation": inputsTextGeneration,
|
|
96
97
|
"image-text-to-text": inputsTextGeneration,
|
|
97
98
|
"text-to-image": inputsTextToImage,
|
|
99
|
+
"text-to-video": inputsTextToVideo,
|
|
98
100
|
"text-to-speech": inputsTextToSpeech,
|
|
99
101
|
"text-to-audio": inputsTextToAudio,
|
|
100
102
|
"text2text-generation": inputsText2TextGeneration,
|
|
@@ -12,6 +12,7 @@ export declare const snippetTextGeneration: (model: ModelDataMinimal, accessToke
|
|
|
12
12
|
}) => InferenceSnippet[];
|
|
13
13
|
export declare const snippetZeroShotClassification: (model: ModelDataMinimal, accessToken: string) => InferenceSnippet[];
|
|
14
14
|
export declare const snippetTextToImage: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
15
|
+
export declare const snippetTextToVideo: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
15
16
|
export declare const snippetTextToAudio: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
16
17
|
export declare const snippetAutomaticSpeechRecognition: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
17
18
|
export declare const snippetFile: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider)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BAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EA4ClB,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAqBlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAgDlB,CAAC;AAEF,eAAO,MAAM,iCAAiC,UACtC,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAsBlB,CAAC;AAEF,eAAO,MAAM,WAAW,UAChB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EA6BlB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,CAC/B,MAAM,CACL,YAAY,EACZ,CACC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,gBAAgB,EAAE,CACvB,CA2BD,CAAC;AAEF,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,gBAAgB,EAAE,CAIpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsSnippets = exports.snippetFile = exports.snippetAutomaticSpeechRecognition = exports.snippetTextToAudio = exports.snippetTextToImage = exports.snippetZeroShotClassification = exports.snippetTextGeneration = exports.snippetBasic = void 0;
|
|
3
|
+
exports.jsSnippets = exports.snippetFile = exports.snippetAutomaticSpeechRecognition = exports.snippetTextToAudio = exports.snippetTextToVideo = exports.snippetTextToImage = exports.snippetZeroShotClassification = exports.snippetTextGeneration = exports.snippetBasic = void 0;
|
|
4
4
|
exports.getJsInferenceSnippet = getJsInferenceSnippet;
|
|
5
5
|
const inference_providers_js_1 = require("../inference-providers.js");
|
|
6
6
|
const common_js_1 = require("./common.js");
|
|
@@ -252,6 +252,29 @@ query({"inputs": ${(0, inputs_js_1.getModelInputSnippet)(model)}}).then((respons
|
|
|
252
252
|
];
|
|
253
253
|
};
|
|
254
254
|
exports.snippetTextToImage = snippetTextToImage;
|
|
255
|
+
const snippetTextToVideo = (model, accessToken, provider) => {
|
|
256
|
+
return ["fal-ai", "replicate"].includes(provider)
|
|
257
|
+
? [
|
|
258
|
+
{
|
|
259
|
+
client: "huggingface.js",
|
|
260
|
+
content: `\
|
|
261
|
+
import { HfInference } from "@huggingface/inference";
|
|
262
|
+
|
|
263
|
+
const client = new HfInference("${accessToken || `{API_TOKEN}`}");
|
|
264
|
+
|
|
265
|
+
const video = await client.textToVideo({
|
|
266
|
+
model: "${model.id}",
|
|
267
|
+
provider: "${provider}",
|
|
268
|
+
inputs: ${(0, inputs_js_1.getModelInputSnippet)(model)},
|
|
269
|
+
parameters: { num_inference_steps: 5 },
|
|
270
|
+
});
|
|
271
|
+
// Use the generated video (it's a Blob)
|
|
272
|
+
`,
|
|
273
|
+
},
|
|
274
|
+
]
|
|
275
|
+
: [];
|
|
276
|
+
};
|
|
277
|
+
exports.snippetTextToVideo = snippetTextToVideo;
|
|
255
278
|
const snippetTextToAudio = (model, accessToken, provider) => {
|
|
256
279
|
if (provider !== "hf-inference") {
|
|
257
280
|
return [];
|
|
@@ -373,6 +396,7 @@ exports.jsSnippets = {
|
|
|
373
396
|
"sentence-similarity": exports.snippetBasic,
|
|
374
397
|
"automatic-speech-recognition": exports.snippetAutomaticSpeechRecognition,
|
|
375
398
|
"text-to-image": exports.snippetTextToImage,
|
|
399
|
+
"text-to-video": exports.snippetTextToVideo,
|
|
376
400
|
"text-to-speech": exports.snippetTextToAudio,
|
|
377
401
|
"text-to-audio": exports.snippetTextToAudio,
|
|
378
402
|
"audio-to-audio": exports.snippetFile,
|
|
@@ -14,6 +14,7 @@ export declare const snippetZeroShotImageClassification: (model: ModelDataMinima
|
|
|
14
14
|
export declare const snippetBasic: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
15
15
|
export declare const snippetFile: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
16
16
|
export declare const snippetTextToImage: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider, providerModelId?: string) => InferenceSnippet[];
|
|
17
|
+
export declare const snippetTextToVideo: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
17
18
|
export declare const snippetTabular: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
18
19
|
export declare const snippetTextToAudio: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
19
20
|
export declare const snippetDocumentQuestionAnswering: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../../src/snippets/python.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAyCrE,eAAO,MAAM,qBAAqB,UAC1B,gBAAgB,eACV,MAAM,YACT,wBAAwB,oBAChB,MAAM,SACjB;IACN,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,0BAA0B,EAAE,CAAC;IACxC,WAAW,CAAC,EAAE,oBAAo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MAAM,cAAc,EAAE,OAAO,CACnC,MAAM,CACL,YAAY,EACZ,CACC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,gBAAgB,EAAE,CACvB,CA+BD,CAAC;AAEF,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,gBAAgB,EAAE,CA0BpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pythonSnippets = exports.snippetDocumentQuestionAnswering = exports.snippetTextToAudio = exports.snippetTabular = exports.snippetTextToImage = exports.snippetFile = exports.snippetBasic = exports.snippetZeroShotImageClassification = exports.snippetZeroShotClassification = exports.snippetConversational = void 0;
|
|
3
|
+
exports.pythonSnippets = exports.snippetDocumentQuestionAnswering = exports.snippetTextToAudio = exports.snippetTabular = exports.snippetTextToVideo = exports.snippetTextToImage = exports.snippetFile = exports.snippetBasic = exports.snippetZeroShotImageClassification = exports.snippetZeroShotClassification = exports.snippetConversational = void 0;
|
|
4
4
|
exports.getPythonInferenceSnippet = getPythonInferenceSnippet;
|
|
5
5
|
const inference_providers_js_1 = require("../inference-providers.js");
|
|
6
6
|
const common_js_1 = require("./common.js");
|
|
@@ -283,6 +283,23 @@ image = Image.open(io.BytesIO(image_bytes))`,
|
|
|
283
283
|
];
|
|
284
284
|
};
|
|
285
285
|
exports.snippetTextToImage = snippetTextToImage;
|
|
286
|
+
const snippetTextToVideo = (model, accessToken, provider) => {
|
|
287
|
+
return ["fal-ai", "replicate"].includes(provider)
|
|
288
|
+
? [
|
|
289
|
+
{
|
|
290
|
+
client: "huggingface_hub",
|
|
291
|
+
content: `\
|
|
292
|
+
${snippetImportInferenceClient(accessToken, provider)}
|
|
293
|
+
|
|
294
|
+
video = client.text_to_video(
|
|
295
|
+
${(0, inputs_js_1.getModelInputSnippet)(model)},
|
|
296
|
+
model="${model.id}"
|
|
297
|
+
)`,
|
|
298
|
+
},
|
|
299
|
+
]
|
|
300
|
+
: [];
|
|
301
|
+
};
|
|
302
|
+
exports.snippetTextToVideo = snippetTextToVideo;
|
|
286
303
|
const snippetTabular = (model) => {
|
|
287
304
|
return [
|
|
288
305
|
{
|
|
@@ -377,6 +394,7 @@ exports.pythonSnippets = {
|
|
|
377
394
|
"sentence-similarity": exports.snippetBasic,
|
|
378
395
|
"automatic-speech-recognition": exports.snippetFile,
|
|
379
396
|
"text-to-image": exports.snippetTextToImage,
|
|
397
|
+
"text-to-video": exports.snippetTextToVideo,
|
|
380
398
|
"text-to-speech": exports.snippetTextToAudio,
|
|
381
399
|
"text-to-audio": exports.snippetTextToAudio,
|
|
382
400
|
"audio-to-audio": exports.snippetFile,
|
|
@@ -93,7 +93,7 @@ const taskData = {
|
|
|
93
93
|
},
|
|
94
94
|
],
|
|
95
95
|
summary: "Text-to-video models can be used in any application that requires generating consistent sequence of images from text. ",
|
|
96
|
-
widgetModels: [],
|
|
96
|
+
widgetModels: ["tencent/HunyuanVideo"],
|
|
97
97
|
youtubeId: undefined,
|
|
98
98
|
};
|
|
99
99
|
exports.default = taskData;
|
|
@@ -389,6 +389,12 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
389
389
|
repoUrl: string;
|
|
390
390
|
countDownloads: string;
|
|
391
391
|
};
|
|
392
|
+
"hunyuan3d-2": {
|
|
393
|
+
prettyLabel: string;
|
|
394
|
+
repoName: string;
|
|
395
|
+
repoUrl: string;
|
|
396
|
+
countDownloads: string;
|
|
397
|
+
};
|
|
392
398
|
imstoucan: {
|
|
393
399
|
prettyLabel: string;
|
|
394
400
|
repoName: string;
|
|
@@ -914,5 +920,5 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
914
920
|
};
|
|
915
921
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
916
922
|
export declare const ALL_MODEL_LIBRARY_KEYS: ModelLibraryKey[];
|
|
917
|
-
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "anemoi" | "asteroid" | "audiocraft" | "audioseal" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cosyvoice" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "htrflow" | "hunyuan-dit" | "imstoucan" | "keras" | "tf-keras" | "keras-hub" | "k2" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "merlin" | "mitie" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open-oasis" | "open_clip" | "paddlenlp" | "peft" | "pxia" | "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" | "swarmformer" | "f5-tts" | "genmo" | "tensorflowtts" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "unity-sentis" | "sana" | "vfi-mamba" | "voicecraft" | "whisperkit" | "yolov10" | "3dtopia-xl")[];
|
|
923
|
+
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("adapter-transformers" | "allennlp" | "anemoi" | "asteroid" | "audiocraft" | "audioseal" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "champ" | "chat_tts" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cosyvoice" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "gemma.cpp" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hezar" | "htrflow" | "hunyuan-dit" | "hunyuan3d-2" | "imstoucan" | "keras" | "tf-keras" | "keras-hub" | "k2" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "mamba-ssm" | "mars5-tts" | "mesh-anything" | "merlin" | "mitie" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "nemo" | "open-oasis" | "open_clip" | "paddlenlp" | "peft" | "pxia" | "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" | "swarmformer" | "f5-tts" | "genmo" | "tensorflowtts" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "unity-sentis" | "sana" | "vfi-mamba" | "voicecraft" | "whisperkit" | "yolov10" | "3dtopia-xl")[];
|
|
918
924
|
//# 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,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;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,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;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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e,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,EAA+C,eAAe,EAAE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,wkDAQ1B,CAAC"}
|
|
@@ -350,6 +350,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
350
350
|
repoUrl: "https://github.com/Tencent/HunyuanDiT",
|
|
351
351
|
countDownloads: `path:"pytorch_model_ema.pt" OR path:"pytorch_model_distill.pt"`,
|
|
352
352
|
},
|
|
353
|
+
"hunyuan3d-2": {
|
|
354
|
+
prettyLabel: "Hunyuan3D-2",
|
|
355
|
+
repoName: "Hunyuan3D-2",
|
|
356
|
+
repoUrl: "https://github.com/Tencent/Hunyuan3D-2",
|
|
357
|
+
countDownloads: `path:"model_index.json" OR path:"config.yaml"`,
|
|
358
|
+
},
|
|
353
359
|
imstoucan: {
|
|
354
360
|
prettyLabel: "IMS Toucan",
|
|
355
361
|
repoName: "IMS-Toucan",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/snippets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/snippets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAgJnD,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,gBAAgB,EACvB,MAAM,UAAQ,EACd,QAAQ,UAAQ,GACd,MAAM,GAAG,0BAA0B,EAAE,CAmBvC"}
|
|
@@ -66,6 +66,7 @@ const inputsObjectDetection = () => `"cats.jpg"`;
|
|
|
66
66
|
const inputsAudioToAudio = () => `"sample1.flac"`;
|
|
67
67
|
const inputsAudioClassification = () => `"sample1.flac"`;
|
|
68
68
|
const inputsTextToImage = () => `"Astronaut riding a horse"`;
|
|
69
|
+
const inputsTextToVideo = () => `"A young man walking on the street"`;
|
|
69
70
|
const inputsTextToSpeech = () => `"The answer to the universe is 42"`;
|
|
70
71
|
const inputsTextToAudio = () => `"liquid drum and bass, atmospheric synths, airy sounds"`;
|
|
71
72
|
const inputsAutomaticSpeechRecognition = () => `"sample1.flac"`;
|
|
@@ -92,6 +93,7 @@ const modelInputSnippets = {
|
|
|
92
93
|
"text-generation": inputsTextGeneration,
|
|
93
94
|
"image-text-to-text": inputsTextGeneration,
|
|
94
95
|
"text-to-image": inputsTextToImage,
|
|
96
|
+
"text-to-video": inputsTextToVideo,
|
|
95
97
|
"text-to-speech": inputsTextToSpeech,
|
|
96
98
|
"text-to-audio": inputsTextToAudio,
|
|
97
99
|
"text2text-generation": inputsText2TextGeneration,
|
|
@@ -12,6 +12,7 @@ export declare const snippetTextGeneration: (model: ModelDataMinimal, accessToke
|
|
|
12
12
|
}) => InferenceSnippet[];
|
|
13
13
|
export declare const snippetZeroShotClassification: (model: ModelDataMinimal, accessToken: string) => InferenceSnippet[];
|
|
14
14
|
export declare const snippetTextToImage: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
15
|
+
export declare const snippetTextToVideo: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
15
16
|
export declare const snippetTextToAudio: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
16
17
|
export declare const snippetAutomaticSpeechRecognition: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
17
18
|
export declare const snippetFile: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
@@ -1 +1 @@
|
|
|
1
|
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KAChC,gBAAgB,EA4ClB,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAqBlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAgDlB,CAAC;AAEF,eAAO,MAAM,iCAAiC,UACtC,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAsBlB,CAAC;AAEF,eAAO,MAAM,WAAW,UAChB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EA6BlB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,CAC/B,MAAM,CACL,YAAY,EACZ,CACC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,gBAAgB,EAAE,CACvB,CA2BD,CAAC;AAEF,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,gBAAgB,EAAE,CAIpB"}
|
package/dist/esm/snippets/js.js
CHANGED
|
@@ -244,6 +244,28 @@ query({"inputs": ${getModelInputSnippet(model)}}).then((response) => {
|
|
|
244
244
|
: []),
|
|
245
245
|
];
|
|
246
246
|
};
|
|
247
|
+
export const snippetTextToVideo = (model, accessToken, provider) => {
|
|
248
|
+
return ["fal-ai", "replicate"].includes(provider)
|
|
249
|
+
? [
|
|
250
|
+
{
|
|
251
|
+
client: "huggingface.js",
|
|
252
|
+
content: `\
|
|
253
|
+
import { HfInference } from "@huggingface/inference";
|
|
254
|
+
|
|
255
|
+
const client = new HfInference("${accessToken || `{API_TOKEN}`}");
|
|
256
|
+
|
|
257
|
+
const video = await client.textToVideo({
|
|
258
|
+
model: "${model.id}",
|
|
259
|
+
provider: "${provider}",
|
|
260
|
+
inputs: ${getModelInputSnippet(model)},
|
|
261
|
+
parameters: { num_inference_steps: 5 },
|
|
262
|
+
});
|
|
263
|
+
// Use the generated video (it's a Blob)
|
|
264
|
+
`,
|
|
265
|
+
},
|
|
266
|
+
]
|
|
267
|
+
: [];
|
|
268
|
+
};
|
|
247
269
|
export const snippetTextToAudio = (model, accessToken, provider) => {
|
|
248
270
|
if (provider !== "hf-inference") {
|
|
249
271
|
return [];
|
|
@@ -362,6 +384,7 @@ export const jsSnippets = {
|
|
|
362
384
|
"sentence-similarity": snippetBasic,
|
|
363
385
|
"automatic-speech-recognition": snippetAutomaticSpeechRecognition,
|
|
364
386
|
"text-to-image": snippetTextToImage,
|
|
387
|
+
"text-to-video": snippetTextToVideo,
|
|
365
388
|
"text-to-speech": snippetTextToAudio,
|
|
366
389
|
"text-to-audio": snippetTextToAudio,
|
|
367
390
|
"audio-to-audio": snippetFile,
|
|
@@ -14,6 +14,7 @@ export declare const snippetZeroShotImageClassification: (model: ModelDataMinima
|
|
|
14
14
|
export declare const snippetBasic: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
15
15
|
export declare const snippetFile: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
16
16
|
export declare const snippetTextToImage: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider, providerModelId?: string) => InferenceSnippet[];
|
|
17
|
+
export declare const snippetTextToVideo: (model: ModelDataMinimal, accessToken: string, provider: SnippetInferenceProvider) => InferenceSnippet[];
|
|
17
18
|
export declare const snippetTabular: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
18
19
|
export declare const snippetTextToAudio: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
19
20
|
export declare const snippetDocumentQuestionAnswering: (model: ModelDataMinimal) => InferenceSnippet[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../../src/snippets/python.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAyCrE,eAAO,MAAM,qBAAqB,UAC1B,gBAAgB,eACV,MAAM,YACT,wBAAwB,oBAChB,MAAM,SACjB;IACN,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,0BAA0B,EAAE,CAAC;IACxC,WAAW,CAAC,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAClD,UAAU,CAAC,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;CACtC,KACC,gBAAgB,EAiGlB,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAAW,gBAAgB,KAAG,gBAAgB,EAevF,CAAC;AAEF,eAAO,MAAM,kCAAkC,UAAW,gBAAgB,KAAG,gBAAgB,EAqB5F,CAAC;AAEF,eAAO,MAAM,YAAY,UACjB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAgClB,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,KAAG,gBAAgB,EAcrE,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,oBAChB,MAAM,KACtB,gBAAgB,EAoDlB,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,gBAAgB,KAAG,gBAAgB,EAcxE,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G,gBAAgB,EAqB5F,CAAC;AAEF,eAAO,MAAM,YAAY,UACjB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAgClB,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,KAAG,gBAAgB,EAcrE,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,oBAChB,MAAM,KACtB,gBAAgB,EAoDlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACvB,gBAAgB,eACV,MAAM,YACT,wBAAwB,KAChC,gBAAgB,EAelB,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,gBAAgB,KAAG,gBAAgB,EAcxE,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,gBAAgB,KAAG,gBAAgB,EAuC5E,CAAC;AAEF,eAAO,MAAM,gCAAgC,UAAW,gBAAgB,KAAG,gBAAgB,EAiB1F,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAAO,CACnC,MAAM,CACL,YAAY,EACZ,CACC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,gBAAgB,EAAE,CACvB,CA+BD,CAAC;AAEF,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,wBAAwB,EAClC,eAAe,CAAC,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,gBAAgB,EAAE,CA0BpB"}
|
|
@@ -273,6 +273,22 @@ image = Image.open(io.BytesIO(image_bytes))`,
|
|
|
273
273
|
: []),
|
|
274
274
|
];
|
|
275
275
|
};
|
|
276
|
+
export const snippetTextToVideo = (model, accessToken, provider) => {
|
|
277
|
+
return ["fal-ai", "replicate"].includes(provider)
|
|
278
|
+
? [
|
|
279
|
+
{
|
|
280
|
+
client: "huggingface_hub",
|
|
281
|
+
content: `\
|
|
282
|
+
${snippetImportInferenceClient(accessToken, provider)}
|
|
283
|
+
|
|
284
|
+
video = client.text_to_video(
|
|
285
|
+
${getModelInputSnippet(model)},
|
|
286
|
+
model="${model.id}"
|
|
287
|
+
)`,
|
|
288
|
+
},
|
|
289
|
+
]
|
|
290
|
+
: [];
|
|
291
|
+
};
|
|
276
292
|
export const snippetTabular = (model) => {
|
|
277
293
|
return [
|
|
278
294
|
{
|
|
@@ -364,6 +380,7 @@ export const pythonSnippets = {
|
|
|
364
380
|
"sentence-similarity": snippetBasic,
|
|
365
381
|
"automatic-speech-recognition": snippetFile,
|
|
366
382
|
"text-to-image": snippetTextToImage,
|
|
383
|
+
"text-to-video": snippetTextToVideo,
|
|
367
384
|
"text-to-speech": snippetTextToAudio,
|
|
368
385
|
"text-to-audio": snippetTextToAudio,
|
|
369
386
|
"audio-to-audio": snippetFile,
|
|
@@ -91,7 +91,7 @@ const taskData = {
|
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
93
|
summary: "Text-to-video models can be used in any application that requires generating consistent sequence of images from text. ",
|
|
94
|
-
widgetModels: [],
|
|
94
|
+
widgetModels: ["tencent/HunyuanVideo"],
|
|
95
95
|
youtubeId: undefined,
|
|
96
96
|
};
|
|
97
97
|
export default taskData;
|
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.16.
|
|
4
|
+
"version": "0.16.6",
|
|
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/model-libraries.ts
CHANGED
|
@@ -394,6 +394,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
394
394
|
repoUrl: "https://github.com/Tencent/HunyuanDiT",
|
|
395
395
|
countDownloads: `path:"pytorch_model_ema.pt" OR path:"pytorch_model_distill.pt"`,
|
|
396
396
|
},
|
|
397
|
+
"hunyuan3d-2": {
|
|
398
|
+
prettyLabel: "Hunyuan3D-2",
|
|
399
|
+
repoName: "Hunyuan3D-2",
|
|
400
|
+
repoUrl: "https://github.com/Tencent/Hunyuan3D-2",
|
|
401
|
+
countDownloads: `path:"model_index.json" OR path:"config.yaml"`,
|
|
402
|
+
},
|
|
397
403
|
imstoucan: {
|
|
398
404
|
prettyLabel: "IMS Toucan",
|
|
399
405
|
repoName: "IMS-Toucan",
|
package/src/snippets/inputs.ts
CHANGED
|
@@ -96,6 +96,8 @@ const inputsAudioClassification = () => `"sample1.flac"`;
|
|
|
96
96
|
|
|
97
97
|
const inputsTextToImage = () => `"Astronaut riding a horse"`;
|
|
98
98
|
|
|
99
|
+
const inputsTextToVideo = () => `"A young man walking on the street"`;
|
|
100
|
+
|
|
99
101
|
const inputsTextToSpeech = () => `"The answer to the universe is 42"`;
|
|
100
102
|
|
|
101
103
|
const inputsTextToAudio = () => `"liquid drum and bass, atmospheric synths, airy sounds"`;
|
|
@@ -130,6 +132,7 @@ const modelInputSnippets: {
|
|
|
130
132
|
"text-generation": inputsTextGeneration,
|
|
131
133
|
"image-text-to-text": inputsTextGeneration,
|
|
132
134
|
"text-to-image": inputsTextToImage,
|
|
135
|
+
"text-to-video": inputsTextToVideo,
|
|
133
136
|
"text-to-speech": inputsTextToSpeech,
|
|
134
137
|
"text-to-audio": inputsTextToAudio,
|
|
135
138
|
"text2text-generation": inputsText2TextGeneration,
|
package/src/snippets/js.ts
CHANGED
|
@@ -275,6 +275,33 @@ query({"inputs": ${getModelInputSnippet(model)}}).then((response) => {
|
|
|
275
275
|
];
|
|
276
276
|
};
|
|
277
277
|
|
|
278
|
+
export const snippetTextToVideo = (
|
|
279
|
+
model: ModelDataMinimal,
|
|
280
|
+
accessToken: string,
|
|
281
|
+
provider: SnippetInferenceProvider
|
|
282
|
+
): InferenceSnippet[] => {
|
|
283
|
+
return ["fal-ai", "replicate"].includes(provider)
|
|
284
|
+
? [
|
|
285
|
+
{
|
|
286
|
+
client: "huggingface.js",
|
|
287
|
+
content: `\
|
|
288
|
+
import { HfInference } from "@huggingface/inference";
|
|
289
|
+
|
|
290
|
+
const client = new HfInference("${accessToken || `{API_TOKEN}`}");
|
|
291
|
+
|
|
292
|
+
const video = await client.textToVideo({
|
|
293
|
+
model: "${model.id}",
|
|
294
|
+
provider: "${provider}",
|
|
295
|
+
inputs: ${getModelInputSnippet(model)},
|
|
296
|
+
parameters: { num_inference_steps: 5 },
|
|
297
|
+
});
|
|
298
|
+
// Use the generated video (it's a Blob)
|
|
299
|
+
`,
|
|
300
|
+
},
|
|
301
|
+
]
|
|
302
|
+
: [];
|
|
303
|
+
};
|
|
304
|
+
|
|
278
305
|
export const snippetTextToAudio = (
|
|
279
306
|
model: ModelDataMinimal,
|
|
280
307
|
accessToken: string,
|
|
@@ -420,6 +447,7 @@ export const jsSnippets: Partial<
|
|
|
420
447
|
"sentence-similarity": snippetBasic,
|
|
421
448
|
"automatic-speech-recognition": snippetAutomaticSpeechRecognition,
|
|
422
449
|
"text-to-image": snippetTextToImage,
|
|
450
|
+
"text-to-video": snippetTextToVideo,
|
|
423
451
|
"text-to-speech": snippetTextToAudio,
|
|
424
452
|
"text-to-audio": snippetTextToAudio,
|
|
425
453
|
"audio-to-audio": snippetFile,
|
package/src/snippets/python.ts
CHANGED
|
@@ -308,6 +308,27 @@ image = Image.open(io.BytesIO(image_bytes))`,
|
|
|
308
308
|
];
|
|
309
309
|
};
|
|
310
310
|
|
|
311
|
+
export const snippetTextToVideo = (
|
|
312
|
+
model: ModelDataMinimal,
|
|
313
|
+
accessToken: string,
|
|
314
|
+
provider: SnippetInferenceProvider
|
|
315
|
+
): InferenceSnippet[] => {
|
|
316
|
+
return ["fal-ai", "replicate"].includes(provider)
|
|
317
|
+
? [
|
|
318
|
+
{
|
|
319
|
+
client: "huggingface_hub",
|
|
320
|
+
content: `\
|
|
321
|
+
${snippetImportInferenceClient(accessToken, provider)}
|
|
322
|
+
|
|
323
|
+
video = client.text_to_video(
|
|
324
|
+
${getModelInputSnippet(model)},
|
|
325
|
+
model="${model.id}"
|
|
326
|
+
)`,
|
|
327
|
+
},
|
|
328
|
+
]
|
|
329
|
+
: [];
|
|
330
|
+
};
|
|
331
|
+
|
|
311
332
|
export const snippetTabular = (model: ModelDataMinimal): InferenceSnippet[] => {
|
|
312
333
|
return [
|
|
313
334
|
{
|
|
@@ -412,6 +433,7 @@ export const pythonSnippets: Partial<
|
|
|
412
433
|
"sentence-similarity": snippetBasic,
|
|
413
434
|
"automatic-speech-recognition": snippetFile,
|
|
414
435
|
"text-to-image": snippetTextToImage,
|
|
436
|
+
"text-to-video": snippetTextToVideo,
|
|
415
437
|
"text-to-speech": snippetTextToAudio,
|
|
416
438
|
"text-to-audio": snippetTextToAudio,
|
|
417
439
|
"audio-to-audio": snippetFile,
|
|
@@ -99,7 +99,7 @@ const taskData: TaskDataCustom = {
|
|
|
99
99
|
],
|
|
100
100
|
summary:
|
|
101
101
|
"Text-to-video models can be used in any application that requires generating consistent sequence of images from text. ",
|
|
102
|
-
widgetModels: [],
|
|
102
|
+
widgetModels: ["tencent/HunyuanVideo"],
|
|
103
103
|
youtubeId: undefined,
|
|
104
104
|
};
|
|
105
105
|
|