@huggingface/tasks 0.19.61 → 0.19.63
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-snippets.d.ts +1 -1
- package/dist/commonjs/model-libraries-snippets.d.ts.map +1 -1
- package/dist/commonjs/model-libraries-snippets.js +46 -32
- package/dist/commonjs/model-libraries.d.ts +8 -8
- package/dist/commonjs/model-libraries.d.ts.map +1 -1
- package/dist/commonjs/model-libraries.js +7 -7
- package/dist/esm/model-libraries-snippets.d.ts +1 -1
- package/dist/esm/model-libraries-snippets.d.ts.map +1 -1
- package/dist/esm/model-libraries-snippets.js +44 -30
- package/dist/esm/model-libraries.d.ts +8 -8
- package/dist/esm/model-libraries.d.ts.map +1 -1
- package/dist/esm/model-libraries.js +7 -7
- package/package.json +1 -1
- package/src/model-libraries-snippets.ts +44 -30
- package/src/model-libraries.ts +7 -7
|
@@ -9,7 +9,7 @@ export declare const bertopic: (model: ModelData) => string[];
|
|
|
9
9
|
export declare const bm25s: (model: ModelData) => string[];
|
|
10
10
|
export declare const chatterbox: () => string[];
|
|
11
11
|
export declare const chronos_forecasting: (model: ModelData) => string[];
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const sap_rpt_one_oss: () => string[];
|
|
13
13
|
export declare const cxr_foundation: () => string[];
|
|
14
14
|
export declare const depth_anything_v2: (model: ModelData) => string[];
|
|
15
15
|
export declare const depth_pro: (model: ModelData) => string[];
|
|
@@ -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,e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,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAiB9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pyannote_audio = exports.pyannote_audio_pipeline = exports.phantom_wan = 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.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.dia = exports.derm_foundation = exports.depth_pro = exports.depth_anything_v2 = exports.cxr_foundation = exports.
|
|
3
|
+
exports.pyannote_audio = exports.pyannote_audio_pipeline = exports.phantom_wan = 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.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.dia = exports.derm_foundation = exports.depth_pro = exports.depth_anything_v2 = exports.cxr_foundation = exports.sap_rpt_one_oss = 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.threedtopia_xl = exports.whisperkit = exports.audiocraft = exports.anemoi = exports.pythae = exports.pxia = exports.outetts = exports.nemo = exports.pruna = exports.model2vec = exports.mlx = exports.mlxim = exports.univa = exports.swarmformer = 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.sam2 = exports.fastai = exports.stable_audio_tools = exports.sklearn = exports.seed_story = exports.saelens = exports.timm = exports.tensorflowtts = exports.renderformer = exports.relik = void 0;
|
|
5
5
|
exports.zonos = exports.hezar = void 0;
|
|
6
6
|
const library_to_tasks_js_1 = require("./library-to-tasks.js");
|
|
@@ -146,22 +146,21 @@ pred_df = pipeline.predict_df(
|
|
|
146
146
|
return [installSnippet, exampleSnippet];
|
|
147
147
|
};
|
|
148
148
|
exports.chronos_forecasting = chronos_forecasting;
|
|
149
|
-
const
|
|
150
|
-
const installSnippet = `pip install git+https://github.com/SAP-samples/
|
|
149
|
+
const sap_rpt_one_oss = () => {
|
|
150
|
+
const installSnippet = `pip install git+https://github.com/SAP-samples/sap-rpt-1-oss`;
|
|
151
151
|
const classificationSnippet = `# Run a classification task
|
|
152
152
|
from sklearn.datasets import load_breast_cancer
|
|
153
153
|
from sklearn.metrics import accuracy_score
|
|
154
154
|
from sklearn.model_selection import train_test_split
|
|
155
155
|
|
|
156
|
-
from
|
|
156
|
+
from sap_rpt_oss import SAP_RPT_OSS_Classifier
|
|
157
157
|
|
|
158
158
|
# Load sample data
|
|
159
159
|
X, y = load_breast_cancer(return_X_y=True)
|
|
160
160
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
|
|
161
161
|
|
|
162
|
-
# Initialize a classifier
|
|
163
|
-
|
|
164
|
-
clf = ConTextTabClassifier(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
|
|
162
|
+
# Initialize a classifier, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
|
|
163
|
+
clf = SAP_RPT_OSS_Classifier(max_context_size=8192, bagging=8)
|
|
165
164
|
|
|
166
165
|
clf.fit(X_train, y_train)
|
|
167
166
|
|
|
@@ -175,8 +174,7 @@ from sklearn.datasets import fetch_openml
|
|
|
175
174
|
from sklearn.metrics import r2_score
|
|
176
175
|
from sklearn.model_selection import train_test_split
|
|
177
176
|
|
|
178
|
-
from
|
|
179
|
-
|
|
177
|
+
from sap_rpt_oss import SAP_RPT_OSS_Regressor
|
|
180
178
|
|
|
181
179
|
# Load sample data
|
|
182
180
|
df = fetch_openml(data_id=531, as_frame=True)
|
|
@@ -186,9 +184,8 @@ y = df.target.astype(float)
|
|
|
186
184
|
# Train-test split
|
|
187
185
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
|
|
188
186
|
|
|
189
|
-
# Initialize the regressor
|
|
190
|
-
|
|
191
|
-
regressor = ConTextTabRegressor(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
|
|
187
|
+
# Initialize the regressor, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
|
|
188
|
+
regressor = SAP_RPT_OSS_Regressor(max_context_size=8192, bagging=8)
|
|
192
189
|
|
|
193
190
|
regressor.fit(X_train, y_train)
|
|
194
191
|
|
|
@@ -199,7 +196,7 @@ r2 = r2_score(y_test, predictions)
|
|
|
199
196
|
print("R² Score:", r2)`;
|
|
200
197
|
return [installSnippet, classificationSnippet, regressionsSnippet];
|
|
201
198
|
};
|
|
202
|
-
exports.
|
|
199
|
+
exports.sap_rpt_one_oss = sap_rpt_one_oss;
|
|
203
200
|
const cxr_foundation = () => [
|
|
204
201
|
`# pip install git+https://github.com/Google-Health/cxr-foundation.git#subdirectory=python
|
|
205
202
|
|
|
@@ -333,23 +330,27 @@ dam = DescribeAnythingModel(
|
|
|
333
330
|
)`,
|
|
334
331
|
];
|
|
335
332
|
exports.describe_anything = describe_anything;
|
|
336
|
-
const diffusers_install = "pip install -U diffusers transformers";
|
|
333
|
+
const diffusers_install = "pip install -U diffusers transformers accelerate";
|
|
337
334
|
const diffusersDefaultPrompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k";
|
|
338
335
|
const diffusersImg2ImgDefaultPrompt = "Turn this cat into a dog";
|
|
339
336
|
const diffusersVideoDefaultPrompt = "A man with short gray hair plays a red electric guitar.";
|
|
340
337
|
const diffusers_default = (model) => [
|
|
341
|
-
`
|
|
338
|
+
`import torch
|
|
339
|
+
from diffusers import DiffusionPipeline
|
|
342
340
|
|
|
343
|
-
|
|
341
|
+
# switch to "mps" for apple devices
|
|
342
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
344
343
|
|
|
345
344
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
|
|
346
345
|
image = pipe(prompt).images[0]`,
|
|
347
346
|
];
|
|
348
347
|
const diffusers_image_to_image = (model) => [
|
|
349
|
-
`
|
|
348
|
+
`import torch
|
|
349
|
+
from diffusers import DiffusionPipeline
|
|
350
350
|
from diffusers.utils import load_image
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
# switch to "mps" for apple devices
|
|
353
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
353
354
|
|
|
354
355
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
|
|
355
356
|
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
|
@@ -361,7 +362,8 @@ const diffusers_image_to_video = (model) => [
|
|
|
361
362
|
from diffusers import DiffusionPipeline
|
|
362
363
|
from diffusers.utils import load_image, export_to_video
|
|
363
364
|
|
|
364
|
-
|
|
365
|
+
# switch to "mps" for apple devices
|
|
366
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
365
367
|
pipe.to("cuda")
|
|
366
368
|
|
|
367
369
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -381,19 +383,23 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
|
381
383
|
)`,
|
|
382
384
|
];
|
|
383
385
|
const diffusers_lora = (model) => [
|
|
384
|
-
`
|
|
386
|
+
`import torch
|
|
387
|
+
from diffusers import DiffusionPipeline
|
|
385
388
|
|
|
386
|
-
|
|
389
|
+
# switch to "mps" for apple devices
|
|
390
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
387
391
|
pipe.load_lora_weights("${model.id}")
|
|
388
392
|
|
|
389
393
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
|
|
390
394
|
image = pipe(prompt).images[0]`,
|
|
391
395
|
];
|
|
392
396
|
const diffusers_lora_image_to_image = (model) => [
|
|
393
|
-
`
|
|
397
|
+
`import torch
|
|
398
|
+
from diffusers import DiffusionPipeline
|
|
394
399
|
from diffusers.utils import load_image
|
|
395
400
|
|
|
396
|
-
|
|
401
|
+
# switch to "mps" for apple devices
|
|
402
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
397
403
|
pipe.load_lora_weights("${model.id}")
|
|
398
404
|
|
|
399
405
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
|
|
@@ -402,10 +408,12 @@ input_image = load_image("https://huggingface.co/datasets/huggingface/documentat
|
|
|
402
408
|
image = pipe(image=input_image, prompt=prompt).images[0]`,
|
|
403
409
|
];
|
|
404
410
|
const diffusers_lora_text_to_video = (model) => [
|
|
405
|
-
`
|
|
411
|
+
`import torch
|
|
412
|
+
from diffusers import DiffusionPipeline
|
|
406
413
|
from diffusers.utils import export_to_video
|
|
407
414
|
|
|
408
|
-
|
|
415
|
+
# switch to "mps" for apple devices
|
|
416
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
409
417
|
pipe.load_lora_weights("${model.id}")
|
|
410
418
|
|
|
411
419
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -414,10 +422,12 @@ output = pipe(prompt=prompt).frames[0]
|
|
|
414
422
|
export_to_video(output, "output.mp4")`,
|
|
415
423
|
];
|
|
416
424
|
const diffusers_lora_image_to_video = (model) => [
|
|
417
|
-
`
|
|
425
|
+
`import torch
|
|
426
|
+
from diffusers import DiffusionPipeline
|
|
418
427
|
from diffusers.utils import load_image, export_to_video
|
|
419
428
|
|
|
420
|
-
|
|
429
|
+
# switch to "mps" for apple devices
|
|
430
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
421
431
|
pipe.load_lora_weights("${model.id}")
|
|
422
432
|
|
|
423
433
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -427,9 +437,11 @@ image = pipe(image=input_image, prompt=prompt).frames[0]
|
|
|
427
437
|
export_to_video(output, "output.mp4")`,
|
|
428
438
|
];
|
|
429
439
|
const diffusers_textual_inversion = (model) => [
|
|
430
|
-
`
|
|
440
|
+
`import torch
|
|
441
|
+
from diffusers import DiffusionPipeline
|
|
431
442
|
|
|
432
|
-
|
|
443
|
+
# switch to "mps" for apple devices
|
|
444
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
433
445
|
pipe.load_textual_inversion("${model.id}")`,
|
|
434
446
|
];
|
|
435
447
|
const diffusers_flux_fill = (model) => [
|
|
@@ -440,7 +452,8 @@ from diffusers.utils import load_image
|
|
|
440
452
|
image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
|
|
441
453
|
mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
|
|
442
454
|
|
|
443
|
-
|
|
455
|
+
# switch to "mps" for apple devices
|
|
456
|
+
pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
444
457
|
image = pipe(
|
|
445
458
|
prompt="a white paper cup",
|
|
446
459
|
image=image,
|
|
@@ -459,7 +472,8 @@ const diffusers_inpainting = (model) => [
|
|
|
459
472
|
from diffusers import AutoPipelineForInpainting
|
|
460
473
|
from diffusers.utils import load_image
|
|
461
474
|
|
|
462
|
-
|
|
475
|
+
# switch to "mps" for apple devices
|
|
476
|
+
pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda")
|
|
463
477
|
|
|
464
478
|
img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
|
|
465
479
|
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
|
|
@@ -1534,7 +1548,7 @@ const transformers = (model) => {
|
|
|
1534
1548
|
}
|
|
1535
1549
|
}
|
|
1536
1550
|
else {
|
|
1537
|
-
autoSnippet.push("# Load model directly", `from transformers import ${info.auto_model}`, `model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ',
|
|
1551
|
+
autoSnippet.push("# Load model directly", `from transformers import ${info.auto_model}`, `model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ', dtype="auto")');
|
|
1538
1552
|
}
|
|
1539
1553
|
if (model.pipeline_tag && library_to_tasks_js_1.LIBRARY_TASK_MAPPING.transformers?.includes(model.pipeline_tag)) {
|
|
1540
1554
|
const pipelineSnippet = [
|
|
@@ -231,13 +231,6 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
231
231
|
repoUrl: string;
|
|
232
232
|
countDownloads: string;
|
|
233
233
|
};
|
|
234
|
-
contexttab: {
|
|
235
|
-
prettyLabel: string;
|
|
236
|
-
repoName: string;
|
|
237
|
-
repoUrl: string;
|
|
238
|
-
countDownloads: string;
|
|
239
|
-
snippets: () => string[];
|
|
240
|
-
};
|
|
241
234
|
cosmos: {
|
|
242
235
|
prettyLabel: string;
|
|
243
236
|
repoName: string;
|
|
@@ -957,6 +950,13 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
957
950
|
filter: true;
|
|
958
951
|
countDownloads: string;
|
|
959
952
|
};
|
|
953
|
+
"sap-rpt-1-oss": {
|
|
954
|
+
prettyLabel: string;
|
|
955
|
+
repoName: string;
|
|
956
|
+
repoUrl: string;
|
|
957
|
+
countDownloads: string;
|
|
958
|
+
snippets: () => string[];
|
|
959
|
+
};
|
|
960
960
|
sapiens: {
|
|
961
961
|
prettyLabel: string;
|
|
962
962
|
repoName: string;
|
|
@@ -1346,5 +1346,5 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
1346
1346
|
};
|
|
1347
1347
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
1348
1348
|
export declare const ALL_MODEL_LIBRARY_KEYS: ModelLibraryKey[];
|
|
1349
|
-
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("acestep" | "adapter-transformers" | "allennlp" | "anemoi" | "araclip" | "asteroid" | "audiocraft" | "audioseal" | "bagel-mot" | "bboxmaskpose" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "boltzgen" | "champ" | "chatterbox" | "chat_tts" | "chronos-forecasting" | "cloud-agents" | "colpali" | "comet" | "
|
|
1349
|
+
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("acestep" | "adapter-transformers" | "allennlp" | "anemoi" | "araclip" | "asteroid" | "audiocraft" | "audioseal" | "bagel-mot" | "bboxmaskpose" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "boltzgen" | "champ" | "chatterbox" | "chat_tts" | "chronos-forecasting" | "cloud-agents" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "describe-anything" | "dia-tts" | "diff-interpretation-tuning" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cosyvoice" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fastprint" | "fasttext" | "flair" | "fme" | "gemma.cpp" | "geometry-crafter" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hermes" | "hezar" | "htrflow" | "hunyuan-dit" | "hunyuan3d-2" | "hunyuanworld-voyager" | "imstoucan" | "index-tts" | "infinitetalk" | "infinite-you" | "keras" | "tf-keras" | "keras-hub" | "kernels" | "kimi-audio" | "kittentts" | "kronos" | "k2" | "lightning-ir" | "litert" | "litert-lm" | "lerobot" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "magi-1" | "magenta-realtime" | "mamba-ssm" | "mars5-tts" | "matanyone" | "mesh-anything" | "merlin" | "medvae" | "mitie" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "mtvcraft" | "nemo" | "open-oasis" | "open_clip" | "openpeerllm" | "open-sora" | "outetts" | "paddlenlp" | "PaddleOCR" | "peft" | "perception-encoder" | "phantom-wan" | "pruna-ai" | "pxia" | "pyannote-audio" | "py-feat" | "pythae" | "quantumpeer" | "recurrentgemma" | "relik" | "refiners" | "renderformer" | "reverb" | "rkllm" | "saelens" | "sam2" | "sample-factory" | "sap-rpt-1-oss" | "sapiens" | "seedvr" | "self-forcing" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "monkeyocr" | "diffusion-single-file" | "seed-story" | "soloaudio" | "songbloom" | "stable-baselines3" | "stanza" | "swarmformer" | "f5-tts" | "genmo" | "tencent-song-generation" | "tensorflowtts" | "tensorrt" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "tirex" | "torchgeo" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "univa" | "uni-3dar" | "unity-sentis" | "sana" | "videoprism" | "vfi-mamba" | "lvface" | "voicecraft" | "voxcpm" | "vui" | "vibevoice" | "wan2.2" | "wham" | "whisperkit" | "yolov10" | "zonos" | "3dtopia-xl")[];
|
|
1350
1350
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgxCI,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,EAA+C,eAAe,EAAE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,q8EAQ1B,CAAC"}
|
|
@@ -227,13 +227,6 @@ exports.MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
227
227
|
repoUrl: "https://github.com/Unbabel/COMET/",
|
|
228
228
|
countDownloads: `path:"hparams.yaml"`,
|
|
229
229
|
},
|
|
230
|
-
contexttab: {
|
|
231
|
-
prettyLabel: "ConTextTab",
|
|
232
|
-
repoName: "ConTextTab",
|
|
233
|
-
repoUrl: "https://github.com/SAP-samples/contexttab",
|
|
234
|
-
countDownloads: `path_extension:"pt"`,
|
|
235
|
-
snippets: snippets.contexttab,
|
|
236
|
-
},
|
|
237
230
|
cosmos: {
|
|
238
231
|
prettyLabel: "Cosmos",
|
|
239
232
|
repoName: "Cosmos",
|
|
@@ -958,6 +951,13 @@ exports.MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
958
951
|
filter: true,
|
|
959
952
|
countDownloads: `path:"cfg.json"`,
|
|
960
953
|
},
|
|
954
|
+
"sap-rpt-1-oss": {
|
|
955
|
+
prettyLabel: "sap-rpt-1-oss",
|
|
956
|
+
repoName: "sap-rpt-1-oss",
|
|
957
|
+
repoUrl: "https://github.com/SAP-samples/sap-rpt-1-oss",
|
|
958
|
+
countDownloads: `path_extension:"pt"`,
|
|
959
|
+
snippets: snippets.sap_rpt_one_oss,
|
|
960
|
+
},
|
|
961
961
|
sapiens: {
|
|
962
962
|
prettyLabel: "sapiens",
|
|
963
963
|
repoName: "sapiens",
|
|
@@ -9,7 +9,7 @@ export declare const bertopic: (model: ModelData) => string[];
|
|
|
9
9
|
export declare const bm25s: (model: ModelData) => string[];
|
|
10
10
|
export declare const chatterbox: () => string[];
|
|
11
11
|
export declare const chronos_forecasting: (model: ModelData) => string[];
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const sap_rpt_one_oss: () => string[];
|
|
13
13
|
export declare const cxr_foundation: () => string[];
|
|
14
14
|
export declare const depth_anything_v2: (model: ModelData) => string[];
|
|
15
15
|
export declare const depth_pro: (model: ModelData) => string[];
|
|
@@ -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,EAsB5D,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO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AAI,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"}
|
|
@@ -131,22 +131,21 @@ pred_df = pipeline.predict_df(
|
|
|
131
131
|
)`;
|
|
132
132
|
return [installSnippet, exampleSnippet];
|
|
133
133
|
};
|
|
134
|
-
export const
|
|
135
|
-
const installSnippet = `pip install git+https://github.com/SAP-samples/
|
|
134
|
+
export const sap_rpt_one_oss = () => {
|
|
135
|
+
const installSnippet = `pip install git+https://github.com/SAP-samples/sap-rpt-1-oss`;
|
|
136
136
|
const classificationSnippet = `# Run a classification task
|
|
137
137
|
from sklearn.datasets import load_breast_cancer
|
|
138
138
|
from sklearn.metrics import accuracy_score
|
|
139
139
|
from sklearn.model_selection import train_test_split
|
|
140
140
|
|
|
141
|
-
from
|
|
141
|
+
from sap_rpt_oss import SAP_RPT_OSS_Classifier
|
|
142
142
|
|
|
143
143
|
# Load sample data
|
|
144
144
|
X, y = load_breast_cancer(return_X_y=True)
|
|
145
145
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
|
|
146
146
|
|
|
147
|
-
# Initialize a classifier
|
|
148
|
-
|
|
149
|
-
clf = ConTextTabClassifier(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
|
|
147
|
+
# Initialize a classifier, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
|
|
148
|
+
clf = SAP_RPT_OSS_Classifier(max_context_size=8192, bagging=8)
|
|
150
149
|
|
|
151
150
|
clf.fit(X_train, y_train)
|
|
152
151
|
|
|
@@ -160,8 +159,7 @@ from sklearn.datasets import fetch_openml
|
|
|
160
159
|
from sklearn.metrics import r2_score
|
|
161
160
|
from sklearn.model_selection import train_test_split
|
|
162
161
|
|
|
163
|
-
from
|
|
164
|
-
|
|
162
|
+
from sap_rpt_oss import SAP_RPT_OSS_Regressor
|
|
165
163
|
|
|
166
164
|
# Load sample data
|
|
167
165
|
df = fetch_openml(data_id=531, as_frame=True)
|
|
@@ -171,9 +169,8 @@ y = df.target.astype(float)
|
|
|
171
169
|
# Train-test split
|
|
172
170
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
|
|
173
171
|
|
|
174
|
-
# Initialize the regressor
|
|
175
|
-
|
|
176
|
-
regressor = ConTextTabRegressor(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
|
|
172
|
+
# Initialize the regressor, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
|
|
173
|
+
regressor = SAP_RPT_OSS_Regressor(max_context_size=8192, bagging=8)
|
|
177
174
|
|
|
178
175
|
regressor.fit(X_train, y_train)
|
|
179
176
|
|
|
@@ -311,23 +308,27 @@ dam = DescribeAnythingModel(
|
|
|
311
308
|
prompt_mode="focal_prompt",
|
|
312
309
|
)`,
|
|
313
310
|
];
|
|
314
|
-
const diffusers_install = "pip install -U diffusers transformers";
|
|
311
|
+
const diffusers_install = "pip install -U diffusers transformers accelerate";
|
|
315
312
|
const diffusersDefaultPrompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k";
|
|
316
313
|
const diffusersImg2ImgDefaultPrompt = "Turn this cat into a dog";
|
|
317
314
|
const diffusersVideoDefaultPrompt = "A man with short gray hair plays a red electric guitar.";
|
|
318
315
|
const diffusers_default = (model) => [
|
|
319
|
-
`
|
|
316
|
+
`import torch
|
|
317
|
+
from diffusers import DiffusionPipeline
|
|
320
318
|
|
|
321
|
-
|
|
319
|
+
# switch to "mps" for apple devices
|
|
320
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
322
321
|
|
|
323
322
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
|
|
324
323
|
image = pipe(prompt).images[0]`,
|
|
325
324
|
];
|
|
326
325
|
const diffusers_image_to_image = (model) => [
|
|
327
|
-
`
|
|
326
|
+
`import torch
|
|
327
|
+
from diffusers import DiffusionPipeline
|
|
328
328
|
from diffusers.utils import load_image
|
|
329
329
|
|
|
330
|
-
|
|
330
|
+
# switch to "mps" for apple devices
|
|
331
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
331
332
|
|
|
332
333
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
|
|
333
334
|
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
|
@@ -339,7 +340,8 @@ const diffusers_image_to_video = (model) => [
|
|
|
339
340
|
from diffusers import DiffusionPipeline
|
|
340
341
|
from diffusers.utils import load_image, export_to_video
|
|
341
342
|
|
|
342
|
-
|
|
343
|
+
# switch to "mps" for apple devices
|
|
344
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
343
345
|
pipe.to("cuda")
|
|
344
346
|
|
|
345
347
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -359,19 +361,23 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
|
359
361
|
)`,
|
|
360
362
|
];
|
|
361
363
|
const diffusers_lora = (model) => [
|
|
362
|
-
`
|
|
364
|
+
`import torch
|
|
365
|
+
from diffusers import DiffusionPipeline
|
|
363
366
|
|
|
364
|
-
|
|
367
|
+
# switch to "mps" for apple devices
|
|
368
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
365
369
|
pipe.load_lora_weights("${model.id}")
|
|
366
370
|
|
|
367
371
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
|
|
368
372
|
image = pipe(prompt).images[0]`,
|
|
369
373
|
];
|
|
370
374
|
const diffusers_lora_image_to_image = (model) => [
|
|
371
|
-
`
|
|
375
|
+
`import torch
|
|
376
|
+
from diffusers import DiffusionPipeline
|
|
372
377
|
from diffusers.utils import load_image
|
|
373
378
|
|
|
374
|
-
|
|
379
|
+
# switch to "mps" for apple devices
|
|
380
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
375
381
|
pipe.load_lora_weights("${model.id}")
|
|
376
382
|
|
|
377
383
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
|
|
@@ -380,10 +386,12 @@ input_image = load_image("https://huggingface.co/datasets/huggingface/documentat
|
|
|
380
386
|
image = pipe(image=input_image, prompt=prompt).images[0]`,
|
|
381
387
|
];
|
|
382
388
|
const diffusers_lora_text_to_video = (model) => [
|
|
383
|
-
`
|
|
389
|
+
`import torch
|
|
390
|
+
from diffusers import DiffusionPipeline
|
|
384
391
|
from diffusers.utils import export_to_video
|
|
385
392
|
|
|
386
|
-
|
|
393
|
+
# switch to "mps" for apple devices
|
|
394
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
387
395
|
pipe.load_lora_weights("${model.id}")
|
|
388
396
|
|
|
389
397
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -392,10 +400,12 @@ output = pipe(prompt=prompt).frames[0]
|
|
|
392
400
|
export_to_video(output, "output.mp4")`,
|
|
393
401
|
];
|
|
394
402
|
const diffusers_lora_image_to_video = (model) => [
|
|
395
|
-
`
|
|
403
|
+
`import torch
|
|
404
|
+
from diffusers import DiffusionPipeline
|
|
396
405
|
from diffusers.utils import load_image, export_to_video
|
|
397
406
|
|
|
398
|
-
|
|
407
|
+
# switch to "mps" for apple devices
|
|
408
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
399
409
|
pipe.load_lora_weights("${model.id}")
|
|
400
410
|
|
|
401
411
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -405,9 +415,11 @@ image = pipe(image=input_image, prompt=prompt).frames[0]
|
|
|
405
415
|
export_to_video(output, "output.mp4")`,
|
|
406
416
|
];
|
|
407
417
|
const diffusers_textual_inversion = (model) => [
|
|
408
|
-
`
|
|
418
|
+
`import torch
|
|
419
|
+
from diffusers import DiffusionPipeline
|
|
409
420
|
|
|
410
|
-
|
|
421
|
+
# switch to "mps" for apple devices
|
|
422
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
411
423
|
pipe.load_textual_inversion("${model.id}")`,
|
|
412
424
|
];
|
|
413
425
|
const diffusers_flux_fill = (model) => [
|
|
@@ -418,7 +430,8 @@ from diffusers.utils import load_image
|
|
|
418
430
|
image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
|
|
419
431
|
mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
|
|
420
432
|
|
|
421
|
-
|
|
433
|
+
# switch to "mps" for apple devices
|
|
434
|
+
pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
422
435
|
image = pipe(
|
|
423
436
|
prompt="a white paper cup",
|
|
424
437
|
image=image,
|
|
@@ -437,7 +450,8 @@ const diffusers_inpainting = (model) => [
|
|
|
437
450
|
from diffusers import AutoPipelineForInpainting
|
|
438
451
|
from diffusers.utils import load_image
|
|
439
452
|
|
|
440
|
-
|
|
453
|
+
# switch to "mps" for apple devices
|
|
454
|
+
pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda")
|
|
441
455
|
|
|
442
456
|
img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
|
|
443
457
|
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
|
|
@@ -1461,7 +1475,7 @@ export const transformers = (model) => {
|
|
|
1461
1475
|
}
|
|
1462
1476
|
}
|
|
1463
1477
|
else {
|
|
1464
|
-
autoSnippet.push("# Load model directly", `from transformers import ${info.auto_model}`, `model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ',
|
|
1478
|
+
autoSnippet.push("# Load model directly", `from transformers import ${info.auto_model}`, `model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ', dtype="auto")');
|
|
1465
1479
|
}
|
|
1466
1480
|
if (model.pipeline_tag && LIBRARY_TASK_MAPPING.transformers?.includes(model.pipeline_tag)) {
|
|
1467
1481
|
const pipelineSnippet = [
|
|
@@ -231,13 +231,6 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
231
231
|
repoUrl: string;
|
|
232
232
|
countDownloads: string;
|
|
233
233
|
};
|
|
234
|
-
contexttab: {
|
|
235
|
-
prettyLabel: string;
|
|
236
|
-
repoName: string;
|
|
237
|
-
repoUrl: string;
|
|
238
|
-
countDownloads: string;
|
|
239
|
-
snippets: () => string[];
|
|
240
|
-
};
|
|
241
234
|
cosmos: {
|
|
242
235
|
prettyLabel: string;
|
|
243
236
|
repoName: string;
|
|
@@ -957,6 +950,13 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
957
950
|
filter: true;
|
|
958
951
|
countDownloads: string;
|
|
959
952
|
};
|
|
953
|
+
"sap-rpt-1-oss": {
|
|
954
|
+
prettyLabel: string;
|
|
955
|
+
repoName: string;
|
|
956
|
+
repoUrl: string;
|
|
957
|
+
countDownloads: string;
|
|
958
|
+
snippets: () => string[];
|
|
959
|
+
};
|
|
960
960
|
sapiens: {
|
|
961
961
|
prettyLabel: string;
|
|
962
962
|
repoName: string;
|
|
@@ -1346,5 +1346,5 @@ export declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
|
1346
1346
|
};
|
|
1347
1347
|
export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
1348
1348
|
export declare const ALL_MODEL_LIBRARY_KEYS: ModelLibraryKey[];
|
|
1349
|
-
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("acestep" | "adapter-transformers" | "allennlp" | "anemoi" | "araclip" | "asteroid" | "audiocraft" | "audioseal" | "bagel-mot" | "bboxmaskpose" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "boltzgen" | "champ" | "chatterbox" | "chat_tts" | "chronos-forecasting" | "cloud-agents" | "colpali" | "comet" | "
|
|
1349
|
+
export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("acestep" | "adapter-transformers" | "allennlp" | "anemoi" | "araclip" | "asteroid" | "audiocraft" | "audioseal" | "bagel-mot" | "bboxmaskpose" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "boltzgen" | "champ" | "chatterbox" | "chat_tts" | "chronos-forecasting" | "cloud-agents" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "describe-anything" | "dia-tts" | "diff-interpretation-tuning" | "diffree" | "diffusers" | "diffusionkit" | "doctr" | "cartesia_pytorch" | "cartesia_mlx" | "clipscope" | "cosyvoice" | "cotracker" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fastprint" | "fasttext" | "flair" | "fme" | "gemma.cpp" | "geometry-crafter" | "gliner" | "glyph-byt5" | "grok" | "hallo" | "hermes" | "hezar" | "htrflow" | "hunyuan-dit" | "hunyuan3d-2" | "hunyuanworld-voyager" | "imstoucan" | "index-tts" | "infinitetalk" | "infinite-you" | "keras" | "tf-keras" | "keras-hub" | "kernels" | "kimi-audio" | "kittentts" | "kronos" | "k2" | "lightning-ir" | "litert" | "litert-lm" | "lerobot" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "magi-1" | "magenta-realtime" | "mamba-ssm" | "mars5-tts" | "matanyone" | "mesh-anything" | "merlin" | "medvae" | "mitie" | "ml-agents" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "mtvcraft" | "nemo" | "open-oasis" | "open_clip" | "openpeerllm" | "open-sora" | "outetts" | "paddlenlp" | "PaddleOCR" | "peft" | "perception-encoder" | "phantom-wan" | "pruna-ai" | "pxia" | "pyannote-audio" | "py-feat" | "pythae" | "quantumpeer" | "recurrentgemma" | "relik" | "refiners" | "renderformer" | "reverb" | "rkllm" | "saelens" | "sam2" | "sample-factory" | "sap-rpt-1-oss" | "sapiens" | "seedvr" | "self-forcing" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "monkeyocr" | "diffusion-single-file" | "seed-story" | "soloaudio" | "songbloom" | "stable-baselines3" | "stanza" | "swarmformer" | "f5-tts" | "genmo" | "tencent-song-generation" | "tensorflowtts" | "tensorrt" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "tirex" | "torchgeo" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "univa" | "uni-3dar" | "unity-sentis" | "sana" | "videoprism" | "vfi-mamba" | "lvface" | "voicecraft" | "voxcpm" | "vui" | "vibevoice" | "wan2.2" | "wham" | "whisperkit" | "yolov10" | "zonos" | "3dtopia-xl")[];
|
|
1350
1350
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAsB,EAA+C,eAAe,EAAE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,q8EAQ1B,CAAC"}
|
|
@@ -191,13 +191,6 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
191
191
|
repoUrl: "https://github.com/Unbabel/COMET/",
|
|
192
192
|
countDownloads: `path:"hparams.yaml"`,
|
|
193
193
|
},
|
|
194
|
-
contexttab: {
|
|
195
|
-
prettyLabel: "ConTextTab",
|
|
196
|
-
repoName: "ConTextTab",
|
|
197
|
-
repoUrl: "https://github.com/SAP-samples/contexttab",
|
|
198
|
-
countDownloads: `path_extension:"pt"`,
|
|
199
|
-
snippets: snippets.contexttab,
|
|
200
|
-
},
|
|
201
194
|
cosmos: {
|
|
202
195
|
prettyLabel: "Cosmos",
|
|
203
196
|
repoName: "Cosmos",
|
|
@@ -922,6 +915,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
922
915
|
filter: true,
|
|
923
916
|
countDownloads: `path:"cfg.json"`,
|
|
924
917
|
},
|
|
918
|
+
"sap-rpt-1-oss": {
|
|
919
|
+
prettyLabel: "sap-rpt-1-oss",
|
|
920
|
+
repoName: "sap-rpt-1-oss",
|
|
921
|
+
repoUrl: "https://github.com/SAP-samples/sap-rpt-1-oss",
|
|
922
|
+
countDownloads: `path_extension:"pt"`,
|
|
923
|
+
snippets: snippets.sap_rpt_one_oss,
|
|
924
|
+
},
|
|
925
925
|
sapiens: {
|
|
926
926
|
prettyLabel: "sapiens",
|
|
927
927
|
repoName: "sapiens",
|
package/package.json
CHANGED
|
@@ -156,23 +156,22 @@ pred_df = pipeline.predict_df(
|
|
|
156
156
|
return [installSnippet, exampleSnippet];
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
export const
|
|
160
|
-
const installSnippet = `pip install git+https://github.com/SAP-samples/
|
|
159
|
+
export const sap_rpt_one_oss = (): string[] => {
|
|
160
|
+
const installSnippet = `pip install git+https://github.com/SAP-samples/sap-rpt-1-oss`;
|
|
161
161
|
|
|
162
162
|
const classificationSnippet = `# Run a classification task
|
|
163
163
|
from sklearn.datasets import load_breast_cancer
|
|
164
164
|
from sklearn.metrics import accuracy_score
|
|
165
165
|
from sklearn.model_selection import train_test_split
|
|
166
166
|
|
|
167
|
-
from
|
|
167
|
+
from sap_rpt_oss import SAP_RPT_OSS_Classifier
|
|
168
168
|
|
|
169
169
|
# Load sample data
|
|
170
170
|
X, y = load_breast_cancer(return_X_y=True)
|
|
171
171
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
|
|
172
172
|
|
|
173
|
-
# Initialize a classifier
|
|
174
|
-
|
|
175
|
-
clf = ConTextTabClassifier(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
|
|
173
|
+
# Initialize a classifier, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
|
|
174
|
+
clf = SAP_RPT_OSS_Classifier(max_context_size=8192, bagging=8)
|
|
176
175
|
|
|
177
176
|
clf.fit(X_train, y_train)
|
|
178
177
|
|
|
@@ -187,8 +186,7 @@ from sklearn.datasets import fetch_openml
|
|
|
187
186
|
from sklearn.metrics import r2_score
|
|
188
187
|
from sklearn.model_selection import train_test_split
|
|
189
188
|
|
|
190
|
-
from
|
|
191
|
-
|
|
189
|
+
from sap_rpt_oss import SAP_RPT_OSS_Regressor
|
|
192
190
|
|
|
193
191
|
# Load sample data
|
|
194
192
|
df = fetch_openml(data_id=531, as_frame=True)
|
|
@@ -198,9 +196,8 @@ y = df.target.astype(float)
|
|
|
198
196
|
# Train-test split
|
|
199
197
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
|
|
200
198
|
|
|
201
|
-
# Initialize the regressor
|
|
202
|
-
|
|
203
|
-
regressor = ConTextTabRegressor(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
|
|
199
|
+
# Initialize the regressor, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
|
|
200
|
+
regressor = SAP_RPT_OSS_Regressor(max_context_size=8192, bagging=8)
|
|
204
201
|
|
|
205
202
|
regressor.fit(X_train, y_train)
|
|
206
203
|
|
|
@@ -348,7 +345,7 @@ dam = DescribeAnythingModel(
|
|
|
348
345
|
)`,
|
|
349
346
|
];
|
|
350
347
|
|
|
351
|
-
const diffusers_install = "pip install -U diffusers transformers";
|
|
348
|
+
const diffusers_install = "pip install -U diffusers transformers accelerate";
|
|
352
349
|
|
|
353
350
|
const diffusersDefaultPrompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k";
|
|
354
351
|
|
|
@@ -357,19 +354,23 @@ const diffusersImg2ImgDefaultPrompt = "Turn this cat into a dog";
|
|
|
357
354
|
const diffusersVideoDefaultPrompt = "A man with short gray hair plays a red electric guitar.";
|
|
358
355
|
|
|
359
356
|
const diffusers_default = (model: ModelData) => [
|
|
360
|
-
`
|
|
357
|
+
`import torch
|
|
358
|
+
from diffusers import DiffusionPipeline
|
|
361
359
|
|
|
362
|
-
|
|
360
|
+
# switch to "mps" for apple devices
|
|
361
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
363
362
|
|
|
364
363
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
|
|
365
364
|
image = pipe(prompt).images[0]`,
|
|
366
365
|
];
|
|
367
366
|
|
|
368
367
|
const diffusers_image_to_image = (model: ModelData) => [
|
|
369
|
-
`
|
|
368
|
+
`import torch
|
|
369
|
+
from diffusers import DiffusionPipeline
|
|
370
370
|
from diffusers.utils import load_image
|
|
371
371
|
|
|
372
|
-
|
|
372
|
+
# switch to "mps" for apple devices
|
|
373
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
373
374
|
|
|
374
375
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
|
|
375
376
|
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
|
@@ -382,7 +383,8 @@ const diffusers_image_to_video = (model: ModelData) => [
|
|
|
382
383
|
from diffusers import DiffusionPipeline
|
|
383
384
|
from diffusers.utils import load_image, export_to_video
|
|
384
385
|
|
|
385
|
-
|
|
386
|
+
# switch to "mps" for apple devices
|
|
387
|
+
pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
386
388
|
pipe.to("cuda")
|
|
387
389
|
|
|
388
390
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -404,9 +406,11 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
|
404
406
|
];
|
|
405
407
|
|
|
406
408
|
const diffusers_lora = (model: ModelData) => [
|
|
407
|
-
`
|
|
409
|
+
`import torch
|
|
410
|
+
from diffusers import DiffusionPipeline
|
|
408
411
|
|
|
409
|
-
|
|
412
|
+
# switch to "mps" for apple devices
|
|
413
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
410
414
|
pipe.load_lora_weights("${model.id}")
|
|
411
415
|
|
|
412
416
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
|
|
@@ -414,10 +418,12 @@ image = pipe(prompt).images[0]`,
|
|
|
414
418
|
];
|
|
415
419
|
|
|
416
420
|
const diffusers_lora_image_to_image = (model: ModelData) => [
|
|
417
|
-
`
|
|
421
|
+
`import torch
|
|
422
|
+
from diffusers import DiffusionPipeline
|
|
418
423
|
from diffusers.utils import load_image
|
|
419
424
|
|
|
420
|
-
|
|
425
|
+
# switch to "mps" for apple devices
|
|
426
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
421
427
|
pipe.load_lora_weights("${model.id}")
|
|
422
428
|
|
|
423
429
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
|
|
@@ -427,10 +433,12 @@ image = pipe(image=input_image, prompt=prompt).images[0]`,
|
|
|
427
433
|
];
|
|
428
434
|
|
|
429
435
|
const diffusers_lora_text_to_video = (model: ModelData) => [
|
|
430
|
-
`
|
|
436
|
+
`import torch
|
|
437
|
+
from diffusers import DiffusionPipeline
|
|
431
438
|
from diffusers.utils import export_to_video
|
|
432
439
|
|
|
433
|
-
|
|
440
|
+
# switch to "mps" for apple devices
|
|
441
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
434
442
|
pipe.load_lora_weights("${model.id}")
|
|
435
443
|
|
|
436
444
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -440,10 +448,12 @@ export_to_video(output, "output.mp4")`,
|
|
|
440
448
|
];
|
|
441
449
|
|
|
442
450
|
const diffusers_lora_image_to_video = (model: ModelData) => [
|
|
443
|
-
`
|
|
451
|
+
`import torch
|
|
452
|
+
from diffusers import DiffusionPipeline
|
|
444
453
|
from diffusers.utils import load_image, export_to_video
|
|
445
454
|
|
|
446
|
-
|
|
455
|
+
# switch to "mps" for apple devices
|
|
456
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
447
457
|
pipe.load_lora_weights("${model.id}")
|
|
448
458
|
|
|
449
459
|
prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
|
|
@@ -454,9 +464,11 @@ export_to_video(output, "output.mp4")`,
|
|
|
454
464
|
];
|
|
455
465
|
|
|
456
466
|
const diffusers_textual_inversion = (model: ModelData) => [
|
|
457
|
-
`
|
|
467
|
+
`import torch
|
|
468
|
+
from diffusers import DiffusionPipeline
|
|
458
469
|
|
|
459
|
-
|
|
470
|
+
# switch to "mps" for apple devices
|
|
471
|
+
pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
|
|
460
472
|
pipe.load_textual_inversion("${model.id}")`,
|
|
461
473
|
];
|
|
462
474
|
|
|
@@ -468,7 +480,8 @@ from diffusers.utils import load_image
|
|
|
468
480
|
image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
|
|
469
481
|
mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
|
|
470
482
|
|
|
471
|
-
|
|
483
|
+
# switch to "mps" for apple devices
|
|
484
|
+
pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
|
|
472
485
|
image = pipe(
|
|
473
486
|
prompt="a white paper cup",
|
|
474
487
|
image=image,
|
|
@@ -488,7 +501,8 @@ const diffusers_inpainting = (model: ModelData) => [
|
|
|
488
501
|
from diffusers import AutoPipelineForInpainting
|
|
489
502
|
from diffusers.utils import load_image
|
|
490
503
|
|
|
491
|
-
|
|
504
|
+
# switch to "mps" for apple devices
|
|
505
|
+
pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda")
|
|
492
506
|
|
|
493
507
|
img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
|
|
494
508
|
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
|
|
@@ -1615,7 +1629,7 @@ export const transformers = (model: ModelData): string[] => {
|
|
|
1615
1629
|
autoSnippet.push(
|
|
1616
1630
|
"# Load model directly",
|
|
1617
1631
|
`from transformers import ${info.auto_model}`,
|
|
1618
|
-
`model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ',
|
|
1632
|
+
`model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ', dtype="auto")'
|
|
1619
1633
|
);
|
|
1620
1634
|
}
|
|
1621
1635
|
|
package/src/model-libraries.ts
CHANGED
|
@@ -235,13 +235,6 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
235
235
|
repoUrl: "https://github.com/Unbabel/COMET/",
|
|
236
236
|
countDownloads: `path:"hparams.yaml"`,
|
|
237
237
|
},
|
|
238
|
-
contexttab: {
|
|
239
|
-
prettyLabel: "ConTextTab",
|
|
240
|
-
repoName: "ConTextTab",
|
|
241
|
-
repoUrl: "https://github.com/SAP-samples/contexttab",
|
|
242
|
-
countDownloads: `path_extension:"pt"`,
|
|
243
|
-
snippets: snippets.contexttab,
|
|
244
|
-
},
|
|
245
238
|
cosmos: {
|
|
246
239
|
prettyLabel: "Cosmos",
|
|
247
240
|
repoName: "Cosmos",
|
|
@@ -966,6 +959,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
966
959
|
filter: true,
|
|
967
960
|
countDownloads: `path:"cfg.json"`,
|
|
968
961
|
},
|
|
962
|
+
"sap-rpt-1-oss": {
|
|
963
|
+
prettyLabel: "sap-rpt-1-oss",
|
|
964
|
+
repoName: "sap-rpt-1-oss",
|
|
965
|
+
repoUrl: "https://github.com/SAP-samples/sap-rpt-1-oss",
|
|
966
|
+
countDownloads: `path_extension:"pt"`,
|
|
967
|
+
snippets: snippets.sap_rpt_one_oss,
|
|
968
|
+
},
|
|
969
969
|
sapiens: {
|
|
970
970
|
prettyLabel: "sapiens",
|
|
971
971
|
repoName: "sapiens",
|