|
| 1 | +import io |
| 2 | +import functools |
| 3 | + |
| 4 | +__date__ = "2025-03-26" |
| 5 | + |
| 6 | +__data_arch__ = """ |
| 7 | +architecture,task |
| 8 | +ASTModel,feature-extraction |
| 9 | +AlbertModel,feature-extraction |
| 10 | +BeitForImageClassification,image-classification |
| 11 | +BigBirdModel,feature-extraction |
| 12 | +BlenderbotModel,feature-extraction |
| 13 | +BloomModel,feature-extraction |
| 14 | +CLIPModel,zero-shot-image-classification |
| 15 | +CLIPVisionModel,feature-extraction |
| 16 | +CamembertModel,feature-extraction |
| 17 | +CodeGenModel,feature-extraction |
| 18 | +ConvBertModel,feature-extraction |
| 19 | +ConvNextForImageClassification,image-classification |
| 20 | +ConvNextV2Model,image-feature-extraction |
| 21 | +CvtModel,feature-extraction |
| 22 | +DPTModel,image-feature-extraction |
| 23 | +Data2VecAudioModel,feature-extraction |
| 24 | +Data2VecTextModel,feature-extraction |
| 25 | +Data2VecVisionModel,image-feature-extraction |
| 26 | +DebertaModel,feature-extraction |
| 27 | +DebertaV2Model,feature-extraction |
| 28 | +DecisionTransformerModel,reinforcement-learning |
| 29 | +DeiTModel,image-feature-extraction |
| 30 | +DetrModel,image-feature-extraction |
| 31 | +Dinov2Model,image-feature-extraction |
| 32 | +DistilBertModel,feature-extraction |
| 33 | +DonutSwinModel,feature-extraction |
| 34 | +ElectraModel,feature-extraction |
| 35 | +EsmModel,feature-extraction |
| 36 | +GLPNModel,image-feature-extraction |
| 37 | +GPTBigCodeModel,feature-extraction |
| 38 | +GPTJModel,feature-extraction |
| 39 | +GPTNeoModel,feature-extraction |
| 40 | +GPTNeoXForCausalLM,text-generation |
| 41 | +GemmaForCausalLM,text-generation |
| 42 | +GraniteForCausalLM,text-generation |
| 43 | +GroupViTModel,feature-extraction |
| 44 | +HieraForImageClassification,image-classification |
| 45 | +HubertModel,feature-extraction |
| 46 | +IBertModel,feature-extraction |
| 47 | +ImageGPTModel,image-feature-extraction |
| 48 | +LayoutLMModel,feature-extraction |
| 49 | +LayoutLMv3Model,feature-extraction |
| 50 | +LevitModel,image-feature-extraction |
| 51 | +LiltModel,feature-extraction |
| 52 | +LlamaForCausalLM,text-generation |
| 53 | +LongT5Model,feature-extraction |
| 54 | +LongformerModel,feature-extraction |
| 55 | +MCTCTModel,feature-extraction |
| 56 | +MPNetModel,feature-extraction |
| 57 | +MT5Model,feature-extraction |
| 58 | +MarianMTModel,text2text-generation |
| 59 | +MarkupLMModel,feature-extraction |
| 60 | +MaskFormerForInstanceSegmentation,image-segmentation |
| 61 | +MegatronBertModel,feature-extraction |
| 62 | +MgpstrForSceneTextRecognition,feature-extraction |
| 63 | +MistralForCausalLM,text-generation |
| 64 | +MobileBertModel,feature-extraction |
| 65 | +MobileNetV1Model,image-feature-extraction |
| 66 | +MobileNetV2Model,image-feature-extraction |
| 67 | +MobileViTForImageClassification,image-classification |
| 68 | +ModernBertForMaskedLM,fill-mask |
| 69 | +MoonshineForConditionalGeneration,automatic-speech-recognition |
| 70 | +MptForCausalLM,text-generation |
| 71 | +MusicgenForConditionalGeneration,text-to-audio |
| 72 | +NystromformerModel,feature-extraction |
| 73 | +OPTModel,feature-extraction |
| 74 | +Olmo2ForCausalLM,text-generation |
| 75 | +OlmoForCausalLM,text-generation |
| 76 | +OwlViTModel,feature-extraction |
| 77 | +Owlv2Model,feature-extraction |
| 78 | +PatchTSMixerForPrediction,no-pipeline-tag |
| 79 | +PatchTSTForPrediction,no-pipeline-tag |
| 80 | +PegasusModel,feature-extraction |
| 81 | +Phi3ForCausalLM,text-generation |
| 82 | +PhiForCausalLM,text-generation |
| 83 | +Pix2StructForConditionalGeneration,image-to-text |
| 84 | +PoolFormerModel,image-feature-extraction |
| 85 | +PvtForImageClassification,image-classification |
| 86 | +Qwen2ForCausalLM,text-generation |
| 87 | +RTDetrForObjectDetection,object-detection |
| 88 | +RegNetModel,image-feature-extraction |
| 89 | +RemBertModel,feature-extraction |
| 90 | +ResNetForImageClassification,image-classification |
| 91 | +RoFormerModel,feature-extraction |
| 92 | +RobertaModel,feature-extraction |
| 93 | +RtDetrV2ForObjectDetection,object-detection |
| 94 | +SEWDModel,feature-extraction |
| 95 | +SEWModel,feature-extraction |
| 96 | +SamModel,mask-generation |
| 97 | +SegformerModel,image-feature-extraction |
| 98 | +SiglipModel,zero-shot-image-classification |
| 99 | +SiglipVisionModel,image-feature-extraction |
| 100 | +Speech2TextModel,feature-extraction |
| 101 | +SpeechT5ForTextToSpeech,text-to-audio |
| 102 | +SplinterModel,feature-extraction |
| 103 | +SqueezeBertModel,feature-extraction |
| 104 | +Swin2SRModel,image-feature-extraction |
| 105 | +SwinModel,image-feature-extraction |
| 106 | +Swinv2Model,image-feature-extraction |
| 107 | +TableTransformerModel,image-feature-extraction |
| 108 | +UniSpeechForSequenceClassification,audio-classification |
| 109 | +ViTForImageClassification,image-classification |
| 110 | +ViTMAEModel,image-feature-extraction |
| 111 | +ViTMSNForImageClassification,image-classification |
| 112 | +VisionEncoderDecoderModel,document-question-answering |
| 113 | +VitPoseForPoseEstimation,keypoint-detection |
| 114 | +VitsModel,text-to-audio |
| 115 | +Wav2Vec2ConformerForCTC,automatic-speech-recognition |
| 116 | +Wav2Vec2Model,feature-extraction |
| 117 | +WhisperForConditionalGeneration,no-pipeline-tag |
| 118 | +XLMModel,feature-extraction |
| 119 | +XLMRobertaForCausalLM,text-generation |
| 120 | +YolosForObjectDetection,object-detection |
| 121 | +YolosModel,image-feature-extraction |
| 122 | +""" |
| 123 | + |
| 124 | + |
| 125 | +@functools.cache |
| 126 | +def load_architecture_task(): |
| 127 | + """ |
| 128 | + Returns a dictionary mapping architecture to task. |
| 129 | +
|
| 130 | + import pprint |
| 131 | + from onnx_diagnostic.torch_models.hghub.hub_data import load_architecture_task |
| 132 | + pprint.pprint(load_architecture_task()) |
| 133 | + """ |
| 134 | + import pandas |
| 135 | + |
| 136 | + df = pandas.read_csv(io.StringIO(__data_arch__)) |
| 137 | + return dict(zip(list(df["architecture"]), list(df["task"]))) |
0 commit comments