@huggingface/tasks 0.11.6 → 0.11.8

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.
Files changed (35) hide show
  1. package/dist/index.cjs +151 -51
  2. package/dist/index.js +151 -51
  3. package/dist/src/hardware.d.ts +4 -0
  4. package/dist/src/hardware.d.ts.map +1 -1
  5. package/dist/src/index.d.ts +1 -1
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/local-apps.d.ts +16 -3
  8. package/dist/src/local-apps.d.ts.map +1 -1
  9. package/dist/src/model-libraries-snippets.d.ts +3 -0
  10. package/dist/src/model-libraries-snippets.d.ts.map +1 -1
  11. package/dist/src/model-libraries.d.ts +29 -2
  12. package/dist/src/model-libraries.d.ts.map +1 -1
  13. package/dist/src/pipelines.d.ts +8 -2
  14. package/dist/src/pipelines.d.ts.map +1 -1
  15. package/dist/src/tasks/feature-extraction/data.d.ts.map +1 -1
  16. package/dist/src/tasks/image-feature-extraction/data.d.ts.map +1 -1
  17. package/dist/src/tasks/index.d.ts.map +1 -1
  18. package/dist/src/tasks/text-generation/data.d.ts.map +1 -1
  19. package/package.json +4 -1
  20. package/src/hardware.ts +4 -0
  21. package/src/index.ts +1 -1
  22. package/src/local-apps.ts +49 -23
  23. package/src/model-libraries-snippets.ts +42 -0
  24. package/src/model-libraries.ts +27 -0
  25. package/src/pipelines.ts +6 -0
  26. package/src/tasks/feature-extraction/data.ts +5 -1
  27. package/src/tasks/image-feature-extraction/data.ts +7 -3
  28. package/src/tasks/image-segmentation/data.ts +4 -4
  29. package/src/tasks/image-text-to-text/about.md +2 -0
  30. package/src/tasks/image-text-to-text/data.ts +1 -1
  31. package/src/tasks/image-to-image/data.ts +2 -2
  32. package/src/tasks/index.ts +2 -0
  33. package/src/tasks/mask-generation/data.ts +4 -4
  34. package/src/tasks/text-generation/data.ts +16 -12
  35. package/src/tasks/text-to-image/data.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAgDf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAoDf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAkDf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAsDf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA0CjD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,0CAA0C,CAAC;AAC9D,YAAY,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,+BAA+B,GAC/B,MAAM,6BAA6B,CAAC;AACrC,mBAAmB,yCAAyC,CAAC;AAC7D,m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OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAyGf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA6Gf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@huggingface/tasks",
3
3
  "packageManager": "pnpm@8.10.5",
4
- "version": "0.11.6",
4
+ "version": "0.11.8",
5
5
  "description": "List of ML tasks for huggingface.co/tasks",
6
6
  "repository": "https://github.com/huggingface/huggingface.js.git",
