@huggingface/tasks 0.10.2 → 0.10.4

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/index.cjs CHANGED
@@ -22,6 +22,7 @@ var src_exports = {};
22
22
  __export(src_exports, {
23
23
  ALL_DISPLAY_MODEL_LIBRARY_KEYS: () => ALL_DISPLAY_MODEL_LIBRARY_KEYS,
24
24
  ALL_MODEL_LIBRARY_KEYS: () => ALL_MODEL_LIBRARY_KEYS,
25
+ DEFAULT_MEMORY_OPTIONS: () => DEFAULT_MEMORY_OPTIONS,
25
26
  InferenceDisplayability: () => InferenceDisplayability,
26
27
  LIBRARY_TASK_MAPPING: () => LIBRARY_TASK_MAPPING,
27
28
  LOCAL_APPS: () => LOCAL_APPS,
@@ -32,6 +33,7 @@ __export(src_exports, {
32
33
  PIPELINE_DATA: () => PIPELINE_DATA,
33
34
  PIPELINE_TYPES: () => PIPELINE_TYPES,
34
35
  PIPELINE_TYPES_SET: () => PIPELINE_TYPES_SET,
36
+ SKUS: () => SKUS,
35
37
  SPECIAL_TOKENS_ATTRIBUTES: () => SPECIAL_TOKENS_ATTRIBUTES,
36
38
  SUBTASK_TYPES: () => SUBTASK_TYPES,
37
39
  TASKS_DATA: () => TASKS_DATA,
@@ -5452,12 +5454,295 @@ function hasJsInferenceSnippet(model) {
5452
5454
  return !!model.pipeline_tag && model.pipeline_tag in jsSnippets;
5453
5455
  }
5454
5456
 
5457
+ // src/hardware.ts
5458
+ var TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
5459
+ var TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
5460
+ var TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = 10 ** 8;
5461
+ var TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = 10 ** 13;
5462
+ var DEFAULT_MEMORY_OPTIONS = [8, 16, 24, 32, 40, 48, 64, 80, 96, 128];
5463
+ var SKUS = {
5464
+ GPU: {
5465
+ NVIDIA: {
5466
+ H100: {
5467
+ tflops: 267.6,
5468
+ memory: [80]
5469
+ },
5470
+ L40: {
5471
+ tflops: 90.52,
5472
+ memory: [48]
5473
+ },
5474
+ "RTX 6000 Ada": {
5475
+ tflops: 91.1,
5476
+ memory: [48]
5477
+ },
5478
+ A100: {
5479
+ tflops: 77.97,
5480
+ memory: [80, 40]
5481
+ },
5482
+ A40: {
5483
+ tflops: 37.42,
5484
+ memory: [48]
5485
+ },
5486
+ A10: {
5487
+ tflops: 31.24,
5488
+ memory: [24]
5489
+ },
5490
+ T4: {
5491
+ tflops: 65.13,
5492
+ memory: [16]
5493
+ },
5494
+ "RTX 4090": {
5495
+ tflops: 82.58,
5496
+ memory: [24]
5497
+ },
5498
+ "RTX 4080 SUPER": {
5499
+ tflops: 52.2,
5500
+ memory: [16]
5501
+ },
5502
+ "RTX 4080": {
5503
+ tflops: 48.7,
5504
+ memory: [16]
5505
+ },
5506
+ "RTX 4070": {
5507
+ tflops: 29.15,
5508
+ memory: [12]
5509
+ },
5510
+ "RTX 4070 Ti": {
5511
+ tflops: 40.09,
5512
+ memory: [12]
5513
+ },
5514
+ "RTX 4070 Super": {
5515
+ tflops: 35.48,
5516
+ memory: [12]
5517
+ },
5518
+ "RTX 4070 Ti Super": {
5519
+ tflops: 44.1,
5520
+ memory: [16]
5521
+ },
5522
+ "RTX 3090": {
5523
+ tflops: 35.58,
5524
+ memory: [24]
5525
+ },
5526
+ "RTX 3090 Ti": {
5527
+ tflops: 40,
5528
+ memory: [24]
5529
+ },
5530
+ "RTX 3080 Ti": {
5531
+ tflops: 34.1,
5532
+ memory: [12]
5533
+ },
5534
+ "RTX 3080": {
5535
+ tflops: 30.6,
5536
+ memory: [12, 10]
5537
+ }
5538
+ },
5539
+ AMD: {
5540
+ MI300: {
5541
+ tflops: 383,
5542
+ memory: [192]
5543
+ },
5544
+ MI250: {
5545
+ tflops: 362.1,
5546
+ memory: [128]
5547
+ },
5548
+ MI210: {
5549
+ tflops: 181,
5550
+ memory: [64]
5551
+ },
5552
+ "RX 7900 XTX": {
5553
+ tflops: 122.8,
5554
+ memory: [24]
5555
+ },
5556
+ "RX 7900 XT": {
5557
+ tflops: 103,
5558
+ memory: [20]
5559
+ },
5560
+ "RX 7900 GRE": {
5561
+ tflops: 91.96,
5562
+ memory: [16]
5563
+ },
5564
+ "RX 7800 XT": {
5565
+ tflops: 74.65,
5566
+ memory: [16]
5567
+ },
5568
+ "RX 7700 XT": {
5569
+ tflops: 70.34,
5570
+ memory: [12]
5571
+ },
5572
+ "RX 7600 XT": {
5573
+ tflops: 45.14,
5574
+ memory: [16, 8]
5575
+ }
5576
+ }
5577
+ },
5578
+ CPU: {
5579
+ Intel: {
5580
+ "Xeon 4th Generation (Sapphire Rapids)": {
5581
+ tflops: 1.3
5582
+ },
5583
+ "Xeon 3th Generation (Ice Lake)": {
5584
+ tflops: 0.8
5585
+ },
5586
+ "Xeon 2th Generation (Cascade Lake)": {
5587
+ tflops: 0.55
5588
+ },
5589
+ "Intel Core 13th Generation (i9)": {
5590
+ tflops: 0.85
5591
+ },
5592
+ "Intel Core 13th Generation (i7)": {
5593
+ tflops: 0.82
5594
+ },
5595
+ "Intel Core 13th Generation (i5)": {
5596
+ tflops: 0.68
5597
+ },
5598
+ "Intel Core 13th Generation (i3)": {
5599
+ tflops: 0.57
5600
+ },
5601
+ "Intel Core 12th Generation (i9)": {
5602
+ tflops: 0.79
5603
+ },
5604
+ "Intel Core 12th Generation (i7)": {
5605
+ tflops: 0.77
5606
+ },
5607
+ "Intel Core 12th Generation (i5)": {
5608
+ tflops: 0.65
5609
+ },
5610
+ "Intel Core 12th Generation (i3)": {
5611
+ tflops: 0.53
5612
+ },
5613
+ "Intel Core 11th Generation (i9)": {
5614
+ tflops: 0.7
5615
+ },
5616
+ "Intel Core 11th Generation (i7)": {
5617
+ tflops: 0.6
5618
+ },
5619
+ "Intel Core 11th Generation (i5)": {
5620
+ tflops: 0.5
5621
+ },
5622
+ "Intel Core 11th Generation (i3)": {
5623
+ tflops: 0.35
5624
+ },
5625
+ "Intel Core 10th Generation (i9)": {
5626
+ tflops: 0.46
5627
+ },
5628
+ "Intel Core 10th Generation (i7)": {
5629
+ tflops: 0.46
5630
+ },
5631
+ "Intel Core 10th Generation (i5)": {
5632
+ tflops: 0.46
5633
+ },
5634
+ "Intel Core 10th Generation (i3)": {
5635
+ tflops: 0.44
5636
+ }
5637
+ },
5638
+ AMD: {
5639
+ "EPYC 4th Generation (Genoa)": {
5640
+ tflops: 5
5641
+ },
5642
+ "EPYC 3th Generation (Milan)": {
5643
+ tflops: 2.4
5644
+ },
5645
+ "EPYC 2th Generation (Rome)": {
5646
+ tflops: 0.6
5647
+ },
5648
+ "EPYC 1st Generation (Naples)": {
5649
+ tflops: 0.6
5650
+ },
5651
+ "Ryzen Zen4 7000 (Ryzen 9)": {
5652
+ tflops: 0.56
5653
+ },
5654
+ "Ryzen Zen4 7000 (Ryzen 7)": {
5655
+ tflops: 0.56
5656
+ },
5657
+ "Ryzen Zen4 7000 (Ryzen 5)": {
5658
+ tflops: 0.56
5659
+ },
5660
+ "Ryzen Zen3 5000 (Ryzen 9)": {
5661
+ tflops: 1.33
5662
+ },
5663
+ "Ryzen Zen3 5000 (Ryzen 7)": {
5664
+ tflops: 1.33
5665
+ },
5666
+ "Ryzen Zen3 5000 (Ryzen 5)": {
5667
+ tflops: 0.72
5668
+ },
5669
+ "Ryzen Zen 2 3000 (Threadripper)": {
5670
+ tflops: 0.72
5671
+ },
5672
+ "Ryzen Zen 2 3000 (Ryzen 9)": {
5673
+ tflops: 0.72
5674
+ },
5675
+ "Ryzen Zen 2 3000 (Ryzen 7)": {
5676
+ tflops: 0.72
5677
+ },
5678
+ "Ryzen Zen 2 3000 (Ryzen 5)": {
5679
+ tflops: 0.72
5680
+ },
5681
+ "Ryzen Zen 2 3000 (Ryzen 3)": {
5682
+ tflops: 0.72
5683
+ }
5684
+ }
5685
+ },
5686
+ "Apple Silicon": {
5687
+ "-": {
5688
+ "Apple M1": {
5689
+ tflops: 2.6,
5690
+ memory: [8, 16]
5691
+ },
5692
+ "Apple M1 Pro": {
5693
+ tflops: 5.2,
5694
+ memory: [16, 24, 32]
5695
+ },
5696
+ "Apple M1 Max": {
5697
+ tflops: 10.4,
5698
+ memory: [16, 24, 32, 64]
5699
+ },
5700
+ "Apple M1 Ultra": {
5701
+ tflops: 21,
5702
+ memory: [16, 24, 32, 64, 96, 128]
5703
+ },
5704
+ "Apple M2": {
5705
+ tflops: 3.6,
5706
+ memory: [8, 16, 24]
5707
+ },
5708
+ "Apple M2 Pro": {
5709
+ tflops: 13.6,
5710
+ memory: [16, 24, 32]
5711
+ },
5712
+ "Apple M2 Max": {
5713
+ tflops: 13.49,
5714
+ memory: [32, 64, 96]
5715
+ },
5716
+ "Apple M2 Ultra": {
5717
+ tflops: 27.2,
5718
+ memory: [64, 96, 128, 192]
5719
+ },
5720
+ "Apple M3": {
5721
+ tflops: 2.84,
5722
+ memory: [8, 16, 24]
5723
+ },
5724
+ "Apple M3 Pro": {
5725
+ tflops: 14,
5726
+ memory: [18, 36]
5727
+ },
5728
+ "Apple M3 Max": {
5729
+ tflops: 14.2,
5730
+ memory: [36, 48, 64, 96, 128]
5731
+ }
5732
+ }
5733
+ }
5734
+ };
5735
+
5455
5736
  // src/local-apps.ts
5456
5737
  function isGgufModel(model) {
5457
5738
  return model.tags.includes("gguf");
5458
5739
  }
5459
5740
  var snippetLlamacpp = (model) => {
5460
- return `./main --hf-repo ${model.id} -m file.gguf -p "I believe the meaning of life is " -n 128`;
5741
+ return `./main \\
5742
+ --hf-repo "${model.id}" \\
5743
+ -m file.gguf \\
5744
+ -p "I believe the meaning of life is " \\
5745
+ -n 128`;
5461
5746
  };
5462
5747
  var LOCAL_APPS = {
5463
5748
  "llama.cpp": {
@@ -5515,6 +5800,7 @@ var LOCAL_APPS = {
5515
5800
  0 && (module.exports = {
5516
5801
  ALL_DISPLAY_MODEL_LIBRARY_KEYS,
5517
5802
  ALL_MODEL_LIBRARY_KEYS,
5803
+ DEFAULT_MEMORY_OPTIONS,
5518
5804
  InferenceDisplayability,
5519
5805
  LIBRARY_TASK_MAPPING,
5520
5806
  LOCAL_APPS,
@@ -5525,6 +5811,7 @@ var LOCAL_APPS = {
5525
5811
  PIPELINE_DATA,
5526
5812
  PIPELINE_TYPES,
5527
5813
  PIPELINE_TYPES_SET,
5814
+ SKUS,
5528
5815
  SPECIAL_TOKENS_ATTRIBUTES,
5529
5816
  SUBTASK_TYPES,
5530
5817
  TASKS_DATA,
package/dist/index.js CHANGED
@@ -5416,12 +5416,295 @@ function hasJsInferenceSnippet(model) {
5416
5416
  return !!model.pipeline_tag && model.pipeline_tag in jsSnippets;
5417
5417
  }
5418
5418
 
5419
+ // src/hardware.ts
5420
+ var TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
5421
+ var TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
5422
+ var TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = 10 ** 8;
5423
+ var TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = 10 ** 13;
5424
+ var DEFAULT_MEMORY_OPTIONS = [8, 16, 24, 32, 40, 48, 64, 80, 96, 128];
5425
+ var SKUS = {
5426
+ GPU: {
5427
+ NVIDIA: {
5428
+ H100: {
5429
+ tflops: 267.6,
5430
+ memory: [80]
5431
+ },
5432
+ L40: {
5433
+ tflops: 90.52,
5434
+ memory: [48]
5435
+ },
5436
+ "RTX 6000 Ada": {
5437
+ tflops: 91.1,
5438
+ memory: [48]
5439
+ },
5440
+ A100: {
5441
+ tflops: 77.97,
5442
+ memory: [80, 40]
5443
+ },
5444
+ A40: {
5445
+ tflops: 37.42,
5446
+ memory: [48]
5447
+ },
5448
+ A10: {
5449
+ tflops: 31.24,
5450
+ memory: [24]
5451
+ },
5452
+ T4: {
5453
+ tflops: 65.13,
5454
+ memory: [16]
5455
+ },
5456
+ "RTX 4090": {
5457
+ tflops: 82.58,
5458
+ memory: [24]
5459
+ },
5460
+ "RTX 4080 SUPER": {
5461
+ tflops: 52.2,
5462
+ memory: [16]
5463
+ },
5464
+ "RTX 4080": {
5465
+ tflops: 48.7,
5466
+ memory: [16]
5467
+ },
5468
+ "RTX 4070": {
5469
+ tflops: 29.15,
5470
+ memory: [12]
5471
+ },
5472
+ "RTX 4070 Ti": {
5473
+ tflops: 40.09,
5474
+ memory: [12]
5475
+ },
5476
+ "RTX 4070 Super": {
5477
+ tflops: 35.48,
5478
+ memory: [12]
5479
+ },
5480
+ "RTX 4070 Ti Super": {
5481
+ tflops: 44.1,
5482
+ memory: [16]
5483
+ },
5484
+ "RTX 3090": {
5485
+ tflops: 35.58,
5486
+ memory: [24]
5487
+ },
5488
+ "RTX 3090 Ti": {
5489
+ tflops: 40,
5490
+ memory: [24]
5491
+ },
5492
+ "RTX 3080 Ti": {
5493
+ tflops: 34.1,
5494
+ memory: [12]
5495
+ },
5496
+ "RTX 3080": {
5497
+ tflops: 30.6,
5498
+ memory: [12, 10]
5499
+ }
5500
+ },
5501
+ AMD: {
5502
+ MI300: {
5503
+ tflops: 383,
5504
+ memory: [192]
5505
+ },
5506
+ MI250: {
5507
+ tflops: 362.1,
5508
+ memory: [128]
5509
+ },
5510
+ MI210: {
5511
+ tflops: 181,
5512
+ memory: [64]
5513
+ },
5514
+ "RX 7900 XTX": {
5515
+ tflops: 122.8,
5516
+ memory: [24]
5517
+ },
5518
+ "RX 7900 XT": {
5519
+ tflops: 103,
5520
+ memory: [20]
5521
+ },
5522
+ "RX 7900 GRE": {
5523
+ tflops: 91.96,
5524
+ memory: [16]
5525
+ },
5526
+ "RX 7800 XT": {
5527
+ tflops: 74.65,
5528
+ memory: [16]
5529
+ },
5530
+ "RX 7700 XT": {
5531
+ tflops: 70.34,
5532
+ memory: [12]
5533
+ },
5534
+ "RX 7600 XT": {
5535
+ tflops: 45.14,
5536
+ memory: [16, 8]
5537
+ }
5538
+ }
5539
+ },
5540
+ CPU: {
5541
+ Intel: {
5542
+ "Xeon 4th Generation (Sapphire Rapids)": {
5543
+ tflops: 1.3
5544
+ },
5545
+ "Xeon 3th Generation (Ice Lake)": {
5546
+ tflops: 0.8
5547
+ },
5548
+ "Xeon 2th Generation (Cascade Lake)": {
5549
+ tflops: 0.55
5550
+ },
5551
+ "Intel Core 13th Generation (i9)": {
5552
+ tflops: 0.85
5553
+ },
5554
+ "Intel Core 13th Generation (i7)": {
5555
+ tflops: 0.82
5556
+ },
5557
+ "Intel Core 13th Generation (i5)": {
5558
+ tflops: 0.68
5559
+ },
5560
+ "Intel Core 13th Generation (i3)": {
5561
+ tflops: 0.57
5562
+ },
5563
+ "Intel Core 12th Generation (i9)": {
5564
+ tflops: 0.79
5565
+ },
5566
+ "Intel Core 12th Generation (i7)": {
5567
+ tflops: 0.77
5568
+ },
5569
+ "Intel Core 12th Generation (i5)": {
5570
+ tflops: 0.65
5571
+ },
5572
+ "Intel Core 12th Generation (i3)": {
5573
+ tflops: 0.53
5574
+ },
5575
+ "Intel Core 11th Generation (i9)": {
5576
+ tflops: 0.7
5577
+ },
5578
+ "Intel Core 11th Generation (i7)": {
5579
+ tflops: 0.6
5580
+ },
5581
+ "Intel Core 11th Generation (i5)": {
5582
+ tflops: 0.5
5583
+ },
5584
+ "Intel Core 11th Generation (i3)": {
5585
+ tflops: 0.35
5586
+ },
5587
+ "Intel Core 10th Generation (i9)": {
5588
+ tflops: 0.46
5589
+ },
5590
+ "Intel Core 10th Generation (i7)": {
5591
+ tflops: 0.46
5592
+ },
5593
+ "Intel Core 10th Generation (i5)": {
5594
+ tflops: 0.46
5595
+ },
5596
+ "Intel Core 10th Generation (i3)": {
5597
+ tflops: 0.44
5598
+ }
5599
+ },
5600
+ AMD: {
5601
+ "EPYC 4th Generation (Genoa)": {
5602
+ tflops: 5
5603
+ },
5604
+ "EPYC 3th Generation (Milan)": {
5605
+ tflops: 2.4
5606
+ },
5607
+ "EPYC 2th Generation (Rome)": {
5608
+ tflops: 0.6
5609
+ },
5610
+ "EPYC 1st Generation (Naples)": {
5611
+ tflops: 0.6
5612
+ },
5613
+ "Ryzen Zen4 7000 (Ryzen 9)": {
5614
+ tflops: 0.56
5615
+ },
5616
+ "Ryzen Zen4 7000 (Ryzen 7)": {
5617
+ tflops: 0.56
5618
+ },
5619
+ "Ryzen Zen4 7000 (Ryzen 5)": {
5620
+ tflops: 0.56
5621
+ },
5622
+ "Ryzen Zen3 5000 (Ryzen 9)": {
5623
+ tflops: 1.33
5624
+ },
5625
+ "Ryzen Zen3 5000 (Ryzen 7)": {
5626
+ tflops: 1.33
5627
+ },
5628
+ "Ryzen Zen3 5000 (Ryzen 5)": {
5629
+ tflops: 0.72
5630
+ },
5631
+ "Ryzen Zen 2 3000 (Threadripper)": {
5632
+ tflops: 0.72
5633
+ },
5634
+ "Ryzen Zen 2 3000 (Ryzen 9)": {
5635
+ tflops: 0.72
5636
+ },
5637
+ "Ryzen Zen 2 3000 (Ryzen 7)": {
5638
+ tflops: 0.72
5639
+ },
5640
+ "Ryzen Zen 2 3000 (Ryzen 5)": {
5641
+ tflops: 0.72
5642
+ },
5643
+ "Ryzen Zen 2 3000 (Ryzen 3)": {
5644
+ tflops: 0.72
5645
+ }
5646
+ }
5647
+ },
5648
+ "Apple Silicon": {
5649
+ "-": {
5650
+ "Apple M1": {
5651
+ tflops: 2.6,
5652
+ memory: [8, 16]
5653
+ },
5654
+ "Apple M1 Pro": {
5655
+ tflops: 5.2,
5656
+ memory: [16, 24, 32]
5657
+ },
5658
+ "Apple M1 Max": {
5659
+ tflops: 10.4,
5660
+ memory: [16, 24, 32, 64]
5661
+ },
5662
+ "Apple M1 Ultra": {
5663
+ tflops: 21,
5664
+ memory: [16, 24, 32, 64, 96, 128]
5665
+ },
5666
+ "Apple M2": {
5667
+ tflops: 3.6,
5668
+ memory: [8, 16, 24]
5669
+ },
5670
+ "Apple M2 Pro": {
5671
+ tflops: 13.6,
5672
+ memory: [16, 24, 32]
5673
+ },
5674
+ "Apple M2 Max": {
5675
+ tflops: 13.49,
5676
+ memory: [32, 64, 96]
5677
+ },
5678
+ "Apple M2 Ultra": {
5679
+ tflops: 27.2,
5680
+ memory: [64, 96, 128, 192]
5681
+ },
5682
+ "Apple M3": {
5683
+ tflops: 2.84,
5684
+ memory: [8, 16, 24]
5685
+ },
5686
+ "Apple M3 Pro": {
5687
+ tflops: 14,
5688
+ memory: [18, 36]
5689
+ },
5690
+ "Apple M3 Max": {
5691
+ tflops: 14.2,
5692
+ memory: [36, 48, 64, 96, 128]
5693
+ }
5694
+ }
5695
+ }
5696
+ };
5697
+
5419
5698
  // src/local-apps.ts
5420
5699
  function isGgufModel(model) {
5421
5700
  return model.tags.includes("gguf");
5422
5701
  }
5423
5702
  var snippetLlamacpp = (model) => {
5424
- return `./main --hf-repo ${model.id} -m file.gguf -p "I believe the meaning of life is " -n 128`;
5703
+ return `./main \\
5704
+ --hf-repo "${model.id}" \\
5705
+ -m file.gguf \\
5706
+ -p "I believe the meaning of life is " \\
5707
+ -n 128`;
5425
5708
  };
5426
5709
  var LOCAL_APPS = {
5427
5710
  "llama.cpp": {
@@ -5478,6 +5761,7 @@ var LOCAL_APPS = {
5478
5761
  export {
5479
5762
  ALL_DISPLAY_MODEL_LIBRARY_KEYS,
5480
5763
  ALL_MODEL_LIBRARY_KEYS,
5764
+ DEFAULT_MEMORY_OPTIONS,
5481
5765
  InferenceDisplayability,
5482
5766
  LIBRARY_TASK_MAPPING,
5483
5767
  LOCAL_APPS,
@@ -5488,6 +5772,7 @@ export {
5488
5772
  PIPELINE_DATA,
5489
5773
  PIPELINE_TYPES,
5490
5774
  PIPELINE_TYPES_SET,
5775
+ SKUS,
5491
5776
  SPECIAL_TOKENS_ATTRIBUTES,
5492
5777
  SUBTASK_TYPES,
5493
5778
  TASKS_DATA,
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Biden AI Executive Order
3
+ * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4
+ */
5
+ export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL: number;
6
+ export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY: number;
7
+ export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER: number;
8
+ /**
9
+ * EU AI Act
10
+ * https://ec.europa.eu/commission/presscorner/detail/en/qanda_21_1683
11
+ */
12
+ export declare const TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL: number;
13
+ export interface HardwareSpec {
14
+ /**
15
+ * Approximate value, in FP16 whenever possible.
16
+ * This is only approximate/theoretical and shouldn't be taken too seriously.
17
+ * Currently the CPU values are from cpu-monkey.com
18
+ * while the GPU values are from techpowerup.com
19
+ *
20
+ * Note to reviewers: I got fed up with data entry,
21
+ * and HuggingChat running Llama3 with Web search was failing a bit,
22
+ * so some of those values might be slightly inaccurate. Forgive me and please feel free to improve.
23
+ */
24
+ tflops: number;
25
+ /**
26
+ * If an array is specified, options of memory size (can be VRAM, unified RAM)
27
+ * e.g. an A100 exists in 40 or 80 GB.
28
+ */
29
+ memory?: number[];
30
+ }
31
+ export declare const DEFAULT_MEMORY_OPTIONS: number[];
32
+ export declare const SKUS: {
33
+ GPU: {
34
+ NVIDIA: {
35
+ H100: {
36
+ tflops: number;
37
+ memory: number[];
38
+ };
39
+ L40: {
40
+ tflops: number;
41
+ memory: number[];
42
+ };
43
+ "RTX 6000 Ada": {
44
+ tflops: number;
45
+ memory: number[];
46
+ };
47
+ A100: {
48
+ tflops: number;
49
+ memory: number[];
50
+ };
51
+ A40: {
52
+ tflops: number;
53
+ memory: number[];
54
+ };
55
+ A10: {
56
+ tflops: number;
57
+ memory: number[];
58
+ };
59
+ T4: {
60
+ tflops: number;
61
+ memory: number[];
62
+ };
63
+ "RTX 4090": {
64
+ tflops: number;
65
+ memory: number[];
66
+ };
67
+ "RTX 4080 SUPER": {
68
+ tflops: number;
69
+ memory: number[];
70
+ };
71
+ "RTX 4080": {
72
+ tflops: number;
73
+ memory: number[];
74
+ };
75
+ "RTX 4070": {
76
+ tflops: number;
77
+ memory: number[];
78
+ };
79
+ "RTX 4070 Ti": {
80
+ tflops: number;
81
+ memory: number[];
82
+ };
83
+ "RTX 4070 Super": {
84
+ tflops: number;
85
+ memory: number[];
86
+ };
87
+ "RTX 4070 Ti Super": {
88
+ tflops: number;
89
+ memory: number[];
90
+ };
91
+ "RTX 3090": {
92
+ tflops: number;
93
+ memory: number[];
94
+ };
95
+ "RTX 3090 Ti": {
96
+ tflops: number;
97
+ memory: number[];
98
+ };
99
+ "RTX 3080 Ti": {
100
+ tflops: number;
101
+ memory: number[];
102
+ };
103
+ "RTX 3080": {
104
+ tflops: number;
105
+ memory: number[];
106
+ };
107
+ };
108
+ AMD: {
109
+ MI300: {
110
+ tflops: number;
111
+ memory: number[];
112
+ };
113
+ MI250: {
114
+ tflops: number;
115
+ memory: number[];
116
+ };
117
+ MI210: {
118
+ tflops: number;
119
+ memory: number[];
120
+ };
121
+ "RX 7900 XTX": {
122
+ tflops: number;
123
+ memory: number[];
124
+ };
125
+ "RX 7900 XT": {
126
+ tflops: number;
127
+ memory: number[];
128
+ };
129
+ "RX 7900 GRE": {
130
+ tflops: number;
131
+ memory: number[];
132
+ };
133
+ "RX 7800 XT": {
134
+ tflops: number;
135
+ memory: number[];
136
+ };
137
+ "RX 7700 XT": {
138
+ tflops: number;
139
+ memory: number[];
140
+ };
141
+ "RX 7600 XT": {
142
+ tflops: number;
143
+ memory: number[];
144
+ };
145
+ };
146
+ };
147
+ CPU: {
148
+ Intel: {
149
+ "Xeon 4th Generation (Sapphire Rapids)": {
150
+ tflops: number;
151
+ };
152
+ "Xeon 3th Generation (Ice Lake)": {
153
+ tflops: number;
154
+ };
155
+ "Xeon 2th Generation (Cascade Lake)": {
156
+ tflops: number;
157
+ };
158
+ "Intel Core 13th Generation (i9)": {
159
+ tflops: number;
160
+ };
161
+ "Intel Core 13th Generation (i7)": {
162
+ tflops: number;
163
+ };
164
+ "Intel Core 13th Generation (i5)": {
165
+ tflops: number;
166
+ };
167
+ "Intel Core 13th Generation (i3)": {
168
+ tflops: number;
169
+ };
170
+ "Intel Core 12th Generation (i9)": {
171
+ tflops: number;
172
+ };
173
+ "Intel Core 12th Generation (i7)": {
174
+ tflops: number;
175
+ };
176
+ "Intel Core 12th Generation (i5)": {
177
+ tflops: number;
178
+ };
179
+ "Intel Core 12th Generation (i3)": {
180
+ tflops: number;
181
+ };
182
+ "Intel Core 11th Generation (i9)": {
183
+ tflops: number;
184
+ };
185
+ "Intel Core 11th Generation (i7)": {
186
+ tflops: number;
187
+ };
188
+ "Intel Core 11th Generation (i5)": {
189
+ tflops: number;
190
+ };
191
+ "Intel Core 11th Generation (i3)": {
192
+ tflops: number;
193
+ };
194
+ "Intel Core 10th Generation (i9)": {
195
+ tflops: number;
196
+ };
197
+ "Intel Core 10th Generation (i7)": {
198
+ tflops: number;
199
+ };
200
+ "Intel Core 10th Generation (i5)": {
201
+ tflops: number;
202
+ };
203
+ "Intel Core 10th Generation (i3)": {
204
+ tflops: number;
205
+ };
206
+ };
207
+ AMD: {
208
+ "EPYC 4th Generation (Genoa)": {
209
+ tflops: number;
210
+ };
211
+ "EPYC 3th Generation (Milan)": {
212
+ tflops: number;
213
+ };
214
+ "EPYC 2th Generation (Rome)": {
215
+ tflops: number;
216
+ };
217
+ "EPYC 1st Generation (Naples)": {
218
+ tflops: number;
219
+ };
220
+ "Ryzen Zen4 7000 (Ryzen 9)": {
221
+ tflops: number;
222
+ };
223
+ "Ryzen Zen4 7000 (Ryzen 7)": {
224
+ tflops: number;
225
+ };
226
+ "Ryzen Zen4 7000 (Ryzen 5)": {
227
+ tflops: number;
228
+ };
229
+ "Ryzen Zen3 5000 (Ryzen 9)": {
230
+ tflops: number;
231
+ };
232
+ "Ryzen Zen3 5000 (Ryzen 7)": {
233
+ tflops: number;
234
+ };
235
+ "Ryzen Zen3 5000 (Ryzen 5)": {
236
+ tflops: number;
237
+ };
238
+ "Ryzen Zen 2 3000 (Threadripper)": {
239
+ tflops: number;
240
+ };
241
+ "Ryzen Zen 2 3000 (Ryzen 9)": {
242
+ tflops: number;
243
+ };
244
+ "Ryzen Zen 2 3000 (Ryzen 7)": {
245
+ tflops: number;
246
+ };
247
+ "Ryzen Zen 2 3000 (Ryzen 5)": {
248
+ tflops: number;
249
+ };
250
+ "Ryzen Zen 2 3000 (Ryzen 3)": {
251
+ tflops: number;
252
+ };
253
+ };
254
+ };
255
+ "Apple Silicon": {
256
+ "-": {
257
+ "Apple M1": {
258
+ tflops: number;
259
+ memory: number[];
260
+ };
261
+ "Apple M1 Pro": {
262
+ tflops: number;
263
+ memory: number[];
264
+ };
265
+ "Apple M1 Max": {
266
+ tflops: number;
267
+ memory: number[];
268
+ };
269
+ "Apple M1 Ultra": {
270
+ tflops: number;
271
+ memory: number[];
272
+ };
273
+ "Apple M2": {
274
+ tflops: number;
275
+ memory: number[];
276
+ };
277
+ "Apple M2 Pro": {
278
+ tflops: number;
279
+ memory: number[];
280
+ };
281
+ "Apple M2 Max": {
282
+ tflops: number;
283
+ memory: number[];
284
+ };
285
+ "Apple M2 Ultra": {
286
+ tflops: number;
287
+ memory: number[];
288
+ };
289
+ "Apple M3": {
290
+ tflops: number;
291
+ memory: number[];
292
+ };
293
+ "Apple M3 Pro": {
294
+ tflops: number;
295
+ memory: number[];
296
+ };
297
+ "Apple M3 Max": {
298
+ tflops: number;
299
+ memory: number[];
300
+ };
301
+ };
302
+ };
303
+ };
304
+ export type SkuType = keyof typeof SKUS;
305
+ //# sourceMappingURL=hardware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iDAAiD,QAAW,CAAC;AAC1E,eAAO,MAAM,yDAAyD,QAAW,CAAC;AAClF,eAAO,MAAM,oCAAoC,QAAU,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,+CAA+C,QAAW,CAAC;AAExE,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,UAA2C,CAAC;AAE/E,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+QuD,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,IAAI,CAAC"}
@@ -7,11 +7,13 @@ export { ALL_DISPLAY_MODEL_LIBRARY_KEYS, ALL_MODEL_LIBRARY_KEYS, MODEL_LIBRARIES
7
7
  export type { LibraryUiElement, ModelLibraryKey } from "./model-libraries";
8
8
  export type { ModelData, TransformersInfo } from "./model-data";
9
9
  export type { AddedToken, SpecialTokensMap, TokenizerConfig } from "./tokenizer-data";
10
- export type { ChatMessage, WidgetExample, WidgetExampleAttribute, WidgetExampleAssetAndPromptInput, WidgetExampleAssetAndTextInput, WidgetExampleAssetAndZeroShotInput, WidgetExampleAssetInput, WidgetExampleChatInput, WidgetExampleSentenceSimilarityInput, WidgetExampleStructuredDataInput, WidgetExampleTableDataInput, WidgetExampleTextAndContextInput, WidgetExampleTextAndTableInput, WidgetExampleTextInput, WidgetExampleZeroShotTextInput, WidgetExampleOutput, WidgetExampleOutputUrl, WidgetExampleOutputLabels, WidgetExampleOutputAnswerScore, WidgetExampleOutputText, } from "./widget-example";
10
+ export type { WidgetExample, WidgetExampleAttribute, WidgetExampleAssetAndPromptInput, WidgetExampleAssetAndTextInput, WidgetExampleAssetAndZeroShotInput, WidgetExampleAssetInput, WidgetExampleChatInput, WidgetExampleSentenceSimilarityInput, WidgetExampleStructuredDataInput, WidgetExampleTableDataInput, WidgetExampleTextAndContextInput, WidgetExampleTextAndTableInput, WidgetExampleTextInput, WidgetExampleZeroShotTextInput, WidgetExampleOutput, WidgetExampleOutputUrl, WidgetExampleOutputLabels, WidgetExampleOutputAnswerScore, WidgetExampleOutputText, } from "./widget-example";
11
11
  export { InferenceDisplayability } from "./model-data";
12
12
  export { SPECIAL_TOKENS_ATTRIBUTES } from "./tokenizer-data";
13
13
  import * as snippets from "./snippets";
14
14
  export { snippets };
15
+ export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware";
16
+ export type { HardwareSpec, SkuType } from "./hardware";
15
17
  export { LOCAL_APPS } from "./local-apps";
16
18
  export type { LocalApp, LocalAppKey } from "./local-apps";
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9E,cAAc,SAAS,CAAC;AACxB,OAAO,EACN,aAAa,EACb,cAAc,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,UAAU,EACV,eAAe,E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{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC;CACnC,GACD;IACA;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;CACrC,CACH,CAAC;AAEF,iBAAS,WAAW,CAAC,KAAK,EAAE,SAAS,WAEpC;AASD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU;;;;;;yBAlBS,SAAS,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsDhD;;WAEG;;;;;;;;;;;;;CAa+B,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC;CACnC,GACD;IACA;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;CACrC,CACH,CAAC;AAEF,iBAAS,WAAW,CAAC,KAAK,EAAE,SAAS,WAEpC;AAUD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU;;;;;;yBAnBS,SAAS,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuDhD;;WAEG;;;;;;;;;;;;;CAa+B,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * See default-widget-inputs.ts for the default widget inputs, this files only contains the types
3
3
  */
4
+ import type { ChatCompletionInputMessage } from "./tasks";
4
5
  type TableData = Record<string, (string | number)[]>;
5
6
  export type WidgetExampleOutputLabels = Array<{
6
7
  label: string;
@@ -40,12 +41,8 @@ export interface WidgetExampleBase<TOutput> {
40
41
  */
41
42
  output?: TOutput;
42
43
  }
43
- export interface ChatMessage {
44
- role: "user" | "assistant" | "system";
45
- content: string;
46
- }
47
44
  export interface WidgetExampleChatInput<TOutput = WidgetExampleOutput> extends WidgetExampleBase<TOutput> {
48
- messages: ChatMessage[];
45
+ messages: ChatCompletionInputMessage[];
49
46
  }
50
47
  export interface WidgetExampleTextInput<TOutput = WidgetExampleOutput> extends WidgetExampleBase<TOutput> {
51
48
  text: string;
@@ -1 +1 @@
1
- {"version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B,WAAW,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oCAAoC,CAAC,OAAO,GAAG,mBAAmB,CAClF,SAAQ,iBAAiB,CAAC,OAAO,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;CACpB;AAID,MAAM,MAAM,aAAa,CAAC,OAAO,GAAG,mBAAmB,IACpD,sBAAsB,CAAC,OAAO,CAAC,GAC/B,sBAAsB,CAAC,OAAO,CAAC,GAC/B,gCAAgC,CAAC,OAAO,CAAC,GACzC,8BAA8B,CAAC,OAAO,CAAC,GACvC,uBAAuB,CAAC,OAAO,CAAC,GAChC,gCAAgC,CAAC,OAAO,CAAC,GACzC,8BAA8B,CAAC,OAAO,CAAC,GACvC,kCAAkC,CAAC,OAAO,CAAC,GAC3C,gCAAgC,CAAC,OAAO,CAAC,GACzC,2BAA2B,CAAC,OAAO,CAAC,GACpC,8BAA8B,CAAC,OAAO,CAAC,GACvC,oCAAoC,CAAC,OAAO,CAAC,CAAC;AAEjD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,aAAa,CAAC,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.10.2",
4
+ "version": "0.10.4",
5
5
  "description": "List of ML tasks for huggingface.co/tasks",
6
6
  "repository": "https://github.com/huggingface/huggingface.js.git",
7
7
  "publishConfig": {
@@ -0,0 +1,309 @@
1
+ /**
2
+ * Biden AI Executive Order
3
+ * https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4
+ */
5
+ export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
6
+ export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
7
+ export const TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = 10 ** 8;
8
+
9
+ /**
10
+ * EU AI Act
11
+ * https://ec.europa.eu/commission/presscorner/detail/en/qanda_21_1683
12
+ */
13
+ export const TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = 10 ** 13;
14
+
15
+ export interface HardwareSpec {
16
+ /**
17
+ * Approximate value, in FP16 whenever possible.
18
+ * This is only approximate/theoretical and shouldn't be taken too seriously.
19
+ * Currently the CPU values are from cpu-monkey.com
20
+ * while the GPU values are from techpowerup.com
21
+ *
22
+ * Note to reviewers: I got fed up with data entry,
23
+ * and HuggingChat running Llama3 with Web search was failing a bit,
24
+ * so some of those values might be slightly inaccurate. Forgive me and please feel free to improve.
25
+ */
26
+ tflops: number;
27
+ /**
28
+ * If an array is specified, options of memory size (can be VRAM, unified RAM)
29
+ * e.g. an A100 exists in 40 or 80 GB.
30
+ */
31
+ memory?: number[];
32
+ }
33
+
34
+ export const DEFAULT_MEMORY_OPTIONS = [8, 16, 24, 32, 40, 48, 64, 80, 96, 128];
35
+
36
+ export const SKUS = {
37
+ GPU: {
38
+ NVIDIA: {
39
+ H100: {
40
+ tflops: 267.6,
41
+ memory: [80],
42
+ },
43
+ L40: {
44
+ tflops: 90.52,
45
+ memory: [48],
46
+ },
47
+ "RTX 6000 Ada": {
48
+ tflops: 91.1,
49
+ memory: [48],
50
+ },
51
+ A100: {
52
+ tflops: 77.97,
53
+ memory: [80, 40],
54
+ },
55
+ A40: {
56
+ tflops: 37.42,
57
+ memory: [48],
58
+ },
59
+ A10: {
60
+ tflops: 31.24,
61
+ memory: [24],
62
+ },
63
+ T4: {
64
+ tflops: 65.13,
65
+ memory: [16],
66
+ },
67
+ "RTX 4090": {
68
+ tflops: 82.58,
69
+ memory: [24],
70
+ },
71
+ "RTX 4080 SUPER": {
72
+ tflops: 52.2,
73
+ memory: [16],
74
+ },
75
+ "RTX 4080": {
76
+ tflops: 48.7,
77
+ memory: [16],
78
+ },
79
+ "RTX 4070": {
80
+ tflops: 29.15,
81
+ memory: [12],
82
+ },
83
+ "RTX 4070 Ti": {
84
+ tflops: 40.09,
85
+ memory: [12],
86
+ },
87
+ "RTX 4070 Super": {
88
+ tflops: 35.48,
89
+ memory: [12],
90
+ },
91
+ "RTX 4070 Ti Super": {
92
+ tflops: 44.1,
93
+ memory: [16],
94
+ },
95
+ "RTX 3090": {
96
+ tflops: 35.58,
97
+ memory: [24],
98
+ },
99
+ "RTX 3090 Ti": {
100
+ tflops: 40,
101
+ memory: [24],
102
+ },
103
+ "RTX 3080 Ti": {
104
+ tflops: 34.1,
105
+ memory: [12],
106
+ },
107
+ "RTX 3080": {
108
+ tflops: 30.6,
109
+ memory: [12, 10],
110
+ },
111
+ },
112
+ AMD: {
113
+ MI300: {
114
+ tflops: 383.0,
115
+ memory: [192],
116
+ },
117
+ MI250: {
118
+ tflops: 362.1,
119
+ memory: [128],
120
+ },
121
+ MI210: {
122
+ tflops: 181.0,
123
+ memory: [64],
124
+ },
125
+ "RX 7900 XTX": {
126
+ tflops: 122.8,
127
+ memory: [24],
128
+ },
129
+ "RX 7900 XT": {
130
+ tflops: 103.0,
131
+ memory: [20],
132
+ },
133
+ "RX 7900 GRE": {
134
+ tflops: 91.96,
135
+ memory: [16],
136
+ },
137
+ "RX 7800 XT": {
138
+ tflops: 74.65,
139
+ memory: [16],
140
+ },
141
+ "RX 7700 XT": {
142
+ tflops: 70.34,
143
+ memory: [12],
144
+ },
145
+ "RX 7600 XT": {
146
+ tflops: 45.14,
147
+ memory: [16, 8],
148
+ },
149
+ },
150
+ },
151
+ CPU: {
152
+ Intel: {
153
+ "Xeon 4th Generation (Sapphire Rapids)": {
154
+ tflops: 1.3,
155
+ },
156
+ "Xeon 3th Generation (Ice Lake)": {
157
+ tflops: 0.8,
158
+ },
159
+ "Xeon 2th Generation (Cascade Lake)": {
160
+ tflops: 0.55,
161
+ },
162
+ "Intel Core 13th Generation (i9)": {
163
+ tflops: 0.85,
164
+ },
165
+ "Intel Core 13th Generation (i7)": {
166
+ tflops: 0.82,
167
+ },
168
+ "Intel Core 13th Generation (i5)": {
169
+ tflops: 0.68,
170
+ },
171
+ "Intel Core 13th Generation (i3)": {
172
+ tflops: 0.57,
173
+ },
174
+ "Intel Core 12th Generation (i9)": {
175
+ tflops: 0.79,
176
+ },
177
+ "Intel Core 12th Generation (i7)": {
178
+ tflops: 0.77,
179
+ },
180
+ "Intel Core 12th Generation (i5)": {
181
+ tflops: 0.65,
182
+ },
183
+ "Intel Core 12th Generation (i3)": {
184
+ tflops: 0.53,
185
+ },
186
+ "Intel Core 11th Generation (i9)": {
187
+ tflops: 0.7,
188
+ },
189
+ "Intel Core 11th Generation (i7)": {
190
+ tflops: 0.6,
191
+ },
192
+ "Intel Core 11th Generation (i5)": {
193
+ tflops: 0.5,
194
+ },
195
+ "Intel Core 11th Generation (i3)": {
196
+ tflops: 0.35,
197
+ },
198
+ "Intel Core 10th Generation (i9)": {
199
+ tflops: 0.46,
200
+ },
201
+ "Intel Core 10th Generation (i7)": {
202
+ tflops: 0.46,
203
+ },
204
+ "Intel Core 10th Generation (i5)": {
205
+ tflops: 0.46,
206
+ },
207
+ "Intel Core 10th Generation (i3)": {
208
+ tflops: 0.44,
209
+ },
210
+ },
211
+ AMD: {
212
+ "EPYC 4th Generation (Genoa)": {
213
+ tflops: 5,
214
+ },
215
+ "EPYC 3th Generation (Milan)": {
216
+ tflops: 2.4,
217
+ },
218
+ "EPYC 2th Generation (Rome)": {
219
+ tflops: 0.6,
220
+ },
221
+ "EPYC 1st Generation (Naples)": {
222
+ tflops: 0.6,
223
+ },
224
+ "Ryzen Zen4 7000 (Ryzen 9)": {
225
+ tflops: 0.56,
226
+ },
227
+ "Ryzen Zen4 7000 (Ryzen 7)": {
228
+ tflops: 0.56,
229
+ },
230
+ "Ryzen Zen4 7000 (Ryzen 5)": {
231
+ tflops: 0.56,
232
+ },
233
+ "Ryzen Zen3 5000 (Ryzen 9)": {
234
+ tflops: 1.33,
235
+ },
236
+ "Ryzen Zen3 5000 (Ryzen 7)": {
237
+ tflops: 1.33,
238
+ },
239
+ "Ryzen Zen3 5000 (Ryzen 5)": {
240
+ tflops: 0.72,
241
+ },
242
+ "Ryzen Zen 2 3000 (Threadripper)": {
243
+ tflops: 0.72,
244
+ },
245
+ "Ryzen Zen 2 3000 (Ryzen 9)": {
246
+ tflops: 0.72,
247
+ },
248
+ "Ryzen Zen 2 3000 (Ryzen 7)": {
249
+ tflops: 0.72,
250
+ },
251
+ "Ryzen Zen 2 3000 (Ryzen 5)": {
252
+ tflops: 0.72,
253
+ },
254
+ "Ryzen Zen 2 3000 (Ryzen 3)": {
255
+ tflops: 0.72,
256
+ },
257
+ },
258
+ },
259
+ "Apple Silicon": {
260
+ "-": {
261
+ "Apple M1": {
262
+ tflops: 2.6,
263
+ memory: [8, 16],
264
+ },
265
+ "Apple M1 Pro": {
266
+ tflops: 5.2,
267
+ memory: [16, 24, 32],
268
+ },
269
+ "Apple M1 Max": {
270
+ tflops: 10.4,
271
+ memory: [16, 24, 32, 64],
272
+ },
273
+ "Apple M1 Ultra": {
274
+ tflops: 21,
275
+ memory: [16, 24, 32, 64, 96, 128],
276
+ },
277
+ "Apple M2": {
278
+ tflops: 3.6,
279
+ memory: [8, 16, 24],
280
+ },
281
+ "Apple M2 Pro": {
282
+ tflops: 13.6,
283
+ memory: [16, 24, 32],
284
+ },
285
+ "Apple M2 Max": {
286
+ tflops: 13.49,
287
+ memory: [32, 64, 96],
288
+ },
289
+ "Apple M2 Ultra": {
290
+ tflops: 27.2,
291
+ memory: [64, 96, 128, 192],
292
+ },
293
+ "Apple M3": {
294
+ tflops: 2.84,
295
+ memory: [8, 16, 24],
296
+ },
297
+ "Apple M3 Pro": {
298
+ tflops: 14,
299
+ memory: [18, 36],
300
+ },
301
+ "Apple M3 Max": {
302
+ tflops: 14.2,
303
+ memory: [36, 48, 64, 96, 128],
304
+ },
305
+ },
306
+ },
307
+ } satisfies Record<string, Record<string, Record<string, HardwareSpec>>>;
308
+
309
+ export type SkuType = keyof typeof SKUS;
package/src/index.ts CHANGED
@@ -19,7 +19,6 @@ export type { LibraryUiElement, ModelLibraryKey } from "./model-libraries";
19
19
  export type { ModelData, TransformersInfo } from "./model-data";
20
20
  export type { AddedToken, SpecialTokensMap, TokenizerConfig } from "./tokenizer-data";
21
21
  export type {
22
- ChatMessage,
23
22
  WidgetExample,
24
23
  WidgetExampleAttribute,
25
24
  WidgetExampleAssetAndPromptInput,
@@ -46,5 +45,7 @@ export { SPECIAL_TOKENS_ATTRIBUTES } from "./tokenizer-data";
46
45
  import * as snippets from "./snippets";
47
46
  export { snippets };
48
47
 
48
+ export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware";
49
+ export type { HardwareSpec, SkuType } from "./hardware";
49
50
  export { LOCAL_APPS } from "./local-apps";
50
51
  export type { LocalApp, LocalAppKey } from "./local-apps";
package/src/local-apps.ts CHANGED
@@ -47,10 +47,11 @@ function isGgufModel(model: ModelData) {
47
47
  }
48
48
 
49
49
  const snippetLlamacpp = (model: ModelData): string => {
50
- return `./main \
51
- --hf-repo ${model.id} \
52
- -m file.gguf \
53
- -p "I believe the meaning of life is " -n 128`;
50
+ return `./main \\
51
+ --hf-repo "${model.id}" \\
52
+ -m file.gguf \\
53
+ -p "I believe the meaning of life is " \\
54
+ -n 128`;
54
55
  };
55
56
 
56
57
  /**
@@ -2,6 +2,8 @@
2
2
  * See default-widget-inputs.ts for the default widget inputs, this files only contains the types
3
3
  */
4
4
 
5
+ import type { ChatCompletionInputMessage } from "./tasks";
6
+
5
7
  type TableData = Record<string, (string | number)[]>;
6
8
 
7
9
  //#region outputs
@@ -51,13 +53,8 @@ export interface WidgetExampleBase<TOutput> {
51
53
  output?: TOutput;
52
54
  }
53
55
 
54
- export interface ChatMessage {
55
- role: "user" | "assistant" | "system";
56
- content: string;
57
- }
58
-
59
56
  export interface WidgetExampleChatInput<TOutput = WidgetExampleOutput> extends WidgetExampleBase<TOutput> {
60
- messages: ChatMessage[];
57
+ messages: ChatCompletionInputMessage[];
61
58
  }
62
59
 
63
60
  export interface WidgetExampleTextInput<TOutput = WidgetExampleOutput> extends WidgetExampleBase<TOutput> {