@huggingface/tasks 0.19.15 → 0.19.16

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/src/hardware.ts CHANGED
@@ -38,6 +38,10 @@ export const DEFAULT_MEMORY_OPTIONS = [
38
38
  export const SKUS = {
39
39
  GPU: {
40
40
  NVIDIA: {
41
+ B200: {
42
+ tflops: 496.6,
43
+ memory: [192],
44
+ },
41
45
  H200: {
42
46
  tflops: 241.3,
43
47
  memory: [141],
@@ -132,6 +132,62 @@ wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH)
132
132
  ta.save("test-2.wav", wav, model.sr)`,
133
133
  ];
134
134
 
135
+ export const contexttab = (): string[] => {
136
+ const installSnippet = `pip install git+https://github.com/SAP-samples/contexttab`;
137
+
138
+ const classificationSnippet = `# Run a classification task
139
+ from sklearn.datasets import load_breast_cancer
140
+ from sklearn.metrics import accuracy_score
141
+ from sklearn.model_selection import train_test_split
142
+
143
+ from contexttab import ConTextTabClassifier
144
+
145
+ # Load sample data
146
+ X, y = load_breast_cancer(return_X_y=True)
147
+ X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
148
+
149
+ # Initialize a classifier
150
+ # You can omit checkpoint and checkpoint_revision to use the default model
151
+ clf = ConTextTabClassifier(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
152
+
153
+ clf.fit(X_train, y_train)
154
+
155
+ # Predict probabilities
156
+ prediction_probabilities = clf.predict_proba(X_test)
157
+ # Predict labels
158
+ predictions = clf.predict(X_test)
159
+ print("Accuracy", accuracy_score(y_test, predictions))`;
160
+
161
+ const regressionsSnippet = `# Run a regression task
162
+ from sklearn.datasets import fetch_openml
163
+ from sklearn.metrics import r2_score
164
+ from sklearn.model_selection import train_test_split
165
+
166
+ from contexttab import ConTextTabRegressor
167
+
168
+
169
+ # Load sample data
170
+ df = fetch_openml(data_id=531, as_frame=True)
171
+ X = df.data
172
+ y = df.target.astype(float)
173
+
174
+ # Train-test split
175
+ X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
176
+
177
+ # Initialize the regressor
178
+ # You can omit checkpoint and checkpoint_revision to use the default model
179
+ regressor = ConTextTabRegressor(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
180
+
181
+ regressor.fit(X_train, y_train)
182
+
183
+ # Predict on the test set
184
+ predictions = regressor.predict(X_test)
185
+
186
+ r2 = r2_score(y_test, predictions)
187
+ print("R² Score:", r2)`;
188
+ return [installSnippet, classificationSnippet, regressionsSnippet];
189
+ };
190
+
135
191
  export const cxr_foundation = (): string[] => [
136
192
  `# pip install git+https://github.com/Google-Health/cxr-foundation.git#subdirectory=python
137
193
 
@@ -1354,6 +1410,24 @@ export const voicecraft = (model: ModelData): string[] => [
1354
1410
  model = VoiceCraft.from_pretrained("${model.id}")`,
1355
1411
  ];
1356
1412
 
1413
+ export const vui = (): string[] => [
1414
+ `# !pip install git+https://github.com/fluxions-ai/vui
1415
+
1416
+ import torchaudio
1417
+
1418
+ from vui.inference import render
1419
+ from vui.model import Vui,
1420
+
1421
+ model = Vui.from_pretrained().cuda()
1422
+ waveform = render(
1423
+ model,
1424
+ "Hey, here is some random stuff, usually something quite long as the shorter the text the less likely the model can cope!",
1425
+ )
1426
+ print(waveform.shape)
1427
+ torchaudio.save("out.opus", waveform[0], 22050)
1428
+ `,
1429
+ ];
1430
+
1357
1431
  export const chattts = (): string[] => [
1358
1432
  `import ChatTTS
1359
1433
  import torchaudio
@@ -208,6 +208,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
208
208
  repoUrl: "https://github.com/Unbabel/COMET/",
209
209
  countDownloads: `path:"hparams.yaml"`,
210
210
  },
211
+ contexttab: {
212
+ prettyLabel: "ConTextTab",
213
+ repoName: "ConTextTab",
214
+ repoUrl: "https://github.com/SAP-samples/contexttab",
215
+ countDownloads: `path_extension:"pt"`,
216
+ snippets: snippets.contexttab,
217
+ },
211
218
  cosmos: {
212
219
  prettyLabel: "Cosmos",
213
220
  repoName: "Cosmos",
@@ -1063,6 +1070,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
1063
1070
  docsUrl: "https://github.com/jasonppy/VoiceCraft",
1064
1071
  snippets: snippets.voicecraft,
1065
1072
  },
1073
+ vui: {
1074
+ prettyLabel: "Vui",
1075
+ repoName: "Vui",
1076
+ repoUrl: "https://github.com/vui-ai/vui",
1077
+ countDownloads: `path_extension:"pt"`,
1078
+ snippets: snippets.vui,
1079
+ },
1066
1080
  wham: {
1067
1081
  prettyLabel: "WHAM",
1068
1082
  repoName: "wham",
package/src/pipelines.ts CHANGED
@@ -43,10 +43,6 @@ export interface PipelineData {
43
43
  name: string;
44
44
  subtasks?: SubTask[];
45
45
  modality: Modality;
46
- /**
47
- * color for the tag icon.
48
- */
49
- color: "blue" | "green" | "indigo" | "orange" | "red" | "yellow";
50
46
  /**
51
47
  * whether to hide in /models filters
52
48
  */
@@ -143,7 +139,6 @@ export const PIPELINE_DATA = {
143
139
  },
144
140
  ],
145
141
  modality: "nlp",
146
- color: "orange",
147
142
  },
148
143
  "token-classification": {
149
144
  name: "Token Classification",
@@ -174,12 +169,10 @@ export const PIPELINE_DATA = {
174
169
  },
175
170
  ],
176
171
  modality: "nlp",
177
- color: "blue",
178
172
  },
179
173
  "table-question-answering": {
180
174
  name: "Table Question Answering",
181
175
  modality: "nlp",
182
- color: "green",
183
176
  },
184
177
  "question-answering": {
185
178
  name: "Question Answering",
@@ -198,17 +191,14 @@ export const PIPELINE_DATA = {
198
191
  },
199
192
  ],
200
193
  modality: "nlp",
201
- color: "blue",
202
194
  },
203
195
  "zero-shot-classification": {
204
196
  name: "Zero-Shot Classification",
205
197
  modality: "nlp",
206
- color: "yellow",
207
198
  },
208
199
  translation: {
209
200
  name: "Translation",
210
201
  modality: "nlp",
211
- color: "green",
212
202
  },
213
203
  summarization: {
214
204
  name: "Summarization",
@@ -223,12 +213,10 @@ export const PIPELINE_DATA = {
223
213
  },
224
214
  ],
225
215
  modality: "nlp",
226
- color: "indigo",
227
216
  },
228
217
  "feature-extraction": {
229
218
  name: "Feature Extraction",
230
219
  modality: "nlp",
231
- color: "red",
232
220
  },
233
221
  "text-generation": {
234
222
  name: "Text Generation",
@@ -251,7 +239,6 @@ export const PIPELINE_DATA = {
251
239
  },
252
240
  ],
253
241
  modality: "nlp",
254
- color: "indigo",
255
242
  },
256
243
  "text2text-generation": {
257
244
  name: "Text2Text Generation",
@@ -286,7 +273,6 @@ export const PIPELINE_DATA = {
286
273
  },
287
274
  ],
288
275
  modality: "nlp",
289
- color: "indigo",
290
276
  },
291
277
  "fill-mask": {
292
278
  name: "Fill-Mask",
@@ -301,32 +287,26 @@ export const PIPELINE_DATA = {
301
287
  },
302
288
  ],
303
289
  modality: "nlp",
304
- color: "red",
305
290
  },
306
291
  "sentence-similarity": {
307
292
  name: "Sentence Similarity",
308
293
  modality: "nlp",
309
- color: "yellow",
310
294
  },
311
295
  "text-to-speech": {
312
296
  name: "Text-to-Speech",
313
297
  modality: "audio",
314
- color: "yellow",
315
298
  },
316
299
  "text-to-audio": {
317
300
  name: "Text-to-Audio",
318
301
  modality: "audio",
319
- color: "yellow",
320
302
  },
321
303
  "automatic-speech-recognition": {
322
304
  name: "Automatic Speech Recognition",
323
305
  modality: "audio",
324
- color: "yellow",
325
306
  },
326
307
  "audio-to-audio": {
327
308
  name: "Audio-to-Audio",
328
309
  modality: "audio",
329
- color: "blue",
330
310
  },
331
311
  "audio-classification": {
332
312
  name: "Audio Classification",
@@ -353,23 +333,19 @@ export const PIPELINE_DATA = {
353
333
  },
354
334
  ],
355
335
  modality: "audio",
356
- color: "green",
357
336
  },
358
337
  "audio-text-to-text": {
359
338
  name: "Audio-Text-to-Text",
360
339
  modality: "multimodal",
361
- color: "red",
362
340
  hideInDatasets: true,
363
341
  },
364
342
  "voice-activity-detection": {
365
343
  name: "Voice Activity Detection",
366
344
  modality: "audio",
367
- color: "red",
368
345
  },
369
346
  "depth-estimation": {
370
347
  name: "Depth Estimation",
371
348
  modality: "cv",
372
- color: "yellow",
373
349
  },
374
350
  "image-classification": {
375
351
  name: "Image Classification",
@@ -384,7 +360,6 @@ export const PIPELINE_DATA = {
384
360
  },
385
361
  ],
386
362
  modality: "cv",
387
- color: "blue",
388
363
  },
389
364
  "object-detection": {
390
365
  name: "Object Detection",
@@ -399,7 +374,6 @@ export const PIPELINE_DATA = {
399
374
  },
400
375
  ],
401
376
  modality: "cv",
402
- color: "yellow",
403
377
  },
404
378
  "image-segmentation": {
405
379
  name: "Image Segmentation",
@@ -418,12 +392,10 @@ export const PIPELINE_DATA = {
418
392
  },
419
393
  ],
420
394
  modality: "cv",
421
- color: "green",
422
395
  },
423
396
  "text-to-image": {
424
397
  name: "Text-to-Image",
425
398
  modality: "cv",
426
- color: "yellow",
427
399
  },
428
400
  "image-to-text": {
429
401
  name: "Image-to-Text",
@@ -434,7 +406,6 @@ export const PIPELINE_DATA = {
434
406
  },
435
407
  ],
436
408
  modality: "cv",
437
- color: "red",
438
409
  },
439
410
  "image-to-image": {
440
411
  name: "Image-to-Image",
@@ -453,27 +424,22 @@ export const PIPELINE_DATA = {
453
424
  },
454
425
  ],
455
426
  modality: "cv",
456
- color: "indigo",
457
427
  },
458
428
  "image-to-video": {
459
429
  name: "Image-to-Video",
460
430
  modality: "cv",
461
- color: "indigo",
462
431
  },
463
432
  "unconditional-image-generation": {
464
433
  name: "Unconditional Image Generation",
465
434
  modality: "cv",
466
- color: "green",
467
435
  },
468
436
  "video-classification": {
469
437
  name: "Video Classification",
470
438
  modality: "cv",
471
- color: "blue",
472
439
  },
473
440
  "reinforcement-learning": {
474
441
  name: "Reinforcement Learning",
475
442
  modality: "rl",
476
- color: "red",
477
443
  },
478
444
  robotics: {
479
445
  name: "Robotics",
@@ -488,7 +454,6 @@ export const PIPELINE_DATA = {
488
454
  name: "Task Planning",
489
455
  },
490
456
  ],
491
- color: "blue",
492
457
  },
493
458
  "tabular-classification": {
494
459
  name: "Tabular Classification",
@@ -503,7 +468,6 @@ export const PIPELINE_DATA = {
503
468
  name: "Tabular Multi Label Classification",
504
469
  },
505
470
  ],
506
- color: "blue",
507
471
  },
508
472
  "tabular-regression": {
509
473
  name: "Tabular Regression",
@@ -514,7 +478,6 @@ export const PIPELINE_DATA = {
514
478
  name: "Tabular Single Column Regression",
515
479
  },
516
480
  ],
517
- color: "blue",
518
481
  },
519
482
  "tabular-to-text": {
520
483
  name: "Tabular to Text",
@@ -525,13 +488,11 @@ export const PIPELINE_DATA = {
525
488
  name: "RDF to text",
526
489
  },
527
490
  ],
528
- color: "blue",
529
491
  hideInModels: true,
530
492
  },
531
493
  "table-to-text": {
532
494
  name: "Table to Text",
533
495
  modality: "nlp",
534
- color: "blue",
535
496
  hideInModels: true,
536
497
  },
537
498
  "multiple-choice": {
@@ -547,13 +508,11 @@ export const PIPELINE_DATA = {
547
508
  },
548
509
  ],
549
510
  modality: "nlp",
550
- color: "blue",
551
511
  hideInModels: true,
552
512
  },
553
513
  "text-ranking": {
554
514
  name: "Text Ranking",
555
515
  modality: "nlp",
556
- color: "red",
557
516
  },
558
517
  "text-retrieval": {
559
518
  name: "Text Retrieval",
@@ -576,7 +535,6 @@ export const PIPELINE_DATA = {
576
535
  },
577
536
  ],
578
537
  modality: "nlp",
579
- color: "indigo",
580
538
  hideInModels: true,
581
539
  },
582
540
  "time-series-forecasting": {
@@ -592,17 +550,14 @@ export const PIPELINE_DATA = {
592
550
  name: "Multivariate Time Series Forecasting",
593
551
  },
594
552
  ],
595
- color: "blue",
596
553
  },
597
554
  "text-to-video": {
598
555
  name: "Text-to-Video",
599
556
  modality: "cv",
600
- color: "green",
601
557
  },
602
558
  "image-text-to-text": {
603
559
  name: "Image-Text-to-Text",
604
560
  modality: "multimodal",
605
- color: "red",
606
561
  hideInDatasets: true,
607
562
  },
608
563
  "visual-question-answering": {
@@ -614,7 +569,6 @@ export const PIPELINE_DATA = {
614
569
  },
615
570
  ],
616
571
  modality: "multimodal",
617
- color: "red",
618
572
  },
619
573
  "document-question-answering": {
620
574
  name: "Document Question Answering",
@@ -625,48 +579,39 @@ export const PIPELINE_DATA = {
625
579
  },
626
580
  ],
627
581
  modality: "multimodal",
628
- color: "blue",
629
582
  hideInDatasets: true,
630
583
  },
631
584
  "zero-shot-image-classification": {
632
585
  name: "Zero-Shot Image Classification",
633
586
  modality: "cv",
634
- color: "yellow",
635
587
  },
636
588
  "graph-ml": {
637
589
  name: "Graph Machine Learning",
638
590
  modality: "other",
639
- color: "green",
640
591
  },
641
592
  "mask-generation": {
642
593
  name: "Mask Generation",
643
594
  modality: "cv",
644
- color: "indigo",
645
595
  },
646
596
  "zero-shot-object-detection": {
647
597
  name: "Zero-Shot Object Detection",
648
598
  modality: "cv",
649
- color: "yellow",
650
599
  },
651
600
  "text-to-3d": {
652
601
  name: "Text-to-3D",
653
602
  modality: "cv",
654
- color: "yellow",
655
603
  },
656
604
  "image-to-3d": {
657
605
  name: "Image-to-3D",
658
606
  modality: "cv",
659
- color: "green",
660
607
  },
661
608
  "image-feature-extraction": {
662
609
  name: "Image Feature Extraction",
663
610
  modality: "cv",
664
- color: "indigo",
665
611
  },
666
612
  "video-text-to-text": {
667
613
  name: "Video-Text-to-Text",
668
614
  modality: "multimodal",
669
- color: "blue",
670
615
  hideInDatasets: false,
671
616
  },
672
617
  "keypoint-detection": {
@@ -678,25 +623,21 @@ export const PIPELINE_DATA = {
678
623
  },
679
624
  ],
680
625
  modality: "cv",
681
- color: "red",
682
626
  hideInDatasets: true,
683
627
  },
684
628
  "visual-document-retrieval": {
685
629
  name: "Visual Document Retrieval",
686
630
  modality: "multimodal",
687
- color: "yellow",
688
631
  hideInDatasets: true,
689
632
  },
690
633
  "any-to-any": {
691
634
  name: "Any-to-Any",
692
635
  modality: "multimodal",
693
- color: "yellow",
694
636
  hideInDatasets: true,
695
637
  },
696
638
  other: {
697
639
  name: "Other",
698
640
  modality: "other",
699
- color: "blue",
700
641
  hideInModels: true,
701
642
  hideInDatasets: true,
702
643
  },
@@ -9,7 +9,7 @@
9
9
  "properties": {
10
10
  "meaningful_output_name": {
11
11
  "type": "string",
12
- "description": "TODO: Describe what is outputed by the inference here"
12
+ "description": "TODO: Describe what is outputted by the inference here"
13
13
  }
14
14
  },
15
15
  "required": ["meaningfulOutputName"]
@@ -48,7 +48,7 @@ Observations and states are the information our agent gets from the environment.
48
48
 
49
49
  Inference in reinforcement learning differs from other modalities, in which there's a model and test data. In reinforcement learning, once you have trained an agent in an environment, you try to run the trained agent for additional steps to get the average reward.
50
50
 
51
- A typical training cycle consists of gathering experience from the environment, training the agent, and running the agent on a test environment to obtain average reward. Below there's a snippet on how you can interact with the environment using the `gymnasium` library, train an agent using `stable-baselines3`, evalute the agent on test environment and infer actions from the trained agent.
51
+ A typical training cycle consists of gathering experience from the environment, training the agent, and running the agent on a test environment to obtain average reward. Below there's a snippet on how you can interact with the environment using the `gymnasium` library, train an agent using `stable-baselines3`, evaluate the agent on test environment and infer actions from the trained agent.
52
52
 
53
53
  ```python
54
54
  # Here we are running 20 episodes of CartPole-v1 environment, taking random actions
@@ -101,7 +101,7 @@ Would you like to learn more about the topic? Awesome! Here you can find some cu
101
101
 
102
102
  - You can use [PEFT](https://github.com/huggingface/peft) to adapt large language models in efficient way.
103
103
  - [ChatUI](https://github.com/huggingface/chat-ui) is the open-source interface to conversate with Large Language Models.
104
- - [text-generation-inferface](https://github.com/huggingface/text-generation-inference)
104
+ - [text-generation-inference](https://github.com/huggingface/text-generation-inference)
105
105
  - [HuggingChat](https://huggingface.co/chat/) is a chat interface powered by Hugging Face to chat with powerful models like Meta Llama 3 70B, Mixtral 8x7B, etc.
106
106
 
107
107
  ### Documentation