7
7
  "publishConfig": {
@@ -42,6 +42,9 @@
42
42
  "format": "prettier --write .",
43
43
  "format:check": "prettier --check .",
44
44
  "build": "tsup src/index.ts --format cjs,esm --clean && tsc --emitDeclarationOnly --declaration",
45
+ "watch:export": "tsup src/index.ts --format cjs,esm --watch",
46
+ "watch:types": "tsc --emitDeclarationOnly --declaration --watch",
47
+ "watch": "npm-run-all --parallel watch:export watch:types",
45
48
  "check": "tsc",
46
49
  "inference-codegen": "tsx scripts/inference-codegen.ts && prettier --write src/tasks/*/inference.ts",
47
50
  "inference-tgi-import": "tsx scripts/inference-tgi-import.ts && prettier --write src/tasks/text-generation/spec/*.json && prettier --write src/tasks/chat-completion/spec/*.json",
package/src/hardware.ts CHANGED
@@ -72,6 +72,10 @@ export const SKUS = {
72
72
  tflops: 12.0,
73
73
  memory: [16],
74
74
  },
75
+ "RTX A4000": {
76
+ tflops: 19.2,
77
+ memory: [16],
78
+ },
75
79
  A100: {
76
80
  tflops: 77.97,
77
81
  memory: [80, 40],
package/src/index.ts CHANGED
@@ -47,7 +47,7 @@ export { snippets };
47
47
  export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware";
48
48
  export type { HardwareSpec, SkuType } from "./hardware";
49
49
  export { LOCAL_APPS } from "./local-apps";
50
- export type { LocalApp, LocalAppKey } from "./local-apps";
50
+ export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps";
51
51
 
52
52
  export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries";
53
53
  export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries";
package/src/local-apps.ts CHANGED
@@ -1,6 +1,21 @@
1
1
  import type { ModelData } from "./model-data";
2
2
  import type { PipelineType } from "./pipelines";
3
3
 
4
+ export interface LocalAppSnippet {
5
+ /**
6
+ * Title of the snippet
7
+ */
8
+ title: string;
9
+ /**
10
+ * Optional setup guide
11
+ */
12
+ setup?: string;
13
+ /**
14
+ * Content (or command) to be run
15
+ */
16
+ content: string;
17
+ }
18
+
4
19
  /**
5
20
  * Elements configurable by a local app.
6
21
  */
@@ -39,7 +54,7 @@ export type LocalApp = {
39
54
  * And if not (mostly llama.cpp), snippet to copy/paste in your terminal
40
55
  * Support the placeholder {{GGUF_FILE}} that will be replaced by the gguf file path or the list of available files.
41
56
  */
42
- snippet: (model: ModelData, filepath?: string) => string | string[];
57
+ snippet: (model: ModelData, filepath?: string) => string | string[] | LocalAppSnippet | LocalAppSnippet[];
43
58
  }
44
59
  );
45
60
 
@@ -47,28 +62,40 @@ function isGgufModel(model: ModelData) {
47
62
  return model.tags.includes("gguf");
48
63
  }
49
64
 
50
- const snippetLlamacpp = (model: ModelData, filepath?: string): string[] => {
65
+ const snippetLlamacpp = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
66
+ const command = (binary: string) =>
67
+ [
68
+ "# Load and run the model:",
69
+ `${binary} \\`,
70
+ ` --hf-repo "${model.id}" \\`,
71
+ ` --hf-file ${filepath ?? "{{GGUF_FILE}}"} \\`,
72
+ ' -p "You are a helpful assistant" \\',
73
+ " --conversation",
74
+ ].join("\n");
51
75
  return [
52
- `# Option 1: use llama.cpp with brew
53
- brew install llama.cpp
54
-
55
- # Load and run the model
56
- llama \\
57
- --hf-repo "${model.id}" \\
58
- --hf-file ${filepath ?? "{{GGUF_FILE}}"} \\
59
- -p "I believe the meaning of life is" \\
60
- -n 128`,
61
- `# Option 2: build llama.cpp from source with curl support
62
- git clone https://github.com/ggerganov/llama.cpp.git
63
- cd llama.cpp
64
- LLAMA_CURL=1 make
65
-
66
- # Load and run the model
67
- ./main \\
68
- --hf-repo "${model.id}" \\
69
- -m ${filepath ?? "{{GGUF_FILE}}"} \\
70
- -p "I believe the meaning of life is" \\
71
- -n 128`,
76
+ {
77
+ title: "Install from brew",
78
+ setup: "brew install llama.cpp",
79
+ content: command("llama-cli"),
80
+ },
81
+ {
82
+ title: "Use pre-built binary",
83
+ setup: [
84
+ // prettier-ignore
85
+ "# Download pre-built binary from:",
86
+ "# https://github.com/ggerganov/llama.cpp/releases",
87
+ ].join("\n"),
88
+ content: command("./llama-cli"),
89
+ },
90
+ {
91
+ title: "Build from source code",
92
+ setup: [
93
+ "git clone https://github.com/ggerganov/llama.cpp.git",
94
+ "cd llama.cpp",
95
+ "LLAMA_CURL=1 make llama-cli",
96
+ ].join("\n"),
97
+ content: command("./llama-cli"),
98
+ },
72
99
  ];
73
100
  };
74
101
 
@@ -174,7 +201,6 @@ export const LOCAL_APPS = {
174
201
  docsUrl: "https://diffusionbee.com",
175
202
  mainTask: "text-to-image",
176
203
  macOSOnly: true,
177
- comingSoon: true,
178
204
  displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
179
205
  deeplink: (model) => new URL(`diffusionbee://open_from_hf?model=${model.id}`),
180
206
  },
@@ -261,6 +261,24 @@ backbone = keras_nlp.models.Backbone.from_preset("hf://${model.id}")
261
261
  `,
262
262
  ];
263
263
 
264
+ export const llama_cpp_python = (model: ModelData): string[] => [
265
+ `from llama_cpp import Llama
266
+
267
+ llm = Llama.from_pretrained(
268
+ repo_id="${model.id}",
269
+ filename="{{GGUF_FILE}}",
270
+ )
271
+
272
+ llm.create_chat_completion(
273
+ messages = [
274
+ {
275
+ "role": "user",
276
+ "content": "What is the capital of France?"
277
+ }
278
+ ]
279
+ )`,
280
+ ];
281
+
264
282
  export const tf_keras = (model: ModelData): string[] => [
265
283
  `# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy)
266
284
  # See https://github.com/keras-team/tf-keras for more details.
@@ -401,6 +419,16 @@ export const timm = (model: ModelData): string[] => [
401
419
  model = timm.create_model("hf_hub:${model.id}", pretrained=True)`,
402
420
  ];
403
421
 
422
+ export const saelens = (/* model: ModelData */): string[] => [
423
+ `# pip install sae-lens
424
+ from sae_lens import SAE
425
+
426
+ sae, cfg_dict, sparsity = SAE.from_pretrained(
427
+ release = "RELEASE_ID", # e.g., "gpt2-small-res-jb". See other options in https://github.com/jbloomAus/SAELens/blob/main/sae_lens/pretrained_saes.yaml
428
+ sae_id = "SAE_ID", # e.g., "blocks.8.hook_resid_pre". Won't always be a hook point
429
+ )`,
430
+ ];
431
+
404
432
  const skopsPickle = (model: ModelData, modelFile: string) => {
405
433
  return [
406
434
  `import joblib
@@ -732,6 +760,20 @@ wavs = chat.infer(texts, )
732
760
  torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)`,
733
761
  ];
734
762
 
763
+ export const birefnet = (model: ModelData): string[] => [
764
+ `# Option 1: use with transformers
765
+
766
+ from transformers import AutoModelForImageSegmentation
767
+ birefnet = AutoModelForImageSegmentation.from_pretrained("${model.id}", trust_remote_code=True)
768
+ `,
769
+ `# Option 2: use with BiRefNet
770
+
771
+ # Install from https://github.com/ZhengPeng7/BiRefNet
772
+
773
+ from models.birefnet import BiRefNet
774
+ model = BiRefNet.from_pretrained("${model.id}")`,
775
+ ];
776
+
735
777
  export const mlx = (model: ModelData): string[] => [
736
778
  `pip install huggingface_hub hf_transfer
737
779
 
@@ -114,6 +114,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
114
114
  filter: false,
115
115
  countDownloads: `path_extension:"npz"`,
116
116
  },
