@huggingface/tasks 0.19.81 → 0.19.83
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/local-apps.d.ts.map +1 -1
- package/dist/commonjs/local-apps.js +60 -41
- package/dist/commonjs/model-libraries-snippets.d.ts +1 -0
- package/dist/commonjs/model-libraries-snippets.d.ts.map +1 -1
- package/dist/commonjs/model-libraries-snippets.js +68 -18
- package/dist/commonjs/model-libraries.d.ts +1 -0
- package/dist/commonjs/model-libraries.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.js +1 -0
- package/dist/esm/local-apps.d.ts.map +1 -1
- package/dist/esm/local-apps.js +60 -41
- package/dist/esm/model-libraries-snippets.d.ts +1 -0
- package/dist/esm/model-libraries-snippets.d.ts.map +1 -1
- package/dist/esm/model-libraries-snippets.js +66 -17
- package/dist/esm/model-libraries.d.ts +1 -0
- package/dist/esm/model-libraries.d.ts.map +1 -1
- package/dist/esm/model-libraries.js +1 -0
- package/package.json +1 -1
- package/src/local-apps.ts +68 -45
- package/src/model-libraries-snippets.ts +69 -17
- package/src/model-libraries.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,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,CA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@ const snippetLocalAI = (model, filepath) => {
|
|
|
120
120
|
};
|
|
121
121
|
const snippetVllm = (model) => {
|
|
122
122
|
const messages = (0, inputs_js_1.getModelInputSnippet)(model);
|
|
123
|
-
const
|
|
123
|
+
const isMistral = model.tags.includes("mistral-common");
|
|
124
|
+
const mistralFlags = isMistral
|
|
125
|
+
? " --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"
|
|
126
|
+
: "";
|
|
127
|
+
const setup = isMistral
|
|
128
|
+
? [
|
|
129
|
+
"# Install vLLM from pip:",
|
|
130
|
+
"pip install vllm",
|
|
131
|
+
"# Install mistral-common:",
|
|
132
|
+
"pip install --upgrade mistral-common",
|
|
133
|
+
].join("\n")
|
|
134
|
+
: ["# Install vLLM from pip:", "pip install vllm"].join("\n");
|
|
135
|
+
const serverCommand = `# Start the vLLM server:
|
|
136
|
+
vllm serve "${model.id}"${mistralFlags}`;
|
|
137
|
+
const dockerCommand = `docker run --gpus all \\
|
|
138
|
+
-v ~/.cache/huggingface:/root/.cache/huggingface \\
|
|
139
|
+
--env "HF_TOKEN=<secret>" \\
|
|
140
|
+
-p 8000:8000 \\
|
|
141
|
+
--ipc=host \\
|
|
142
|
+
vllm/vllm-openai:latest \\
|
|
143
|
+
--model "${model.id}"${mistralFlags}`;
|
|
144
|
+
const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
124
145
|
curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
125
146
|
-H "Content-Type: application/json" \\
|
|
126
147
|
--data '{
|
|
@@ -131,7 +152,7 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
|
131
152
|
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
132
153
|
})}
|
|
133
154
|
}'`;
|
|
134
|
-
const runCommandNonInstruct = `# Call the server using curl:
|
|
155
|
+
const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
135
156
|
curl -X POST "http://localhost:8000/v1/completions" \\
|
|
136
157
|
-H "Content-Type: application/json" \\
|
|
137
158
|
--data '{
|
|
@@ -141,49 +162,27 @@ curl -X POST "http://localhost:8000/v1/completions" \\
|
|
|
141
162
|
"temperature": 0.5
|
|
142
163
|
}'`;
|
|
143
164
|
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
144
|
-
let setup;
|
|
145
|
-
let dockerCommand;
|
|
146
|
-
if (model.tags.includes("mistral-common")) {
|
|
147
|
-
setup = [
|
|
148
|
-
"# Install vLLM from pip:",
|
|
149
|
-
"pip install vllm",
|
|
150
|
-
"# Make sure you have the latest version of mistral-common installed:",
|
|
151
|
-
"pip install --upgrade mistral-common",
|
|
152
|
-
].join("\n");
|
|
153
|
-
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id} --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"`;
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
setup = ["# Install vLLM from pip:", "pip install vllm"].join("\n");
|
|
157
|
-
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`;
|
|
158
|
-
}
|
|
159
165
|
return [
|
|
160
166
|
{
|
|
161
|
-
title: "Install from pip",
|
|
167
|
+
title: "Install from pip and serve model",
|
|
162
168
|
setup: setup,
|
|
163
|
-
content: [
|
|
169
|
+
content: [serverCommand, runCommand],
|
|
164
170
|
},
|
|
165
171
|
{
|
|
166
172
|
title: "Use Docker images",
|
|
167
|
-
setup:
|
|
168
|
-
|
|
169
|
-
`docker run --runtime nvidia --gpus all \\`,
|
|
170
|
-
` --name my_vllm_container \\`,
|
|
171
|
-
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
|
|
172
|
-
` --env "HUGGING_FACE_HUB_TOKEN=<secret>" \\`,
|
|
173
|
-
` -p 8000:8000 \\`,
|
|
174
|
-
` --ipc=host \\`,
|
|
175
|
-
` vllm/vllm-openai:latest \\`,
|
|
176
|
-
` --model ${model.id}`,
|
|
177
|
-
].join("\n"),
|
|
178
|
-
content: [dockerCommand, runCommand],
|
|
173
|
+
setup: dockerCommand,
|
|
174
|
+
content: [runCommand],
|
|
179
175
|
},
|
|
180
176
|
];
|
|
181
177
|
};
|
|
182
178
|
const snippetSglang = (model) => {
|
|
183
179
|
const messages = (0, inputs_js_1.getModelInputSnippet)(model);
|
|
184
180
|
const setup = ["# Install SGLang from pip:", "pip install sglang"].join("\n");
|
|
185
|
-
const serverCommand = `# Start the SGLang server
|
|
186
|
-
|
|
181
|
+
const serverCommand = `# Start the SGLang server:
|
|
182
|
+
python3 -m sglang.launch_server \\
|
|
183
|
+
--model-path "${model.id}" \\
|
|
184
|
+
--host 0.0.0.0 \\
|
|
185
|
+
--port 30000`;
|
|
187
186
|
const dockerCommand = `docker run --gpus all \\
|
|
188
187
|
--shm-size 32g \\
|
|
189
188
|
-p 30000:30000 \\
|
|
@@ -191,14 +190,31 @@ const snippetSglang = (model) => {
|
|
|
191
190
|
--env "HF_TOKEN=<secret>" \\
|
|
192
191
|
--ipc=host \\
|
|
193
192
|
lmsysorg/sglang:latest \\
|
|
194
|
-
python3 -m sglang.launch_server
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
python3 -m sglang.launch_server \\
|
|
194
|
+
--model-path "${model.id}" \\
|
|
195
|
+
--host 0.0.0.0 \\
|
|
196
|
+
--port 30000`;
|
|
197
|
+
const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
198
|
+
curl -X POST "http://localhost:30000/v1/chat/completions" \\
|
|
199
|
+
-H "Content-Type: application/json" \\
|
|
200
|
+
--data '{
|
|
201
|
+
"model": "${model.id}",
|
|
202
|
+
"messages": ${(0, common_js_1.stringifyMessages)(messages, {
|
|
198
203
|
indent: "\t\t",
|
|
199
204
|
attributeKeyQuotes: true,
|
|
200
205
|
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
201
|
-
})}
|
|
206
|
+
})}
|
|
207
|
+
}'`;
|
|
208
|
+
const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
209
|
+
curl -X POST "http://localhost:30000/v1/completions" \\
|
|
210
|
+
-H "Content-Type: application/json" \\
|
|
211
|
+
--data '{
|
|
212
|
+
"model": "${model.id}",
|
|
213
|
+
"prompt": "Once upon a time,",
|
|
214
|
+
"max_tokens": 512,
|
|
215
|
+
"temperature": 0.5
|
|
216
|
+
}'`;
|
|
217
|
+
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
202
218
|
return [
|
|
203
219
|
{
|
|
204
220
|
title: "Install from pip and serve model",
|
|
@@ -359,9 +375,12 @@ exports.LOCAL_APPS = {
|
|
|
359
375
|
prettyLabel: "SGLang",
|
|
360
376
|
docsUrl: "https://docs.sglang.io",
|
|
361
377
|
mainTask: "text-generation",
|
|
362
|
-
displayOnModelPage: (model) =>
|
|
363
|
-
(model
|
|
364
|
-
model
|
|
378
|
+
displayOnModelPage: (model) => (isAwqModel(model) ||
|
|
379
|
+
isGptqModel(model) ||
|
|
380
|
+
isAqlmModel(model) ||
|
|
381
|
+
isMarlinModel(model) ||
|
|
382
|
+
isTransformersModel(model)) &&
|
|
383
|
+
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
|
|
365
384
|
snippet: snippetSglang,
|
|
366
385
|
},
|
|
367
386
|
"mlx-lm": {
|
|
@@ -108,4 +108,5 @@ export declare const whisperkit: () => string[];
|
|
|
108
108
|
export declare const threedtopia_xl: (model: ModelData) => string[];
|
|
109
109
|
export declare const hezar: (model: ModelData) => string[];
|
|
110
110
|
export declare const zonos: (model: ModelData) => string[];
|
|
111
|
+
export declare const moshi: (model: ModelData) => string[];
|
|
111
112
|
//# sourceMappingURL=model-libraries-snippets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../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AO,SAAS,KAAG,MAAM,EAY5C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,KAAG,MAAM,EAIlD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EA0B9C,CAAC;AAuDF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,MAAM,EAQ7C,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,KAAG,MAAM,EAuBhD,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,MAAM,EAI7C,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,SAAS,KAAG,MAAM,EAI/C,CAAC;AA4BF,eAAO,MAAM,MAAM,GAAI,OAAO,SAAS,KAAG,MAAM,EAO/C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,KAAG,MAAM,EAUnD,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAYnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,SAAS,KAAG,MAAM,EAKvD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAiB9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAgD9C,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.perception_encoder = exports.paddleocr = exports.paddlenlp = exports.open_clip = exports.mesh_anything = exports.matanyone = exports.mars5_tts = exports.mamba_ssm = exports.tf_keras = exports.lerobot = exports.llama_cpp_python = exports.lightning_ir = exports.kittentts = exports.kimi_audio = exports.kernels = exports.keras_hub = exports.keras = exports.htrflow = exports.indextts = exports.gliner2 = exports.gliner = exports.flair = exports.fairseq = exports.espnet = exports.espnetASR = exports.espnetTTS = exports.edsnlp = exports.cartesia_mlx = exports.cartesia_pytorch = exports.diffusionkit = exports.diffusers = exports.describe_anything = exports.dia2 = exports.dia = exports.derm_foundation = exports.depth_pro = exports.depth_anything_v2 = exports.cxr_foundation = exports.sap_rpt_one_oss = exports.colipri = exports.chronos_forecasting = exports.chatterbox = exports.bm25s = exports.bertopic = exports.ben2 = exports.audioseal = exports.asteroid = exports.araclip = exports.allennlp = exports.adapters = void 0;
|
|
4
4
|
exports.nemo = exports.pruna = exports.model2vec = exports.mlx = exports.mlxim = exports.univa = exports.swarmformer = exports.supertonic = exports.birefnet = exports.ultralytics = exports.chattts = exports.vui = exports.voxcpm = exports.voicecraft = exports.lvface = exports.vfimamba = exports.videoprism = exports.vibevoice = exports.sana = exports.sentis = exports.mlAgents = exports.stableBaselines3 = exports.fasttext = exports.peft = exports.transformersJS = exports.transformers = exports.terratorch = exports.speechbrain = exports.stanza = exports.span_marker = exports.spacy = exports.setfit = exports.sentenceTransformers = exports.sampleFactory = exports.sam_3d_body = exports.sam_3d_objects = exports.sam2 = exports.fastai = exports.stable_audio_tools = exports.sklearn = exports.seed_story = exports.saelens = exports.timm = exports.tensorflowtts = exports.renderformer = exports.relik = exports.pyannote_audio = exports.pyannote_audio_pipeline = exports.pocket_tts = exports.phantom_wan = void 0;
|
|
5
|
-
exports.zonos = exports.hezar = exports.threedtopia_xl = exports.whisperkit = exports.audiocraft = exports.anemoi = exports.pythae = exports.pxia = exports.outetts = void 0;
|
|
5
|
+
exports.moshi = exports.zonos = exports.hezar = exports.threedtopia_xl = exports.whisperkit = exports.audiocraft = exports.anemoi = exports.pythae = exports.pxia = exports.outetts = void 0;
|
|
6
6
|
const library_to_tasks_js_1 = require("./library-to-tasks.js");
|
|
7
7
|
const inputs_js_1 = require("./snippets/inputs.js");
|
|
8
8
|
const common_js_1 = require("./snippets/common.js");
|
|
@@ -60,14 +60,14 @@ from audioseal import AudioSeal
|
|
|
60
60
|
model = AudioSeal.load_generator("${model.id}")
|
|
61
61
|
# pass a tensor (tensor_wav) of shape (batch, channels, samples) and a sample rate
|
|
62
62
|
wav, sr = tensor_wav, 16000
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
watermark = model.get_watermark(wav, sr)
|
|
65
65
|
watermarked_audio = wav + watermark`;
|
|
66
66
|
const detectorSnippet = `# Watermark Detector
|
|
67
67
|
from audioseal import AudioSeal
|
|
68
68
|
|
|
69
69
|
detector = AudioSeal.load_detector("${model.id}")
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
result, message = detector.detect_watermark(watermarked_audio, sr)`;
|
|
72
72
|
return [watermarkSnippet, detectorSnippet];
|
|
73
73
|
};
|
|
@@ -627,7 +627,7 @@ const cartesia_mlx = (model) => [
|
|
|
627
627
|
import cartesia_mlx as cmx
|
|
628
628
|
|
|
629
629
|
model = cmx.from_pretrained("${model.id}")
|
|
630
|
-
model.set_dtype(mx.float32)
|
|
630
|
+
model.set_dtype(mx.float32)
|
|
631
631
|
|
|
632
632
|
prompt = "Rene Descartes was"
|
|
633
633
|
|
|
@@ -762,7 +762,7 @@ const keras = (model) => [
|
|
|
762
762
|
`# Available backend options are: "jax", "torch", "tensorflow".
|
|
763
763
|
import os
|
|
764
764
|
os.environ["KERAS_BACKEND"] = "jax"
|
|
765
|
-
|
|
765
|
+
|
|
766
766
|
import keras
|
|
767
767
|
|
|
768
768
|
model = keras.saving.load_model("hf://${model.id}")
|
|
@@ -936,7 +936,7 @@ model.score("query", ["doc1", "doc2", "doc3"])`,
|
|
|
936
936
|
from lightning_ir import BiEncoderModule, CrossEncoderModule
|
|
937
937
|
|
|
938
938
|
# depending on the model type, use either BiEncoderModule or CrossEncoderModule
|
|
939
|
-
model = BiEncoderModule("${model.id}")
|
|
939
|
+
model = BiEncoderModule("${model.id}")
|
|
940
940
|
# model = CrossEncoderModule("${model.id}")
|
|
941
941
|
|
|
942
942
|
model.score("query", ["doc1", "doc2", "doc3"])`,
|
|
@@ -984,7 +984,7 @@ pip install -e .[smolvla]`,
|
|
|
984
984
|
`# Launch finetuning on your dataset
|
|
985
985
|
python lerobot/scripts/train.py \\
|
|
986
986
|
--policy.path=${model.id} \\
|
|
987
|
-
--dataset.repo_id=lerobot/svla_so101_pickplace \\
|
|
987
|
+
--dataset.repo_id=lerobot/svla_so101_pickplace \\
|
|
988
988
|
--batch_size=64 \\
|
|
989
989
|
--steps=20000 \\
|
|
990
990
|
--output_dir=outputs/train/my_smolvla \\
|
|
@@ -994,7 +994,7 @@ python lerobot/scripts/train.py \\
|
|
|
994
994
|
];
|
|
995
995
|
if (model.id !== "lerobot/smolvla_base") {
|
|
996
996
|
// Inference snippet (only if not base model)
|
|
997
|
-
smolvlaSnippets.push(`# Run the policy using the record function
|
|
997
|
+
smolvlaSnippets.push(`# Run the policy using the record function
|
|
998
998
|
python -m lerobot.record \\
|
|
999
999
|
--robot.type=so101_follower \\
|
|
1000
1000
|
--robot.port=/dev/ttyACM0 \\ # <- Use your port
|
|
@@ -1117,11 +1117,13 @@ for res in output:
|
|
|
1117
1117
|
];
|
|
1118
1118
|
}
|
|
1119
1119
|
if (model.tags.includes("document-parse")) {
|
|
1120
|
+
const rawVersion = model.id.replace("PaddleOCR-VL-", "v");
|
|
1121
|
+
const version = rawVersion === "PaddleOCR-VL" ? "v1" : rawVersion;
|
|
1120
1122
|
return [
|
|
1121
1123
|
`# See https://www.paddleocr.ai/latest/version3.x/pipeline_usage/PaddleOCR-VL.html to installation
|
|
1122
1124
|
|
|
1123
1125
|
from paddleocr import PaddleOCRVL
|
|
1124
|
-
pipeline = PaddleOCRVL()
|
|
1126
|
+
pipeline = PaddleOCRVL(pipeline_version="${version}")
|
|
1125
1127
|
output = pipeline.predict("path/to/document_image.png")
|
|
1126
1128
|
for res in output:
|
|
1127
1129
|
res.print()
|
|
@@ -1147,7 +1149,7 @@ for res in output:
|
|
|
1147
1149
|
}
|
|
1148
1150
|
}
|
|
1149
1151
|
return [
|
|
1150
|
-
`# Please refer to the document for information on how to use the model.
|
|
1152
|
+
`# Please refer to the document for information on how to use the model.
|
|
1151
1153
|
# https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/module_overview.html`,
|
|
1152
1154
|
];
|
|
1153
1155
|
};
|
|
@@ -1196,7 +1198,7 @@ scipy.io.wavfile.write("output.wav", tts_model.sample_rate, audio.numpy())`,
|
|
|
1196
1198
|
exports.pocket_tts = pocket_tts;
|
|
1197
1199
|
const pyannote_audio_pipeline = (model) => [
|
|
1198
1200
|
`from pyannote.audio import Pipeline
|
|
1199
|
-
|
|
1201
|
+
|
|
1200
1202
|
pipeline = Pipeline.from_pretrained("${model.id}")
|
|
1201
1203
|
|
|
1202
1204
|
# inference on the whole file
|
|
@@ -1234,7 +1236,7 @@ const pyannote_audio = (model) => {
|
|
|
1234
1236
|
exports.pyannote_audio = pyannote_audio;
|
|
1235
1237
|
const relik = (model) => [
|
|
1236
1238
|
`from relik import Relik
|
|
1237
|
-
|
|
1239
|
+
|
|
1238
1240
|
relik = Relik.from_pretrained("${model.id}")`,
|
|
1239
1241
|
];
|
|
1240
1242
|
exports.relik = relik;
|
|
@@ -1414,7 +1416,7 @@ with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
|
1414
1416
|
const video_predictor = `# Use SAM2 with videos
|
|
1415
1417
|
import torch
|
|
1416
1418
|
from sam2.sam2_video_predictor import SAM2VideoPredictor
|
|
1417
|
-
|
|
1419
|
+
|
|
1418
1420
|
predictor = SAM2VideoPredictor.from_pretrained(${model.id})
|
|
1419
1421
|
|
|
1420
1422
|
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
@@ -2113,11 +2115,11 @@ const outetts = (model) => {
|
|
|
2113
2115
|
return [
|
|
2114
2116
|
`
|
|
2115
2117
|
import outetts
|
|
2116
|
-
|
|
2118
|
+
|
|
2117
2119
|
enum = outetts.Models("${model.id}".split("/", 1)[1]) # VERSION_1_0_SIZE_1B
|
|
2118
2120
|
cfg = outetts.ModelConfig.auto_config(enum, outetts.Backend.HF)
|
|
2119
2121
|
tts = outetts.Interface(cfg)
|
|
2120
|
-
|
|
2122
|
+
|
|
2121
2123
|
speaker = tts.load_default_speaker("EN-FEMALE-1-NEUTRAL")
|
|
2122
2124
|
tts.generate(
|
|
2123
2125
|
outetts.GenerationConfig(
|
|
@@ -2151,7 +2153,7 @@ wav = model.generate(descriptions) # generates 3 samples.`,
|
|
|
2151
2153
|
];
|
|
2152
2154
|
const magnet = (model) => [
|
|
2153
2155
|
`from audiocraft.models import MAGNeT
|
|
2154
|
-
|
|
2156
|
+
|
|
2155
2157
|
model = MAGNeT.get_pretrained("${model.id}")
|
|
2156
2158
|
|
|
2157
2159
|
descriptions = ['disco beat', 'energetic EDM', 'funky groove']
|
|
@@ -2159,7 +2161,7 @@ wav = model.generate(descriptions) # generates 3 samples.`,
|
|
|
2159
2161
|
];
|
|
2160
2162
|
const audiogen = (model) => [
|
|
2161
2163
|
`from audiocraft.models import AudioGen
|
|
2162
|
-
|
|
2164
|
+
|
|
2163
2165
|
model = AudioGen.get_pretrained("${model.id}")
|
|
2164
2166
|
model.set_generation_params(duration=5) # generate 5 seconds.
|
|
2165
2167
|
descriptions = ['dog barking', 'sirene of an emergency vehicle', 'footsteps in a corridor']
|
|
@@ -2195,7 +2197,7 @@ brew install whisperkit-cli
|
|
|
2195
2197
|
|
|
2196
2198
|
# View all available inference options
|
|
2197
2199
|
whisperkit-cli transcribe --help
|
|
2198
|
-
|
|
2200
|
+
|
|
2199
2201
|
# Download and run inference using whisper base model
|
|
2200
2202
|
whisperkit-cli transcribe --audio-path /path/to/audio.mp3
|
|
2201
2203
|
|
|
@@ -2235,4 +2237,52 @@ torchaudio.save("sample.wav", audio, model.autoencoder.sampling_rate)
|
|
|
2235
2237
|
`,
|
|
2236
2238
|
];
|
|
2237
2239
|
exports.zonos = zonos;
|
|
2240
|
+
const moshi = (model) => {
|
|
2241
|
+
// Detect backend from model name (no distinguishing tags available)
|
|
2242
|
+
if (model.id.includes("-mlx")) {
|
|
2243
|
+
// MLX backend (macOS Apple Silicon)
|
|
2244
|
+
// -q flag only accepts 4 or 8, bf16 models don't use it
|
|
2245
|
+
const quantFlag = model.id.includes("-q4") ? " -q 4" : model.id.includes("-q8") ? " -q 8" : "";
|
|
2246
|
+
return [
|
|
2247
|
+
`# pip install moshi_mlx
|
|
2248
|
+
# Run local inference (macOS Apple Silicon)
|
|
2249
|
+
python -m moshi_mlx.local${quantFlag} --hf-repo "${model.id}"
|
|
2250
|
+
|
|
2251
|
+
# Or run with web UI
|
|
2252
|
+
python -m moshi_mlx.local_web${quantFlag} --hf-repo "${model.id}"`,
|
|
2253
|
+
];
|
|
2254
|
+
}
|
|
2255
|
+
if (model.id.includes("-candle")) {
|
|
2256
|
+
// Rust/Candle backend
|
|
2257
|
+
return [
|
|
2258
|
+
`# pip install rustymimi
|
|
2259
|
+
# Candle backend - see https://github.com/kyutai-labs/moshi
|
|
2260
|
+
# for Rust installation instructions`,
|
|
2261
|
+
];
|
|
2262
|
+
}
|
|
2263
|
+
// PyTorch backend (default)
|
|
2264
|
+
return [
|
|
2265
|
+
`# pip install moshi
|
|
2266
|
+
# Run the interactive web server
|
|
2267
|
+
python -m moshi.server --hf-repo "${model.id}"
|
|
2268
|
+
# Then open https://localhost:8998 in your browser`,
|
|
2269
|
+
`# pip install moshi
|
|
2270
|
+
import torch
|
|
2271
|
+
from moshi.models import loaders
|
|
2272
|
+
|
|
2273
|
+
# Load checkpoint info from HuggingFace
|
|
2274
|
+
checkpoint = loaders.CheckpointInfo.from_hf_repo("${model.id}")
|
|
2275
|
+
|
|
2276
|
+
# Load the Mimi audio codec
|
|
2277
|
+
mimi = checkpoint.get_mimi(device="cuda")
|
|
2278
|
+
mimi.set_num_codebooks(8)
|
|
2279
|
+
|
|
2280
|
+
# Encode audio (24kHz, mono)
|
|
2281
|
+
wav = torch.randn(1, 1, 24000 * 10) # [batch, channels, samples]
|
|
2282
|
+
with torch.no_grad():
|
|
2283
|
+
codes = mimi.encode(wav.cuda())
|
|
2284
|
+
decoded = mimi.decode(codes)`,
|
|
2285
|
+
];
|
|
2286
|
+
};
|
|
2287
|
+
exports.moshi = moshi;
|
|
2238
2288
|
//#endregion
|
|
@@ -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,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAg7CI,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,EAA+C,eAAe,EAAE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,swFAQ1B,CAAC"}
|
|
@@ -852,6 +852,7 @@ exports.MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
852
852
|
prettyLabel: "Moshi",
|
|
853
853
|
repoName: "Moshi",
|
|
854
854
|
repoUrl: "https://github.com/kyutai-labs/moshi",
|
|
855
|
+
snippets: snippets.moshi,
|
|
855
856
|
filter: false,
|
|
856
857
|
countDownloads: `path:"tokenizer-e351c8d8-checkpoint125.safetensors"`,
|
|
857
858
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,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,GAAG,MAAM,EAAE,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC;CACzG,CACH,CAAC;AAsBF,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,SAAS,WAE5C;
|
|
1
|
+
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE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R3B,SAAS;yBAjNT,SAAS,KAAG,eAAe,EAAE;;;;;;;yBAoF9B,SAAS,KAAG,eAAe,EAAE;;;;;;;yBA7B/B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBA7IzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAJjD,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAiN1B,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAI9C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;CAwO5C,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/esm/local-apps.js
CHANGED
|
@@ -117,7 +117,28 @@ const snippetLocalAI = (model, filepath) => {
|
|
|
117
117
|
};
|
|
118
118
|
const snippetVllm = (model) => {
|
|
119
119
|
const messages = getModelInputSnippet(model);
|
|
120
|
-
const
|
|
120
|
+
const isMistral = model.tags.includes("mistral-common");
|
|
121
|
+
const mistralFlags = isMistral
|
|
122
|
+
? " --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"
|
|
123
|
+
: "";
|
|
124
|
+
const setup = isMistral
|
|
125
|
+
? [
|
|
126
|
+
"# Install vLLM from pip:",
|
|
127
|
+
"pip install vllm",
|
|
128
|
+
"# Install mistral-common:",
|
|
129
|
+
"pip install --upgrade mistral-common",
|
|
130
|
+
].join("\n")
|
|
131
|
+
: ["# Install vLLM from pip:", "pip install vllm"].join("\n");
|
|
132
|
+
const serverCommand = `# Start the vLLM server:
|
|
133
|
+
vllm serve "${model.id}"${mistralFlags}`;
|
|
134
|
+
const dockerCommand = `docker run --gpus all \\
|
|
135
|
+
-v ~/.cache/huggingface:/root/.cache/huggingface \\
|
|
136
|
+
--env "HF_TOKEN=<secret>" \\
|
|
137
|
+
-p 8000:8000 \\
|
|
138
|
+
--ipc=host \\
|
|
139
|
+
vllm/vllm-openai:latest \\
|
|
140
|
+
--model "${model.id}"${mistralFlags}`;
|
|
141
|
+
const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
121
142
|
curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
122
143
|
-H "Content-Type: application/json" \\
|
|
123
144
|
--data '{
|
|
@@ -128,7 +149,7 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
|
128
149
|
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
129
150
|
})}
|
|
130
151
|
}'`;
|
|
131
|
-
const runCommandNonInstruct = `# Call the server using curl:
|
|
152
|
+
const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
132
153
|
curl -X POST "http://localhost:8000/v1/completions" \\
|
|
133
154
|
-H "Content-Type: application/json" \\
|
|
134
155
|
--data '{
|
|
@@ -138,49 +159,27 @@ curl -X POST "http://localhost:8000/v1/completions" \\
|
|
|
138
159
|
"temperature": 0.5
|
|
139
160
|
}'`;
|
|
140
161
|
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
141
|
-
let setup;
|
|
142
|
-
let dockerCommand;
|
|
143
|
-
if (model.tags.includes("mistral-common")) {
|
|
144
|
-
setup = [
|
|
145
|
-
"# Install vLLM from pip:",
|
|
146
|
-
"pip install vllm",
|
|
147
|
-
"# Make sure you have the latest version of mistral-common installed:",
|
|
148
|
-
"pip install --upgrade mistral-common",
|
|
149
|
-
].join("\n");
|
|
150
|
-
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id} --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"`;
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
setup = ["# Install vLLM from pip:", "pip install vllm"].join("\n");
|
|
154
|
-
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`;
|
|
155
|
-
}
|
|
156
162
|
return [
|
|
157
163
|
{
|
|
158
|
-
title: "Install from pip",
|
|
164
|
+
title: "Install from pip and serve model",
|
|
159
165
|
setup: setup,
|
|
160
|
-
content: [
|
|
166
|
+
content: [serverCommand, runCommand],
|
|
161
167
|
},
|
|
162
168
|
{
|
|
163
169
|
title: "Use Docker images",
|
|
164
|
-
setup:
|
|
165
|
-
|
|
166
|
-
`docker run --runtime nvidia --gpus all \\`,
|
|
167
|
-
` --name my_vllm_container \\`,
|
|
168
|
-
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
|
|
169
|
-
` --env "HUGGING_FACE_HUB_TOKEN=<secret>" \\`,
|
|
170
|
-
` -p 8000:8000 \\`,
|
|
171
|
-
` --ipc=host \\`,
|
|
172
|
-
` vllm/vllm-openai:latest \\`,
|
|
173
|
-
` --model ${model.id}`,
|
|
174
|
-
].join("\n"),
|
|
175
|
-
content: [dockerCommand, runCommand],
|
|
170
|
+
setup: dockerCommand,
|
|
171
|
+
content: [runCommand],
|
|
176
172
|
},
|
|
177
173
|
];
|
|
178
174
|
};
|
|
179
175
|
const snippetSglang = (model) => {
|
|
180
176
|
const messages = getModelInputSnippet(model);
|
|
181
177
|
const setup = ["# Install SGLang from pip:", "pip install sglang"].join("\n");
|
|
182
|
-
const serverCommand = `# Start the SGLang server
|
|
183
|
-
|
|
178
|
+
const serverCommand = `# Start the SGLang server:
|
|
179
|
+
python3 -m sglang.launch_server \\
|
|
180
|
+
--model-path "${model.id}" \\
|
|
181
|
+
--host 0.0.0.0 \\
|
|
182
|
+
--port 30000`;
|
|
184
183
|
const dockerCommand = `docker run --gpus all \\
|
|
185
184
|
--shm-size 32g \\
|
|
186
185
|
-p 30000:30000 \\
|
|
@@ -188,14 +187,31 @@ const snippetSglang = (model) => {
|
|
|
188
187
|
--env "HF_TOKEN=<secret>" \\
|
|
189
188
|
--ipc=host \\
|
|
190
189
|
lmsysorg/sglang:latest \\
|
|
191
|
-
python3 -m sglang.launch_server
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
python3 -m sglang.launch_server \\
|
|
191
|
+
--model-path "${model.id}" \\
|
|
192
|
+
--host 0.0.0.0 \\
|
|
193
|
+
--port 30000`;
|
|
194
|
+
const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
195
|
+
curl -X POST "http://localhost:30000/v1/chat/completions" \\
|
|
196
|
+
-H "Content-Type: application/json" \\
|
|
197
|
+
--data '{
|
|
198
|
+
"model": "${model.id}",
|
|
199
|
+
"messages": ${stringifyMessages(messages, {
|
|
195
200
|
indent: "\t\t",
|
|
196
201
|
attributeKeyQuotes: true,
|
|
197
202
|
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
198
|
-
})}
|
|
203
|
+
})}
|
|
204
|
+
}'`;
|
|
205
|
+
const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
206
|
+
curl -X POST "http://localhost:30000/v1/completions" \\
|
|
207
|
+
-H "Content-Type: application/json" \\
|
|
208
|
+
--data '{
|
|
209
|
+
"model": "${model.id}",
|
|
210
|
+
"prompt": "Once upon a time,",
|
|
211
|
+
"max_tokens": 512,
|
|
212
|
+
"temperature": 0.5
|
|
213
|
+
}'`;
|
|
214
|
+
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
199
215
|
return [
|
|
200
216
|
{
|
|
201
217
|
title: "Install from pip and serve model",
|
|
@@ -356,9 +372,12 @@ export const LOCAL_APPS = {
|
|
|
356
372
|
prettyLabel: "SGLang",
|
|
357
373
|
docsUrl: "https://docs.sglang.io",
|
|
358
374
|
mainTask: "text-generation",
|
|
359
|
-
displayOnModelPage: (model) =>
|
|
360
|
-
(model
|
|
361
|
-
model
|
|
375
|
+
displayOnModelPage: (model) => (isAwqModel(model) ||
|
|
376
|
+
isGptqModel(model) ||
|
|
377
|
+
isAqlmModel(model) ||
|
|
378
|
+
isMarlinModel(model) ||
|
|
379
|
+
isTransformersModel(model)) &&
|
|
380
|
+
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
|
|
362
381
|
snippet: snippetSglang,
|
|
363
382
|
},
|
|
364
383
|
"mlx-lm": {
|
|
@@ -108,4 +108,5 @@ export declare const whisperkit: () => string[];
|
|
|
108
108
|
export declare const threedtopia_xl: (model: ModelData) => string[];
|
|
109
109
|
export declare const hezar: (model: ModelData) => string[];
|
|
110
110
|
export declare const zonos: (model: ModelData) => string[];
|
|
111
|
+
export declare const moshi: (model: ModelData) => string[];
|
|
111
112
|
//# 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,iBAAiB,CAAC;AAkBjD,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAKjD,CAAC;AAkBF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAKjD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,KAAG,MAAM,EAIhD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,KAAG,MAAM,EAkBlD,CAAC;AAaF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,MAAM,EAY7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAenC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,KAAG,MAAM,E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,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAiB9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAgD9C,CAAC"}
|
|
@@ -51,14 +51,14 @@ from audioseal import AudioSeal
|
|
|
51
51
|
model = AudioSeal.load_generator("${model.id}")
|
|
52
52
|
# pass a tensor (tensor_wav) of shape (batch, channels, samples) and a sample rate
|
|
53
53
|
wav, sr = tensor_wav, 16000
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
watermark = model.get_watermark(wav, sr)
|
|
56
56
|
watermarked_audio = wav + watermark`;
|
|
57
57
|
const detectorSnippet = `# Watermark Detector
|
|
58
58
|
from audioseal import AudioSeal
|
|
59
59
|
|
|
60
60
|
detector = AudioSeal.load_detector("${model.id}")
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
result, message = detector.detect_watermark(watermarked_audio, sr)`;
|
|
63
63
|
return [watermarkSnippet, detectorSnippet];
|
|
64
64
|
};
|
|
@@ -600,7 +600,7 @@ export const cartesia_mlx = (model) => [
|
|
|
600
600
|
import cartesia_mlx as cmx
|
|
601
601
|
|
|
602
602
|
model = cmx.from_pretrained("${model.id}")
|
|
603
|
-
model.set_dtype(mx.float32)
|
|
603
|
+
model.set_dtype(mx.float32)
|
|
604
604
|
|
|
605
605
|
prompt = "Rene Descartes was"
|
|
606
606
|
|
|
@@ -724,7 +724,7 @@ export const keras = (model) => [
|
|
|
724
724
|
`# Available backend options are: "jax", "torch", "tensorflow".
|
|
725
725
|
import os
|
|
726
726
|
os.environ["KERAS_BACKEND"] = "jax"
|
|
727
|
-
|
|
727
|
+
|
|
728
728
|
import keras
|
|
729
729
|
|
|
730
730
|
model = keras.saving.load_model("hf://${model.id}")
|
|
@@ -893,7 +893,7 @@ model.score("query", ["doc1", "doc2", "doc3"])`,
|
|
|
893
893
|
from lightning_ir import BiEncoderModule, CrossEncoderModule
|
|
894
894
|
|
|
895
895
|
# depending on the model type, use either BiEncoderModule or CrossEncoderModule
|
|
896
|
-
model = BiEncoderModule("${model.id}")
|
|
896
|
+
model = BiEncoderModule("${model.id}")
|
|
897
897
|
# model = CrossEncoderModule("${model.id}")
|
|
898
898
|
|
|
899
899
|
model.score("query", ["doc1", "doc2", "doc3"])`,
|
|
@@ -939,7 +939,7 @@ pip install -e .[smolvla]`,
|
|
|
939
939
|
`# Launch finetuning on your dataset
|
|
940
940
|
python lerobot/scripts/train.py \\
|
|
941
941
|
--policy.path=${model.id} \\
|
|
942
|
-
--dataset.repo_id=lerobot/svla_so101_pickplace \\
|
|
942
|
+
--dataset.repo_id=lerobot/svla_so101_pickplace \\
|
|
943
943
|
--batch_size=64 \\
|
|
944
944
|
--steps=20000 \\
|
|
945
945
|
--output_dir=outputs/train/my_smolvla \\
|
|
@@ -949,7 +949,7 @@ python lerobot/scripts/train.py \\
|
|
|
949
949
|
];
|
|
950
950
|
if (model.id !== "lerobot/smolvla_base") {
|
|
951
951
|
// Inference snippet (only if not base model)
|
|
952
|
-
smolvlaSnippets.push(`# Run the policy using the record function
|
|
952
|
+
smolvlaSnippets.push(`# Run the policy using the record function
|
|
953
953
|
python -m lerobot.record \\
|
|
954
954
|
--robot.type=so101_follower \\
|
|
955
955
|
--robot.port=/dev/ttyACM0 \\ # <- Use your port
|
|
@@ -1064,11 +1064,13 @@ for res in output:
|
|
|
1064
1064
|
];
|
|
1065
1065
|
}
|
|
1066
1066
|
if (model.tags.includes("document-parse")) {
|
|
1067
|
+
const rawVersion = model.id.replace("PaddleOCR-VL-", "v");
|
|
1068
|
+
const version = rawVersion === "PaddleOCR-VL" ? "v1" : rawVersion;
|
|
1067
1069
|
return [
|
|
1068
1070
|
`# See https://www.paddleocr.ai/latest/version3.x/pipeline_usage/PaddleOCR-VL.html to installation
|
|
1069
1071
|
|
|
1070
1072
|
from paddleocr import PaddleOCRVL
|
|
1071
|
-
pipeline = PaddleOCRVL()
|
|
1073
|
+
pipeline = PaddleOCRVL(pipeline_version="${version}")
|
|
1072
1074
|
output = pipeline.predict("path/to/document_image.png")
|
|
1073
1075
|
for res in output:
|
|
1074
1076
|
res.print()
|
|
@@ -1094,7 +1096,7 @@ for res in output:
|
|
|
1094
1096
|
}
|
|
1095
1097
|
}
|
|
1096
1098
|
return [
|
|
1097
|
-
`# Please refer to the document for information on how to use the model.
|
|
1099
|
+
`# Please refer to the document for information on how to use the model.
|
|
1098
1100
|
# https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/module_overview.html`,
|
|
1099
1101
|
];
|
|
1100
1102
|
};
|
|
@@ -1139,7 +1141,7 @@ scipy.io.wavfile.write("output.wav", tts_model.sample_rate, audio.numpy())`,
|
|
|
1139
1141
|
];
|
|
1140
1142
|
export const pyannote_audio_pipeline = (model) => [
|
|
1141
1143
|
`from pyannote.audio import Pipeline
|
|
1142
|
-
|
|
1144
|
+
|
|
1143
1145
|
pipeline = Pipeline.from_pretrained("${model.id}")
|
|
1144
1146
|
|
|
1145
1147
|
# inference on the whole file
|
|
@@ -1175,7 +1177,7 @@ export const pyannote_audio = (model) => {
|
|
|
1175
1177
|
};
|
|
1176
1178
|
export const relik = (model) => [
|
|
1177
1179
|
`from relik import Relik
|
|
1178
|
-
|
|
1180
|
+
|
|
1179
1181
|
relik = Relik.from_pretrained("${model.id}")`,
|
|
1180
1182
|
];
|
|
1181
1183
|
export const renderformer = (model) => [
|
|
@@ -1346,7 +1348,7 @@ with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
|
1346
1348
|
const video_predictor = `# Use SAM2 with videos
|
|
1347
1349
|
import torch
|
|
1348
1350
|
from sam2.sam2_video_predictor import SAM2VideoPredictor
|
|
1349
|
-
|
|
1351
|
+
|
|
1350
1352
|
predictor = SAM2VideoPredictor.from_pretrained(${model.id})
|
|
1351
1353
|
|
|
1352
1354
|
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
@@ -2008,11 +2010,11 @@ export const outetts = (model) => {
|
|
|
2008
2010
|
return [
|
|
2009
2011
|
`
|
|
2010
2012
|
import outetts
|
|
2011
|
-
|
|
2013
|
+
|
|
2012
2014
|
enum = outetts.Models("${model.id}".split("/", 1)[1]) # VERSION_1_0_SIZE_1B
|
|
2013
2015
|
cfg = outetts.ModelConfig.auto_config(enum, outetts.Backend.HF)
|
|
2014
2016
|
tts = outetts.Interface(cfg)
|
|
2015
|
-
|
|
2017
|
+
|
|
2016
2018
|
speaker = tts.load_default_speaker("EN-FEMALE-1-NEUTRAL")
|
|
2017
2019
|
tts.generate(
|
|
2018
2020
|
outetts.GenerationConfig(
|
|
@@ -2043,7 +2045,7 @@ wav = model.generate(descriptions) # generates 3 samples.`,
|
|
|
2043
2045
|
];
|
|
2044
2046
|
const magnet = (model) => [
|
|
2045
2047
|
`from audiocraft.models import MAGNeT
|
|
2046
|
-
|
|
2048
|
+
|
|
2047
2049
|
model = MAGNeT.get_pretrained("${model.id}")
|
|
2048
2050
|
|
|
2049
2051
|
descriptions = ['disco beat', 'energetic EDM', 'funky groove']
|
|
@@ -2051,7 +2053,7 @@ wav = model.generate(descriptions) # generates 3 samples.`,
|
|
|
2051
2053
|
];
|
|
2052
2054
|
const audiogen = (model) => [
|
|
2053
2055
|
`from audiocraft.models import AudioGen
|
|
2054
|
-
|
|
2056
|
+
|
|
2055
2057
|
model = AudioGen.get_pretrained("${model.id}")
|
|
2056
2058
|
model.set_generation_params(duration=5) # generate 5 seconds.
|
|
2057
2059
|
descriptions = ['dog barking', 'sirene of an emergency vehicle', 'footsteps in a corridor']
|
|
@@ -2085,7 +2087,7 @@ brew install whisperkit-cli
|
|
|
2085
2087
|
|
|
2086
2088
|
# View all available inference options
|
|
2087
2089
|
whisperkit-cli transcribe --help
|
|
2088
|
-
|
|
2090
|
+
|
|
2089
2091
|
# Download and run inference using whisper base model
|
|
2090
2092
|
whisperkit-cli transcribe --audio-path /path/to/audio.mp3
|
|
2091
2093
|
|
|
@@ -2121,4 +2123,51 @@ audio = model.autoencoder.decode(codes)[0].cpu()
|
|
|
2121
2123
|
torchaudio.save("sample.wav", audio, model.autoencoder.sampling_rate)
|
|
2122
2124
|
`,
|
|
2123
2125
|
];
|
|
2126
|
+
export const moshi = (model) => {
|
|
2127
|
+
// Detect backend from model name (no distinguishing tags available)
|
|
2128
|
+
if (model.id.includes("-mlx")) {
|
|
2129
|
+
// MLX backend (macOS Apple Silicon)
|
|
2130
|
+
// -q flag only accepts 4 or 8, bf16 models don't use it
|
|
2131
|
+
const quantFlag = model.id.includes("-q4") ? " -q 4" : model.id.includes("-q8") ? " -q 8" : "";
|
|
2132
|
+
return [
|
|
2133
|
+
`# pip install moshi_mlx
|
|
2134
|
+
# Run local inference (macOS Apple Silicon)
|
|
2135
|
+
python -m moshi_mlx.local${quantFlag} --hf-repo "${model.id}"
|
|
2136
|
+
|
|
2137
|
+
# Or run with web UI
|
|
2138
|
+
python -m moshi_mlx.local_web${quantFlag} --hf-repo "${model.id}"`,
|
|
2139
|
+
];
|
|
2140
|
+
}
|
|
2141
|
+
if (model.id.includes("-candle")) {
|
|
2142
|
+
// Rust/Candle backend
|
|
2143
|
+
return [
|
|
2144
|
+
`# pip install rustymimi
|
|
2145
|
+
# Candle backend - see https://github.com/kyutai-labs/moshi
|
|
2146
|
+
# for Rust installation instructions`,
|
|
2147
|
+
];
|
|
2148
|
+
}
|
|
2149
|
+
// PyTorch backend (default)
|
|
2150
|
+
return [
|
|
2151
|
+
`# pip install moshi
|
|
2152
|
+
# Run the interactive web server
|
|
2153
|
+
python -m moshi.server --hf-repo "${model.id}"
|
|
2154
|
+
# Then open https://localhost:8998 in your browser`,
|
|
2155
|
+
`# pip install moshi
|
|
2156
|
+
import torch
|
|
2157
|
+
from moshi.models import loaders
|
|
2158
|
+
|
|
2159
|
+
# Load checkpoint info from HuggingFace
|
|
2160
|
+
checkpoint = loaders.CheckpointInfo.from_hf_repo("${model.id}")
|
|
2161
|
+
|
|
2162
|
+
# Load the Mimi audio codec
|
|
2163
|
+
mimi = checkpoint.get_mimi(device="cuda")
|
|
2164
|
+
mimi.set_num_codebooks(8)
|
|
2165
|
+
|
|
2166
|
+
# Encode audio (24kHz, mono)
|
|
2167
|
+
wav = torch.randn(1, 1, 24000 * 10) # [batch, channels, samples]
|
|
2168
|
+
with torch.no_grad():
|
|
2169
|
+
codes = mimi.encode(wav.cuda())
|
|
2170
|
+
decoded = mimi.decode(codes)`,
|
|
2171
|
+
];
|
|
2172
|
+
};
|
|
2124
2173
|
//#endregion
|
|
@@ -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,W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i",
|
|
818
818
|
repoUrl: "https://github.com/kyutai-labs/moshi",
|
|
819
|
+
snippets: snippets.moshi,
|
|
819
820
|
filter: false,
|
|
820
821
|
countDownloads: `path:"tokenizer-e351c8d8-checkpoint125.safetensors"`,
|
|
821
822
|
},
|
package/package.json
CHANGED
package/src/local-apps.ts
CHANGED
|
@@ -198,7 +198,33 @@ const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[]
|
|
|
198
198
|
|
|
199
199
|
const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
|
|
200
200
|
const messages = getModelInputSnippet(model) as ChatCompletionInputMessage[];
|
|
201
|
-
|
|
201
|
+
|
|
202
|
+
const isMistral = model.tags.includes("mistral-common");
|
|
203
|
+
const mistralFlags = isMistral
|
|
204
|
+
? " --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"
|
|
205
|
+
: "";
|
|
206
|
+
|
|
207
|
+
const setup = isMistral
|
|
208
|
+
? [
|
|
209
|
+
"# Install vLLM from pip:",
|
|
210
|
+
"pip install vllm",
|
|
211
|
+
"# Install mistral-common:",
|
|
212
|
+
"pip install --upgrade mistral-common",
|
|
213
|
+
].join("\n")
|
|
214
|
+
: ["# Install vLLM from pip:", "pip install vllm"].join("\n");
|
|
215
|
+
|
|
216
|
+
const serverCommand = `# Start the vLLM server:
|
|
217
|
+
vllm serve "${model.id}"${mistralFlags}`;
|
|
218
|
+
|
|
219
|
+
const dockerCommand = `docker run --gpus all \\
|
|
220
|
+
-v ~/.cache/huggingface:/root/.cache/huggingface \\
|
|
221
|
+
--env "HF_TOKEN=<secret>" \\
|
|
222
|
+
-p 8000:8000 \\
|
|
223
|
+
--ipc=host \\
|
|
224
|
+
vllm/vllm-openai:latest \\
|
|
225
|
+
--model "${model.id}"${mistralFlags}`;
|
|
226
|
+
|
|
227
|
+
const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
202
228
|
curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
203
229
|
-H "Content-Type: application/json" \\
|
|
204
230
|
--data '{
|
|
@@ -209,7 +235,7 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
|
209
235
|
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
210
236
|
})}
|
|
211
237
|
}'`;
|
|
212
|
-
const runCommandNonInstruct = `# Call the server using curl:
|
|
238
|
+
const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
213
239
|
curl -X POST "http://localhost:8000/v1/completions" \\
|
|
214
240
|
-H "Content-Type: application/json" \\
|
|
215
241
|
--data '{
|
|
@@ -220,42 +246,16 @@ curl -X POST "http://localhost:8000/v1/completions" \\
|
|
|
220
246
|
}'`;
|
|
221
247
|
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
222
248
|
|
|
223
|
-
let setup;
|
|
224
|
-
let dockerCommand;
|
|
225
|
-
|
|
226
|
-
if (model.tags.includes("mistral-common")) {
|
|
227
|
-
setup = [
|
|
228
|
-
"# Install vLLM from pip:",
|
|
229
|
-
"pip install vllm",
|
|
230
|
-
"# Make sure you have the latest version of mistral-common installed:",
|
|
231
|
-
"pip install --upgrade mistral-common",
|
|
232
|
-
].join("\n");
|
|
233
|
-
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id} --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"`;
|
|
234
|
-
} else {
|
|
235
|
-
setup = ["# Install vLLM from pip:", "pip install vllm"].join("\n");
|
|
236
|
-
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
249
|
return [
|
|
240
250
|
{
|
|
241
|
-
title: "Install from pip",
|
|
251
|
+
title: "Install from pip and serve model",
|
|
242
252
|
setup: setup,
|
|
243
|
-
content: [
|
|
253
|
+
content: [serverCommand, runCommand],
|
|
244
254
|
},
|
|
245
255
|
{
|
|
246
256
|
title: "Use Docker images",
|
|
247
|
-
setup:
|
|
248
|
-
|
|
249
|
-
`docker run --runtime nvidia --gpus all \\`,
|
|
250
|
-
` --name my_vllm_container \\`,
|
|
251
|
-
` -v ~/.cache/huggingface:/root/.cache/huggingface \\`,
|
|
252
|
-
` --env "HUGGING_FACE_HUB_TOKEN=<secret>" \\`,
|
|
253
|
-
` -p 8000:8000 \\`,
|
|
254
|
-
` --ipc=host \\`,
|
|
255
|
-
` vllm/vllm-openai:latest \\`,
|
|
256
|
-
` --model ${model.id}`,
|
|
257
|
-
].join("\n"),
|
|
258
|
-
content: [dockerCommand, runCommand],
|
|
257
|
+
setup: dockerCommand,
|
|
258
|
+
content: [runCommand],
|
|
259
259
|
},
|
|
260
260
|
];
|
|
261
261
|
};
|
|
@@ -263,8 +263,11 @@ const snippetSglang = (model: ModelData): LocalAppSnippet[] => {
|
|
|
263
263
|
const messages = getModelInputSnippet(model) as ChatCompletionInputMessage[];
|
|
264
264
|
|
|
265
265
|
const setup = ["# Install SGLang from pip:", "pip install sglang"].join("\n");
|
|
266
|
-
const serverCommand = `# Start the SGLang server
|
|
267
|
-
|
|
266
|
+
const serverCommand = `# Start the SGLang server:
|
|
267
|
+
python3 -m sglang.launch_server \\
|
|
268
|
+
--model-path "${model.id}" \\
|
|
269
|
+
--host 0.0.0.0 \\
|
|
270
|
+
--port 30000`;
|
|
268
271
|
const dockerCommand = `docker run --gpus all \\
|
|
269
272
|
--shm-size 32g \\
|
|
270
273
|
-p 30000:30000 \\
|
|
@@ -272,14 +275,31 @@ const snippetSglang = (model: ModelData): LocalAppSnippet[] => {
|
|
|
272
275
|
--env "HF_TOKEN=<secret>" \\
|
|
273
276
|
--ipc=host \\
|
|
274
277
|
lmsysorg/sglang:latest \\
|
|
275
|
-
python3 -m sglang.launch_server
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
278
|
+
python3 -m sglang.launch_server \\
|
|
279
|
+
--model-path "${model.id}" \\
|
|
280
|
+
--host 0.0.0.0 \\
|
|
281
|
+
--port 30000`;
|
|
282
|
+
const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
283
|
+
curl -X POST "http://localhost:30000/v1/chat/completions" \\
|
|
284
|
+
-H "Content-Type: application/json" \\
|
|
285
|
+
--data '{
|
|
286
|
+
"model": "${model.id}",
|
|
287
|
+
"messages": ${stringifyMessages(messages, {
|
|
288
|
+
indent: "\t\t",
|
|
289
|
+
attributeKeyQuotes: true,
|
|
290
|
+
customContentEscaper: (str) => str.replace(/'/g, "'\\''"),
|
|
291
|
+
})}
|
|
292
|
+
}'`;
|
|
293
|
+
const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API):
|
|
294
|
+
curl -X POST "http://localhost:30000/v1/completions" \\
|
|
295
|
+
-H "Content-Type: application/json" \\
|
|
296
|
+
--data '{
|
|
297
|
+
"model": "${model.id}",
|
|
298
|
+
"prompt": "Once upon a time,",
|
|
299
|
+
"max_tokens": 512,
|
|
300
|
+
"temperature": 0.5
|
|
301
|
+
}'`;
|
|
302
|
+
const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct;
|
|
283
303
|
|
|
284
304
|
return [
|
|
285
305
|
{
|
|
@@ -449,9 +469,12 @@ export const LOCAL_APPS = {
|
|
|
449
469
|
docsUrl: "https://docs.sglang.io",
|
|
450
470
|
mainTask: "text-generation",
|
|
451
471
|
displayOnModelPage: (model: ModelData) =>
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
472
|
+
(isAwqModel(model) ||
|
|
473
|
+
isGptqModel(model) ||
|
|
474
|
+
isAqlmModel(model) ||
|
|
475
|
+
isMarlinModel(model) ||
|
|
476
|
+
isTransformersModel(model)) &&
|
|
477
|
+
(model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"),
|
|
455
478
|
snippet: snippetSglang,
|
|
456
479
|
},
|
|
457
480
|
"mlx-lm": {
|
|
@@ -65,7 +65,7 @@ from audioseal import AudioSeal
|
|
|
65
65
|
model = AudioSeal.load_generator("${model.id}")
|
|
66
66
|
# pass a tensor (tensor_wav) of shape (batch, channels, samples) and a sample rate
|
|
67
67
|
wav, sr = tensor_wav, 16000
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
watermark = model.get_watermark(wav, sr)
|
|
70
70
|
watermarked_audio = wav + watermark`;
|
|
71
71
|
|
|
@@ -73,7 +73,7 @@ watermarked_audio = wav + watermark`;
|
|
|
73
73
|
from audioseal import AudioSeal
|
|
74
74
|
|
|
75
75
|
detector = AudioSeal.load_detector("${model.id}")
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
result, message = detector.detect_watermark(watermarked_audio, sr)`;
|
|
78
78
|
return [watermarkSnippet, detectorSnippet];
|
|
79
79
|
};
|
|
@@ -656,7 +656,7 @@ export const cartesia_mlx = (model: ModelData): string[] => [
|
|
|
656
656
|
import cartesia_mlx as cmx
|
|
657
657
|
|
|
658
658
|
model = cmx.from_pretrained("${model.id}")
|
|
659
|
-
model.set_dtype(mx.float32)
|
|
659
|
+
model.set_dtype(mx.float32)
|
|
660
660
|
|
|
661
661
|
prompt = "Rene Descartes was"
|
|
662
662
|
|
|
@@ -791,7 +791,7 @@ export const keras = (model: ModelData): string[] => [
|
|
|
791
791
|
`# Available backend options are: "jax", "torch", "tensorflow".
|
|
792
792
|
import os
|
|
793
793
|
os.environ["KERAS_BACKEND"] = "jax"
|
|
794
|
-
|
|
794
|
+
|
|
795
795
|
import keras
|
|
796
796
|
|
|
797
797
|
model = keras.saving.load_model("hf://${model.id}")
|
|
@@ -974,7 +974,7 @@ model.score("query", ["doc1", "doc2", "doc3"])`,
|
|
|
974
974
|
from lightning_ir import BiEncoderModule, CrossEncoderModule
|
|
975
975
|
|
|
976
976
|
# depending on the model type, use either BiEncoderModule or CrossEncoderModule
|
|
977
|
-
model = BiEncoderModule("${model.id}")
|
|
977
|
+
model = BiEncoderModule("${model.id}")
|
|
978
978
|
# model = CrossEncoderModule("${model.id}")
|
|
979
979
|
|
|
980
980
|
model.score("query", ["doc1", "doc2", "doc3"])`,
|
|
@@ -1023,7 +1023,7 @@ pip install -e .[smolvla]`,
|
|
|
1023
1023
|
`# Launch finetuning on your dataset
|
|
1024
1024
|
python lerobot/scripts/train.py \\
|
|
1025
1025
|
--policy.path=${model.id} \\
|
|
1026
|
-
--dataset.repo_id=lerobot/svla_so101_pickplace \\
|
|
1026
|
+
--dataset.repo_id=lerobot/svla_so101_pickplace \\
|
|
1027
1027
|
--batch_size=64 \\
|
|
1028
1028
|
--steps=20000 \\
|
|
1029
1029
|
--output_dir=outputs/train/my_smolvla \\
|
|
@@ -1034,7 +1034,7 @@ python lerobot/scripts/train.py \\
|
|
|
1034
1034
|
if (model.id !== "lerobot/smolvla_base") {
|
|
1035
1035
|
// Inference snippet (only if not base model)
|
|
1036
1036
|
smolvlaSnippets.push(
|
|
1037
|
-
`# Run the policy using the record function
|
|
1037
|
+
`# Run the policy using the record function
|
|
1038
1038
|
python -m lerobot.record \\
|
|
1039
1039
|
--robot.type=so101_follower \\
|
|
1040
1040
|
--robot.port=/dev/ttyACM0 \\ # <- Use your port
|
|
@@ -1159,11 +1159,13 @@ for res in output:
|
|
|
1159
1159
|
}
|
|
1160
1160
|
|
|
1161
1161
|
if (model.tags.includes("document-parse")) {
|
|
1162
|
+
const rawVersion = model.id.replace("PaddleOCR-VL-", "v");
|
|
1163
|
+
const version = rawVersion === "PaddleOCR-VL" ? "v1" : rawVersion;
|
|
1162
1164
|
return [
|
|
1163
1165
|
`# See https://www.paddleocr.ai/latest/version3.x/pipeline_usage/PaddleOCR-VL.html to installation
|
|
1164
1166
|
|
|
1165
1167
|
from paddleocr import PaddleOCRVL
|
|
1166
|
-
pipeline = PaddleOCRVL()
|
|
1168
|
+
pipeline = PaddleOCRVL(pipeline_version="${version}")
|
|
1167
1169
|
output = pipeline.predict("path/to/document_image.png")
|
|
1168
1170
|
for res in output:
|
|
1169
1171
|
res.print()
|
|
@@ -1191,7 +1193,7 @@ for res in output:
|
|
|
1191
1193
|
}
|
|
1192
1194
|
|
|
1193
1195
|
return [
|
|
1194
|
-
`# Please refer to the document for information on how to use the model.
|
|
1196
|
+
`# Please refer to the document for information on how to use the model.
|
|
1195
1197
|
# https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/module_overview.html`,
|
|
1196
1198
|
];
|
|
1197
1199
|
};
|
|
@@ -1240,7 +1242,7 @@ scipy.io.wavfile.write("output.wav", tts_model.sample_rate, audio.numpy())`,
|
|
|
1240
1242
|
|
|
1241
1243
|
export const pyannote_audio_pipeline = (model: ModelData): string[] => [
|
|
1242
1244
|
`from pyannote.audio import Pipeline
|
|
1243
|
-
|
|
1245
|
+
|
|
1244
1246
|
pipeline = Pipeline.from_pretrained("${model.id}")
|
|
1245
1247
|
|
|
1246
1248
|
# inference on the whole file
|
|
@@ -1279,7 +1281,7 @@ export const pyannote_audio = (model: ModelData): string[] => {
|
|
|
1279
1281
|
|
|
1280
1282
|
export const relik = (model: ModelData): string[] => [
|
|
1281
1283
|
`from relik import Relik
|
|
1282
|
-
|
|
1284
|
+
|
|
1283
1285
|
relik = Relik.from_pretrained("${model.id}")`,
|
|
1284
1286
|
];
|
|
1285
1287
|
|
|
@@ -1463,7 +1465,7 @@ with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
|
1463
1465
|
const video_predictor = `# Use SAM2 with videos
|
|
1464
1466
|
import torch
|
|
1465
1467
|
from sam2.sam2_video_predictor import SAM2VideoPredictor
|
|
1466
|
-
|
|
1468
|
+
|
|
1467
1469
|
predictor = SAM2VideoPredictor.from_pretrained(${model.id})
|
|
1468
1470
|
|
|
1469
1471
|
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
|
|
@@ -2247,11 +2249,11 @@ export const outetts = (model: ModelData): string[] => {
|
|
|
2247
2249
|
return [
|
|
2248
2250
|
`
|
|
2249
2251
|
import outetts
|
|
2250
|
-
|
|
2252
|
+
|
|
2251
2253
|
enum = outetts.Models("${model.id}".split("/", 1)[1]) # VERSION_1_0_SIZE_1B
|
|
2252
2254
|
cfg = outetts.ModelConfig.auto_config(enum, outetts.Backend.HF)
|
|
2253
2255
|
tts = outetts.Interface(cfg)
|
|
2254
|
-
|
|
2256
|
+
|
|
2255
2257
|
speaker = tts.load_default_speaker("EN-FEMALE-1-NEUTRAL")
|
|
2256
2258
|
tts.generate(
|
|
2257
2259
|
outetts.GenerationConfig(
|
|
@@ -2286,7 +2288,7 @@ wav = model.generate(descriptions) # generates 3 samples.`,
|
|
|
2286
2288
|
|
|
2287
2289
|
const magnet = (model: ModelData): string[] => [
|
|
2288
2290
|
`from audiocraft.models import MAGNeT
|
|
2289
|
-
|
|
2291
|
+
|
|
2290
2292
|
model = MAGNeT.get_pretrained("${model.id}")
|
|
2291
2293
|
|
|
2292
2294
|
descriptions = ['disco beat', 'energetic EDM', 'funky groove']
|
|
@@ -2295,7 +2297,7 @@ wav = model.generate(descriptions) # generates 3 samples.`,
|
|
|
2295
2297
|
|
|
2296
2298
|
const audiogen = (model: ModelData): string[] => [
|
|
2297
2299
|
`from audiocraft.models import AudioGen
|
|
2298
|
-
|
|
2300
|
+
|
|
2299
2301
|
model = AudioGen.get_pretrained("${model.id}")
|
|
2300
2302
|
model.set_generation_params(duration=5) # generate 5 seconds.
|
|
2301
2303
|
descriptions = ['dog barking', 'sirene of an emergency vehicle', 'footsteps in a corridor']
|
|
@@ -2328,7 +2330,7 @@ brew install whisperkit-cli
|
|
|
2328
2330
|
|
|
2329
2331
|
# View all available inference options
|
|
2330
2332
|
whisperkit-cli transcribe --help
|
|
2331
|
-
|
|
2333
|
+
|
|
2332
2334
|
# Download and run inference using whisper base model
|
|
2333
2335
|
whisperkit-cli transcribe --audio-path /path/to/audio.mp3
|
|
2334
2336
|
|
|
@@ -2368,4 +2370,54 @@ torchaudio.save("sample.wav", audio, model.autoencoder.sampling_rate)
|
|
|
2368
2370
|
`,
|
|
2369
2371
|
];
|
|
2370
2372
|
|
|
2373
|
+
export const moshi = (model: ModelData): string[] => {
|
|
2374
|
+
// Detect backend from model name (no distinguishing tags available)
|
|
2375
|
+
if (model.id.includes("-mlx")) {
|
|
2376
|
+
// MLX backend (macOS Apple Silicon)
|
|
2377
|
+
// -q flag only accepts 4 or 8, bf16 models don't use it
|
|
2378
|
+
const quantFlag = model.id.includes("-q4") ? " -q 4" : model.id.includes("-q8") ? " -q 8" : "";
|
|
2379
|
+
return [
|
|
2380
|
+
`# pip install moshi_mlx
|
|
2381
|
+
# Run local inference (macOS Apple Silicon)
|
|
2382
|
+
python -m moshi_mlx.local${quantFlag} --hf-repo "${model.id}"
|
|
2383
|
+
|
|
2384
|
+
# Or run with web UI
|
|
2385
|
+
python -m moshi_mlx.local_web${quantFlag} --hf-repo "${model.id}"`,
|
|
2386
|
+
];
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
if (model.id.includes("-candle")) {
|
|
2390
|
+
// Rust/Candle backend
|
|
2391
|
+
return [
|
|
2392
|
+
`# pip install rustymimi
|
|
2393
|
+
# Candle backend - see https://github.com/kyutai-labs/moshi
|
|
2394
|
+
# for Rust installation instructions`,
|
|
2395
|
+
];
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
// PyTorch backend (default)
|
|
2399
|
+
return [
|
|
2400
|
+
`# pip install moshi
|
|
2401
|
+
# Run the interactive web server
|
|
2402
|
+
python -m moshi.server --hf-repo "${model.id}"
|
|
2403
|
+
# Then open https://localhost:8998 in your browser`,
|
|
2404
|
+
`# pip install moshi
|
|
2405
|
+
import torch
|
|
2406
|
+
from moshi.models import loaders
|
|
2407
|
+
|
|
2408
|
+
# Load checkpoint info from HuggingFace
|
|
2409
|
+
checkpoint = loaders.CheckpointInfo.from_hf_repo("${model.id}")
|
|
2410
|
+
|
|
2411
|
+
# Load the Mimi audio codec
|
|
2412
|
+
mimi = checkpoint.get_mimi(device="cuda")
|
|
2413
|
+
mimi.set_num_codebooks(8)
|
|
2414
|
+
|
|
2415
|
+
# Encode audio (24kHz, mono)
|
|
2416
|
+
wav = torch.randn(1, 1, 24000 * 10) # [batch, channels, samples]
|
|
2417
|
+
with torch.no_grad():
|
|
2418
|
+
codes = mimi.encode(wav.cuda())
|
|
2419
|
+
decoded = mimi.decode(codes)`,
|
|
2420
|
+
];
|
|
2421
|
+
};
|
|
2422
|
+
|
|
2371
2423
|
//#endregion
|
package/src/model-libraries.ts
CHANGED
|
@@ -860,6 +860,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
860
860
|
prettyLabel: "Moshi",
|
|
861
861
|
repoName: "Moshi",
|
|
862
862
|
repoUrl: "https://github.com/kyutai-labs/moshi",
|
|
863
|
+
snippets: snippets.moshi,
|
|
863
864
|
filter: false,
|
|
864
865
|
countDownloads: `path:"tokenizer-e351c8d8-checkpoint125.safetensors"`,
|
|
865
866
|
},
|