117
+ birefnet: {
118
+ prettyLabel: "BiRefNet",
119
+ repoName: "BiRefNet",
120
+ repoUrl: "https://github.com/ZhengPeng7/BiRefNet",
121
+ snippets: snippets.birefnet,
122
+ filter: false,
123
+ },
117
124
  bm25s: {
118
125
  prettyLabel: "BM25S",
119
126
  repoName: "bm25s",
@@ -307,6 +314,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
307
314
  filter: false,
308
315
  countDownloads: `path:"liveportrait/landmark.onnx"`,
309
316
  },
317
+ "llama-cpp-python": {
318
+ prettyLabel: "llama-cpp-python",
319
+ repoName: "llama-cpp-python",
320
+ repoUrl: "https://github.com/abetlen/llama-cpp-python",
321
+ snippets: snippets.llama_cpp_python,
322
+ },
310
323
  mindspore: {
311
324
  prettyLabel: "MindSpore",
312
325
  repoName: "mindspore",
@@ -422,6 +435,20 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
422
435
  filter: false,
423
436
  countDownloads: `path:"tokenizer.model"`,
424
437
  },
438
+ saelens: {
439
+ prettyLabel: "SAELens",
440
+ repoName: "SAELens",
441
+ repoUrl: "https://github.com/jbloomAus/SAELens",
442
+ snippets: snippets.saelens,
443
+ filter: false,
444
+ },
445
+ sam2: {
446
+ prettyLabel: "sam2",
447
+ repoName: "sam2",
448
+ repoUrl: "https://github.com/facebookresearch/segment-anything-2",
449
+ filter: false,
450
+ countDownloads: `path_extension:"pt"`,
451
+ },
425
452
  "sample-factory": {
426
453
  prettyLabel: "sample-factory",
427
454
  repoName: "sample-factory",
package/src/pipelines.ts CHANGED
@@ -652,6 +652,12 @@ export const PIPELINE_DATA = {
652
652
  modality: "cv",
653
653
  color: "indigo",
654
654
  },
655
+ "video-text-to-text": {
656
+ name: "Video-Text-to-Text",
657
+ modality: "multimodal",
658
+ color: "blue",
659
+ hideInDatasets: true,
660
+ },
655
661
  other: {
656
662
  name: "Other",
657
663
  modality: "other",
@@ -42,9 +42,13 @@ const taskData: TaskDataCustom = {
42
42
  ],
43
43
  spaces: [
44
44
  {
45
- description: "A leaderboard to rank best feature extraction models..",
45
+ description: "A leaderboard to rank text feature extraction models based on a benchmark.",
46
46
  id: "mteb/leaderboard",
47
47
  },
48
+ {
49
+ description: "A leaderboard to rank best feature extraction models based on human feedback.",
50
+ id: "mteb/arena",
51
+ },
48
52
  ],
49
53
  summary: "Feature extraction is the task of extracting features learnt in a model.",
50
54
  widgetModels: ["facebook/bart-base"],
@@ -36,16 +36,20 @@ const taskData: TaskDataCustom = {
36
36
  },
37
37
  {
38
38
  description: "A strong image feature extraction model.",
39
- id: "google/vit-base-patch16-224-in21k",
39
+ id: "nvidia/MambaVision-T-1K",
40
40
  },
41
41
  {
42
- description: "A robust image feature extraction models.",
42
+ description: "A robust image feature extraction model.",
43
43
  id: "facebook/dino-vitb16",
44
44
  },
45
45
  {
46
- description: "Strong image-text-to-text model made for information retrieval from documents.",
46
+ description: "Strong image feature extraction model made for information retrieval from documents.",
47
47
  id: "vidore/colpali",
48
48
  },
49
+ {
50
+ description: "Strong image feature extraction model that can be used on images and documents.",
51
+ id: "OpenGVLab/InternViT-6B-448px-V1-2",
52
+ },
49
53
  ],
50
54
  spaces: [],
51
55
  summary: "Image feature extraction is the task of extracting features learnt in a computer vision model.",
@@ -48,16 +48,16 @@ const taskData: TaskDataCustom = {
48
48
  id: "facebook/detr-resnet-50-panoptic",
49
49
  },
50
50
  {
51
- description: "Semantic segmentation model trained on ADE20k benchmark dataset.",
52
- id: "microsoft/beit-large-finetuned-ade-640-640",
51
+ description: "Background removal model.",
52
+ id: "briaai/RMBG-1.4",
53
53
  },
54
54
  {
55
55
  description: "Semantic segmentation model trained on ADE20k benchmark dataset with 512x512 resolution.",
56
56
  id: "nvidia/segformer-b0-finetuned-ade-512-512",
57
57
  },
58
58
  {
59
- description: "Semantic segmentation model trained Cityscapes dataset.",
60
- id: "facebook/mask2former-swin-large-cityscapes-semantic",
59
+ description: "A multipurpose image segmentation model for high resolution images.",
60
+ id: "ZhengPeng7/BiRefNet",
61
61
  },
62
62
  {
63
63
  description: "Panoptic segmentation model trained COCO (common objects) dataset.",
@@ -72,3 +72,5 @@ print(processor.decode(output[0], skip_special_tokens=True))
72
72
  - [Vision Language Models Explained](https://huggingface.co/blog/vlms)
73
73
  - [Open-source Multimodality and How to Achieve it using Hugging Face](https://www.youtube.com/watch?v=IoGaGfU1CIg&t=601s)
74
74
  - [Introducing Idefics2: A Powerful 8B Vision-Language Model for the community](https://huggingface.co/blog/idefics2)
75
+ - [Image-text-to-text task guide](https://huggingface.co/tasks/image-text-to-text)
76
+ - [Preference Optimization for Vision Language Models with TRL](https://huggingface.co/blog/dpo_vlm)
@@ -88,7 +88,7 @@ const taskData: TaskDataCustom = {
88
88
  summary:
89
89
  "Image-text-to-text models take in an image and text prompt and output text. These models are also called vision-language models, or VLMs. The difference from image-to-text models is that these models take an additional text input, not restricting the model to certain use cases like image captioning, and may also be trained to accept a conversation as input.",
90
90
  widgetModels: ["microsoft/kosmos-2-patch14-224"],
91
- youtubeId: "",
91
+ youtubeId: "IoGaGfU1CIg",
92
92
  };
93
93
 
94
94
  export default taskData;
@@ -45,8 +45,8 @@ const taskData: TaskDataCustom = {
45
45
  ],
46
46
  models: [
47
47
  {
48
- description: "A model that enhances images captured in low light conditions.",
49
- id: "keras-io/low-light-image-enhancement",
48
+ description: "An image-to-image model to improve image resolution.",
49
+ id: "fal/AuraSR-v2",
50
50
  },
51
51
  {
52
52
  description: "A model that increases the resolution of an image.",
@@ -166,6 +166,7 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]> = {
166
166
  ],
167
167
  translation: ["transformers", "transformers.js"],
168
168
  "unconditional-image-generation": ["diffusers"],
169
+ "video-text-to-text": ["transformers"],
169
170
  "visual-question-answering": ["transformers", "transformers.js"],
170
171
  "voice-activity-detection": [],
171
172
  "zero-shot-classification": ["transformers", "transformers.js"],
@@ -236,6 +237,7 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
236
237
  "token-classification": getData("token-classification", tokenClassification),
237
238
  translation: getData("translation", translation),
238
239
  "unconditional-image-generation": getData("unconditional-image-generation", unconditionalImageGeneration),
240
+ "video-text-to-text": getData("video-text-to-text", placeholder),
239
241
  "visual-question-answering": getData("visual-question-answering", visualQuestionAnswering),
240
242
  "voice-activity-detection": undefined,
241
243
  "zero-shot-classification": getData("zero-shot-classification", zeroShotClassification),
@@ -24,14 +24,14 @@ const taskData: TaskDataCustom = {
24
24
  },
25
25
  {
26
26
  description: "Very strong mask generation model.",
27
- id: "facebook/sam-vit-huge",
27
+ id: "facebook/sam2-hiera-large",
28
28
  },
29
29
  ],
30
30
  spaces: [
31
31
  {
32
32
  description:
33
- "An application that combines a mask generation model with an image embedding model for open-vocabulary image segmentation.",
34
- id: "SkalskiP/SAM_and_MetaCLIP",
33
+ "An application that combines a mask generation model with a zero-shot object detection model for text-guided image segmentation.",
34
+ id: "merve/OWLSAM2",
35
35
  },
36
36
  {
37
37
  description: "An application that compares the performance of a large and a small mask generation model.",
@@ -39,7 +39,7 @@ const taskData: TaskDataCustom = {
39
39
  },
40
40
  {
41
41
  description: "An application based on an improved mask generation model.",
42
- id: "linfanluntan/Grounded-SAM",
42
+ id: "SkalskiP/segment-anything-model-2",
43
43
  },
44
44
  {
45
45
  description: "An application to remove objects from videos using mask generation models.",
@@ -19,6 +19,10 @@ const taskData: TaskDataCustom = {
19
19
  description: "An instruction dataset with preference ratings on responses.",
20
20
  id: "openbmb/UltraFeedback",
21
21
  },
22
+ {
23
+ description: "A large synthetic dataset for alignment of text generation models.",
24
+ id: "argilla/magpie-ultra-v0.1",
25
+ },
22
26
  ],
23
27
  demo: {
24
28
  inputs: [
@@ -51,32 +55,32 @@ const taskData: TaskDataCustom = {
51
55
  ],
52
56
  models: [
53
57
  {
54
- description: "A large language model trained for text generation.",
55
- id: "bigscience/bloom-560m",
58
+ description: "A text-generation model trained to follow instructions.",
59
+ id: "google/gemma-2-2b-it",
56
60
  },
57
61
  {
58
- description: "A large code generation model that can generate code in 80+ languages.",
62
+ description: "A code generation model that can generate code in 80+ languages.",
59
63
  id: "bigcode/starcoder",
60
64
  },
61
65
  {
62
- description: "A very powerful text generation model.",
63
- id: "mistralai/Mixtral-8x7B-Instruct-v0.1",
66
+ description: "Very powerful text generation model trained to follow instructions.",
67
+ id: "meta-llama/Meta-Llama-3.1-8B-Instruct",
64
68
  },
65
69
  {
66
70
  description: "Small yet powerful text generation model.",
67
- id: "microsoft/phi-2",
71
+ id: "microsoft/Phi-3-mini-4k-instruct",
68
72
  },
69
73
  {
70
- description: "A very powerful model that can chat, do mathematical reasoning and write code.",
71
- id: "openchat/openchat-3.5-0106",
74
+ description: "A very powerful model that can solve mathematical problems.",
75
+ id: "AI-MO/NuminaMath-7B-TIR",
72
76
  },
73
77
  {
74
- description: "Very strong yet small assistant model.",
75
- id: "HuggingFaceH4/zephyr-7b-beta",
78
+ description: "Strong coding assistant model.",
79
+ id: "HuggingFaceH4/starchat2-15b-v0.1",
76
80
  },
77
81
  {
78
82
  description: "Very strong open-source large language model.",
79
- id: "meta-llama/Llama-2-70b-hf",
83
+ id: "mistralai/Mistral-Nemo-Instruct-2407",
80
84
  },
81
85
  ],
82
86
  spaces: [
@@ -104,7 +108,7 @@ const taskData: TaskDataCustom = {
104
108
  summary:
105
109
  "Generating text is the task of generating new text given another text. These models can, for example, fill in incomplete text or paraphrase.",
106
110
  widgetModels: ["HuggingFaceH4/zephyr-7b-beta"],
107
- youtubeId: "Vpjb1lu0MDk",
111
+ youtubeId: "e9gNEAlsOvU",
108
112
  };
109
113
 
110
114
  export default taskData;
@@ -46,15 +46,15 @@ const taskData: TaskDataCustom = {
46
46
  models: [
47
47
  {
48
48
  description: "One of the most powerful image generation models that can generate realistic outputs.",
49
- id: "stabilityai/stable-diffusion-xl-base-1.0",
49
+ id: "black-forest-labs/FLUX.1-dev",
50
50
  },
51
51
  {
52
52
  description: "A powerful yet fast image generation model.",
53
53
  id: "latent-consistency/lcm-lora-sdxl",
54
54
  },
55
55
  {
56
- description: "A very fast text-to-image model.",
57
- id: "ByteDance/SDXL-Lightning",
56
+ description: "Text-to-image model for photorealistic generation.",
57
+ id: "Kwai-Kolors/Kolors",
58
58
  },
59
59
  {
60
60
  description: "A powerful text-to-image model.",