"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[132],{99454:function(e,s,t){t.d(s,{$Bv:function(){return ia},$Sz:function(){return a2},DcG:function(){return ic},ENH:function(){return ir},En$:function(){return is},Hqk:function(){return a7},IFL:function(){return iu},K2m:function(){return il},Kf0:function(){return a4},LdW:function(){return io},OjJ:function(){return a1},S2d:function(){return id},U$$:function(){return it},Zn:function(){return ii},hY6:function(){return i_},hZO:function(){return a3},lbf:function(){return a5},o$X:function(){return a0},t78:function(){return a9},tLj:function(){return ie},wiU:function(){return a8},z6E:function(){return a6}});var n=t(90016),a=t(20761),i=t(40911),o=t(45774),r=t(62414),l=t(71542),c=t(78703);let{InferenceSession:d,Tensor:_,env:u}=l.ONNX,h={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},m=new Map,p=new Map,f=new Map;async function g(e,s,t){let n=`onnx/${s}${t.quantized?"_quantized":""}.onnx`,a=await (0,i.st)(e,n,!0,t);try{return await d.create(a,{executionProviders:l.p})}catch(e){if(1===l.p.length&&"wasm"===l.p[0])throw e;return console.warn(e),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await d.create(a,{executionProviders:["wasm"]})}}async function w(e,s){let t=function(e,s){let t=Object.create(null),n=[];for(let a of e.inputNames){let e=s[a];if(!(e instanceof r.es)){n.push(a);continue}t[a]=u.wasm.proxy?e.clone():e}if(n.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${n.join(", ")}.`);let a=Object.keys(s).length,i=e.inputNames.length;if(a>i){let t=Object.keys(s).filter(s=>!e.inputNames.includes(s));console.warn(`WARNING: Too many inputs were provided (${a} > ${i}). The following inputs will be ignored: "${t.join(", ")}".`)}return t}(e,s);try{let s=await e.run(t);return s=function e(s){for(let t in s)s[t]instanceof _?s[t]=new r.es(s[t]):"object"==typeof s[t]&&e(s[t]);return s}(s)}catch(e){throw console.error(`An error occurred during model execution: "${e}".`),console.error("Inputs given to model:",t),e}}function x(e,s){let t=e.config.pad_token_id??null,n=e.config.eos_token_id??null;(0,a.Wy)(n)&&(n=[n]);let i=-1!==s.indexOf(t),o=null===n||!n.includes(t);if(!i||!o)return(0,r.r6)(s);{let e=BigInt64Array.from(s.data.map(e=>e!=t));return new r.es("int64",e,s.dims)}}function y(e,s,t){if(!e.inputNames.includes("position_ids"))return;let n=new BigInt64Array(s.attention_mask.data.length);for(let e=0;eBigInt(e))),[1,e.length]);if(e.some(s=>s.length!==e[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new r.es("int64",BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}(n),encoder_outputs:s.encoder_outputs,past_key_values:s.prev_model_outputs?.past_key_values};s.attention_mask&&(a.attention_mask=s.attention_mask);let i=await e.forward(a);return s.prev_model_outputs=i,s.encoder_outputs=i.encoder_outputs,i}function S(e,s){e.output_token_ids=[...e.output_token_ids,s]}async function C(e,s){let t=Object.create(null);for(let n of e.session.inputNames)t[n]=s[n];return e.session.inputNames.includes("token_type_ids")&&!t.token_type_ids&&(t.token_type_ids=new r.es("int64",new BigInt64Array(t.input_ids.data.length),t.input_ids.dims)),await w(e.session,t)}async function F(e,s){let{input_ids:t,past_key_values:n,attention_mask:a}=s,i={input_ids:t,attention_mask:a??x(e,t)},o=!!n;e.session.inputNames.includes("use_cache_branch")&&(i.use_cache_branch=M(o)),y(e.session,i,o),e.addPastKeyValues(i,n);let r=await w(e.session,i);return{logits:r.logits,past_key_values:n=e.getPastKeyValues(r,n)}}function L(e,s,t,n,a){let i=[],o=0;for(let t of s){let s,r=t.tolist().map(Number);t.dims=[1,...t.dims],a?(s=a[o]).dims=[1,...s.dims]:s=x(e,t);let l={input:t,model_input_ids:t,attention_mask:s,prev_model_outputs:null,output_token_ids:r,num_output_tokens:n,done:!1,score:0,id:o++};i.push(l)}return i}async function A(e,s){let t=new BigInt64Array(s.output_token_ids.length).fill(1n),n={input_ids:s.model_input_ids,attention_mask:new r.es("int64",t,[1,t.length]),past_key_values:s.prev_model_outputs?.past_key_values},a=await e.forward(n);return s.prev_model_outputs=a,a}function P(e,s){e.output_token_ids=[...e.output_token_ids,s],e.model_input_ids=new r.es("int64",[BigInt(s)],[1,1])}class E extends a.Ag{main_input_name="input_ids";constructor(e,s){super(),this.config=e,this.session=s;let t=f.get(this.constructor),n=m.get(t);this.can_generate=!1,this._runBeam=null,this._getStartBeams=null,this._updateBeam=null,this._forward=null,n===h.DecoderOnly?(this.can_generate=!0,this._runBeam=A,this._getStartBeams=L,this._updateBeam=P,this._forward=F):n===h.Seq2Seq||n===h.Vision2Seq?(this.can_generate=!0,this._runBeam=v,this._getStartBeams=b,this._updateBeam=S,this._forward=k):(h.EncoderDecoder,this._forward=C)}async dispose(){let e=[];for(let s of Object.keys(this)){let t=this[s];t instanceof d&&e.push(t.handler.dispose())}return await Promise.all(e)}static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:o=null,local_files_only:r=!1,revision:l="main",model_file_name:c=null}={}){let d,_={quantized:s,progress_callback:t,config:a,cache_dir:o,local_files_only:r,revision:l,model_file_name:c},u=f.get(this),p=m.get(u);return p===h.DecoderOnly?d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.Seq2Seq||p===h.Vision2Seq?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_),(0,i.yM)(e,"generation_config.json",!1,_)]):p===h.MaskGeneration?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"vision_encoder",_),g(e,"prompt_encoder_mask_decoder",_)]):p===h.EncoderDecoder?d=await Promise.all([n.z.from_pretrained(e,_),g(e,"encoder_model",_),g(e,"decoder_model_merged",_)]):(p!==h.EncoderOnly&&console.warn(`Model type for '${u??a?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`),d=await Promise.all([n.z.from_pretrained(e,_),g(e,_.model_file_name??"model",_)])),new this(...d)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}_get_logits_processor(e,s,t=null){let n=new o.Jm;if(null!==e.repetition_penalty&&1!==e.repetition_penalty&&n.push(new o.Jj(e.repetition_penalty)),null!==e.no_repeat_ngram_size&&e.no_repeat_ngram_size>0&&n.push(new o.jF(e.no_repeat_ngram_size)),null!==e.bad_words_ids&&n.push(new o.AE(e.bad_words_ids,e.eos_token_id)),null!==e.min_length&&null!==e.eos_token_id&&e.min_length>0&&n.push(new o.ez(e.min_length,e.eos_token_id)),null!==e.min_new_tokens&&null!==e.eos_token_id&&e.min_new_tokens>0&&n.push(new o.CJ(s,e.min_new_tokens,e.eos_token_id)),null!==e.forced_bos_token_id&&n.push(new o.C9(e.forced_bos_token_id)),null!==e.forced_eos_token_id&&n.push(new o.dZ(e.max_length,e.forced_eos_token_id)),null!==e.begin_suppress_tokens){let t=s>1||null===e.forced_bos_token_id?s:s+1;null!==e.forced_decoder_ids&&(t+=e.forced_decoder_ids[e.forced_decoder_ids.length-1][0]),n.push(new o.GU(e.begin_suppress_tokens,t))}return null!==e.forced_decoder_ids&&n.push(new o.E(e.forced_decoder_ids)),null!==t&&n.extend(t),n}_get_generation_config(e){let s=new o.aP(this.config);return"generation_config"in this&&Object.assign(s,this.generation_config),null!==e&&Object.assign(s,e),s}async generate(e,s=null,t=null,{inputs_attention_mask:n=null}={}){let i;if(!this.can_generate){let e=f.get(this.constructor),s=`The current model class (${e}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`,t=this.config.model_type,n=aT.get(t)??aB.get(t)??aL.get(t)??aq.get(t);throw n&&(s+=` Please use the following class instead: '${n[0]}'`),Error(s)}if(!(e instanceof r.es)&&!(0,a.fU)(e)&&!Array.isArray(e))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${e.constructor.name}".`);if(this.config.is_encoder_decoder)i=0;else if(0===(i=e instanceof r.es?e.dims.at(-1):e.length))throw Error("Must supply a non-empty array of input token ids.");s=this._get_generation_config(s),t=t??new o.Jm,t=this._get_logits_processor(s,i,t);let l=s.eos_token_id;null===l||Array.isArray(l)||(l=[l]);let c=1,d=1+(s.max_new_tokens??1/0),_=Number.isInteger(s.max_length)&&(s.max_new_tokens??null)===null,u=o.Z4.getSampler(s),h=this.getStartBeams(e,s,c,n);for(;h.some(e=>!e.done)&&c=s.max_length){n.done=!0,e.push(n);continue}let a=await this.runBeam(n);s.output_attentions&&this.addAttentionsToBeam(n,a),s.output_scores;let i=a.logits.slice(null,-1,null);for(let[s,a]of(t(n.output_token_ids,i),u(i))){let t={...n};this.updateBeam(t,s),t.score+=a,l&&l.includes(s)&&(t.done=!0),e.push(t)}}++c,h=(e=this.groupBeams(e).map(e=>e.sort((e,s)=>s.score-e.score).slice(0,s.num_beams))).flat(),s.callback_function&&s.callback_function(h)}let m=this.groupBeams(h),p=e=>m.map(t=>s.num_return_sequences>1?t.slice(0,s.num_return_sequences).map(s=>s[e]):[t[0][e]]).flat(),g=p("output_token_ids");return s.return_dict_in_generate?{sequences:g,decoder_attentions:p("decoder_attentions"),cross_attentions:p("cross_attentions")}:g}addAttentionsToBeam(e,s){if(this.config.is_encoder_decoder){if(!s.cross_attentions||0===s.cross_attentions.length)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.cross_attentions||(e.cross_attentions=[]),e.cross_attentions.push(s.cross_attentions)}if(!s.decoder_attentions||0===s.decoder_attentions.length)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.decoder_attentions||(e.decoder_attentions=[]),e.decoder_attentions.push(s.decoder_attentions)}groupBeams(e){let s=Object.create(null);for(let t of e)void 0===s[t.id]?s[t.id]=[t]:s[t.id].push(t);return Object.values(s)}getPastKeyValues(e,s){let t=Object.create(null);for(let n in e)if(n.startsWith("present")){let a=n.replace("present","past_key_values");s&&n.includes("encoder")?t[a]=s[a]:t[a]=e[n]}return t}getAttentions(e){let s=Object.create(null);for(let t of["cross_attentions","decoder_attentions"]){let n=[];for(let s in e)s.startsWith(t)&&(n[s.split(".").pop()]=e[s]);s[t]=n}return s}addPastKeyValues(e,s){if(s)Object.assign(e,s);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let s=[1,this.num_encoder_heads,0,this.encoder_dim_kv],t=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let n=0;n{let n=Array.from({length:this.config.decoder_layers},(s,t)=>(0,r.d3)(e.map(e=>e[t]),2)),a=(0,r.kn)(s.map(([e,s])=>t?n[e].slice(null,s,null,[0,t]):n[e].slice(null,s)));a=a.transpose(1,0,2,3);let[o,l]=(0,r.f3)(a,-2,0,!0),d=a.clone();for(let e=0;et[s+1]-t[s]),c=(0,a.eG)([1],l).map(e=>!!e),_=[];for(let e=0;ee*s,1);e.input_labels=new r.es("int64",new BigInt64Array(t).fill(1n),s)}return await w(this.prompt_encoder_mask_decoder,{input_points:e.input_points,input_labels:e.input_labels,image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings})}async _call(e){return new nS(await super._call(e))}}class nS extends O{constructor({iou_scores:e,pred_masks:s}){super(),this.iou_scores=e,this.pred_masks=s}}class nC extends E{}class nF extends nC{}class nL extends nC{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nA extends E{}class nP extends nA{}class nE extends nA{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class nO extends E{}class nB extends nO{}class nT extends nO{async _call(e){return new iy(await super._call(e))}}class nD extends nO{async _call(e){return new im(await super._call(e))}}class nI extends nO{async _call(e){return new ig(await super._call(e))}}class nq extends E{}class nN extends nq{}class nG extends nq{async _call(e){return new iy(await super._call(e))}}class nV extends nq{async _call(e){return new im(await super._call(e))}}class nz extends E{}class nj extends nz{}class n$ extends nz{async _call(e){return new iy(await super._call(e))}}class nW extends nz{async _call(e){return new im(await super._call(e))}}class nR extends nz{async _call(e){return new ig(await super._call(e))}}class nQ extends E{}class nU extends nQ{}class nX extends nQ{async _call(e){return new iy(await super._call(e))}}class nK extends nQ{async _call(e){return new im(await super._call(e))}}class nH extends nO{}class nJ extends nO{async _call(e){return new iy(await super._call(e))}}class nZ extends nO{async _call(e){return new im(await super._call(e))}}class nY extends E{}class n2 extends nY{}class n0 extends nY{async _call(e){return new iy(await super._call(e))}}class n1 extends nY{async _call(e){return new im(await super._call(e))}}class n4 extends nY{async _call(e){return new ip(await super._call(e))}}class n3 extends nY{async _call(e){return new ig(await super._call(e))}}class n5 extends E{}class n6 extends n5{}class n7 extends n5{constructor(e,s,t,n){super(e,s),this.decoder_merged_session=t,this.generation_config=n,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(e,s,{threshold:t=.5,minlenratio:n=0,maxlenratio:a=20,vocoder:i=null}={}){let{encoder_outputs:o,encoder_attention_mask:l}=await C(this,{input_ids:e}),c=o.dims[1]/this.config.reduction_factor,d=Math.floor(c*a),_=Math.floor(c*n),u=this.config.num_mel_bins,h=[],m=null,p=null,f=0;for(;;){++f;let e={use_cache_branch:M(!!p),output_sequence:p?p.output_sequence_out:new r.es("float32",new Float32Array(u),[1,1,u]),encoder_attention_mask:l,speaker_embeddings:s,encoder_hidden_states:o};this.addPastKeyValues(e,m),p=await w(this.decoder_merged_session,e),m=this.getPastKeyValues(p,m);let{prob:n,spectrum:a}=p;if(h.push(a),f>=_&&(Array.from(n.data).filter(e=>e>=t).length>0||f>=d))break}let g=(0,r.d3)(h),{waveform:x}=await w(i.session,{spectrogram:g});return{spectrogram:g,waveform:x}}}class n9 extends E{main_input_name="spectrogram"}class n8 extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class ae extends n8{}class as extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class at extends as{}class an extends as{}class aa extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class ai extends aa{}class ao extends aa{}class ar extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class al extends ar{}class ac extends ar{}class ad extends E{}class a_ extends ad{}class au extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class ah extends ad{static async from_pretrained(e,s={}){return s.model_file_name??="audio_model",super.from_pretrained(e,s)}}class am extends E{}class ap extends am{async _call(e){return new ik(await super._call(e))}}class af extends E{}class ag extends af{}class aw extends af{}class ax extends E{constructor(e,s,t){super(e,s),this.generation_config=t,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class ay extends ax{}class aM extends E{}class ak extends aM{}class ab extends aM{async _call(e){return new im(await super._call(e))}}class av{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{quantized:s=!0,progress_callback:t=null,config:a=null,cache_dir:i=null,local_files_only:o=!1,revision:r="main",model_file_name:l=null}={}){let c={quantized:s,progress_callback:t,config:a,cache_dir:i,local_files_only:o,revision:r,model_file_name:l};if(a=await n.z.from_pretrained(e,c),c.config||(c.config=a),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let s of this.MODEL_CLASS_MAPPINGS){let t=s.get(a.model_type);if(t)return await t[1].from_pretrained(e,c)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${a.model_type}", attempting to construct from base class.`),await E.from_pretrained(e,c);throw Error(`Unsupported model type: ${a.model_type}`)}}let aS=new Map([["bert",["BertModel",T]],["nomic_bert",["NomicBertModel",V]],["roformer",["RoFormerModel",j]],["electra",["ElectraModel",ee]],["esm",["EsmModel",eP]],["convbert",["ConvBertModel",X]],["camembert",["CamembertModel",eo]],["deberta",["DebertaModel",eu]],["deberta-v2",["DebertaV2Model",ew]],["mpnet",["MPNetModel",eV]],["albert",["AlbertModel",eJ]],["distilbert",["DistilBertModel",ev]],["roberta",["RobertaModel",sf]],["xlm",["XLMModel",sk]],["xlm-roberta",["XLMRobertaModel",sL]],["clap",["ClapModel",a_]],["clip",["CLIPModel",sz]],["clipseg",["CLIPSegModel",sJ]],["chinese_clip",["ChineseCLIPModel",sK]],["siglip",["SiglipModel",sR]],["mobilebert",["MobileBertModel",eD]],["squeezebert",["SqueezeBertModel",eQ]],["wav2vec2",["Wav2Vec2Model",nB]],["wav2vec2-bert",["Wav2Vec2BertModel",nU]],["unispeech",["UniSpeechModel",nN]],["unispeech-sat",["UniSpeechSatModel",nj]],["hubert",["HubertModel",nH]],["wavlm",["WavLMModel",n2]],["audio-spectrogram-transformer",["ASTModel",sT]],["vits",["VitsModel",ap]],["detr",["DetrModel",t$]],["table-transformer",["TableTransformerModel",tK]],["vit",["ViTModel",tC]],["mobilevit",["MobileViTModel",tE]],["owlvit",["OwlViTModel",tT]],["owlv2",["Owlv2Model",tq]],["beit",["BeitModel",tV]],["deit",["DeiTModel",tY]],["convnext",["ConvNextModel",n_]],["convnextv2",["ConvNextV2Model",nm]],["dinov2",["Dinov2Model",ng]],["resnet",["ResNetModel",t1]],["swin",["SwinModel",t5]],["swin2sr",["Swin2SRModel",t9]],["donut-swin",["DonutSwinModel",nc]],["yolos",["YolosModel",ny]],["dpt",["DPTModel",ns]],["glpn",["GLPNModel",no]],["hifigan",["SpeechT5HifiGan",n9]],["efficientnet",["EfficientNetModel",ak]]]),aC=new Map([["t5",["T5Model",e1]],["longt5",["LongT5Model",e5]],["mt5",["MT5Model",e9]],["bart",["BartModel",ss]],["mbart",["MBartModel",si]],["marian",["MarianModel",nF]],["whisper",["WhisperModel",sq]],["m2m_100",["M2M100Model",nP]],["blenderbot",["BlenderbotModel",sd]],["blenderbot-small",["BlenderbotSmallModel",sh]]]),aF=new Map([["bloom",["BloomModel",tg]],["gpt2",["GPT2Model",s2]],["gptj",["GPTJModel",s8]],["gpt_bigcode",["GPTBigCodeModel",tt]],["gpt_neo",["GPTNeoModel",s4]],["gpt_neox",["GPTNeoXModel",s6]],["codegen",["CodeGenModel",ti]],["llama",["LlamaModel",tl]],["qwen2",["Qwen2Model",t_]],["phi",["PhiModel",tm]],["mpt",["MptModel",ty]],["opt",["OPTModel",tb]],["mistral",["MistralModel",at]],["starcoder2",["Starcoder2Model",ai]],["falcon",["FalconModel",al]]]),aL=new Map([["speecht5",["SpeechT5ForSpeechToText",n6]],["whisper",["WhisperForConditionalGeneration",sN]]]),aA=new Map([["speecht5",["SpeechT5ForTextToSpeech",n7]]]),aP=new Map([["vits",["VitsModel",ap]]]),aE=new Map([["bert",["BertForSequenceClassification",I]],["roformer",["RoFormerForSequenceClassification",W]],["electra",["ElectraForSequenceClassification",et]],["esm",["EsmForSequenceClassification",eO]],["convbert",["ConvBertForSequenceClassification",H]],["camembert",["CamembertForSequenceClassification",el]],["deberta",["DebertaForSequenceClassification",em]],["deberta-v2",["DebertaV2ForSequenceClassification",ey]],["mpnet",["MPNetForSequenceClassification",ej]],["albert",["AlbertForSequenceClassification",eZ]],["distilbert",["DistilBertForSequenceClassification",eS]],["roberta",["RobertaForSequenceClassification",sw]],["xlm",["XLMForSequenceClassification",sv]],["xlm-roberta",["XLMRobertaForSequenceClassification",sP]],["bart",["BartForSequenceClassification",sn]],["mbart",["MBartForSequenceClassification",sr]],["mobilebert",["MobileBertForSequenceClassification",eq]],["squeezebert",["SqueezeBertForSequenceClassification",eX]]]),aO=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",R]],["electra",["ElectraForTokenClassification",en]],["esm",["EsmForTokenClassification",eB]],["convbert",["ConvBertForTokenClassification",J]],["camembert",["CamembertForTokenClassification",ec]],["deberta",["DebertaForTokenClassification",ep]],["deberta-v2",["DebertaV2ForTokenClassification",eM]],["mpnet",["MPNetForTokenClassification",e$]],["distilbert",["DistilBertForTokenClassification",eC]],["roberta",["RobertaForTokenClassification",sx]],["xlm",["XLMForTokenClassification",sS]],["xlm-roberta",["XLMRobertaForTokenClassification",sE]]]),aB=new Map([["t5",["T5ForConditionalGeneration",e4]],["longt5",["LongT5ForConditionalGeneration",e6]],["mt5",["MT5ForConditionalGeneration",e8]],["bart",["BartForConditionalGeneration",st]],["mbart",["MBartForConditionalGeneration",so]],["marian",["MarianMTModel",nL]],["m2m_100",["M2M100ForConditionalGeneration",nE]],["blenderbot",["BlenderbotForConditionalGeneration",s_]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",sm]]]),aT=new Map([["bloom",["BloomForCausalLM",tw]],["gpt2",["GPT2LMHeadModel",s0]],["gptj",["GPTJForCausalLM",te]],["gpt_bigcode",["GPTBigCodeForCausalLM",tn]],["gpt_neo",["GPTNeoForCausalLM",s3]],["gpt_neox",["GPTNeoXForCausalLM",s7]],["codegen",["CodeGenForCausalLM",to]],["llama",["LlamaForCausalLM",tc]],["qwen2",["Qwen2ForCausalLM",tu]],["phi",["PhiForCausalLM",tp]],["mpt",["MptForCausalLM",tM]],["opt",["OPTForCausalLM",tv]],["mbart",["MBartForCausalLM",sl]],["mistral",["MistralForCausalLM",an]],["starcoder2",["Starcoder2ForCausalLM",ao]],["falcon",["FalconForCausalLM",ac]],["trocr",["TrOCRForCausalLM",ae]],["stablelm",["StableLmForCausalLM",ay]]]),aD=new Map([["bert",["BertForMaskedLM",D]],["roformer",["RoFormerForMaskedLM",$]],["electra",["ElectraForMaskedLM",es]],["esm",["EsmForMaskedLM",eE]],["convbert",["ConvBertForMaskedLM",K]],["camembert",["CamembertForMaskedLM",er]],["deberta",["DebertaForMaskedLM",eh]],["deberta-v2",["DebertaV2ForMaskedLM",ex]],["mpnet",["MPNetForMaskedLM",ez]],["albert",["AlbertForMaskedLM",e2]],["distilbert",["DistilBertForMaskedLM",eL]],["roberta",["RobertaForMaskedLM",sg]],["xlm",["XLMWithLMHeadModel",sb]],["xlm-roberta",["XLMRobertaForMaskedLM",sA]],["mobilebert",["MobileBertForMaskedLM",eI]],["squeezebert",["SqueezeBertForMaskedLM",eU]]]),aI=new Map([["bert",["BertForQuestionAnswering",N]],["roformer",["RoFormerForQuestionAnswering",Q]],["electra",["ElectraForQuestionAnswering",ea]],["convbert",["ConvBertForQuestionAnswering",Z]],["camembert",["CamembertForQuestionAnswering",ed]],["deberta",["DebertaForQuestionAnswering",ef]],["deberta-v2",["DebertaV2ForQuestionAnswering",ek]],["mpnet",["MPNetForQuestionAnswering",eW]],["albert",["AlbertForQuestionAnswering",eY]],["distilbert",["DistilBertForQuestionAnswering",eF]],["roberta",["RobertaForQuestionAnswering",sy]],["xlm",["XLMForQuestionAnswering",sC]],["xlm-roberta",["XLMRobertaForQuestionAnswering",sO]],["mobilebert",["MobileBertForQuestionAnswering",eN]],["squeezebert",["SqueezeBertForQuestionAnswering",eK]]]),aq=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aN=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aG=new Map([["vit",["ViTForImageClassification",tF]],["mobilevit",["MobileViTForImageClassification",tO]],["beit",["BeitForImageClassification",tz]],["deit",["DeiTForImageClassification",t2]],["convnext",["ConvNextForImageClassification",nu]],["convnextv2",["ConvNextV2ForImageClassification",np]],["dinov2",["Dinov2ForImageClassification",nw]],["resnet",["ResNetForImageClassification",t4]],["swin",["SwinForImageClassification",t6]],["segformer",["SegformerForImageClassification",ag]],["efficientnet",["EfficientNetForImageClassification",ab]]]),aV=new Map([["detr",["DetrForObjectDetection",tW]],["table-transformer",["TableTransformerForObjectDetection",tH]],["yolos",["YolosForObjectDetection",nM]]]),az=new Map([["owlvit",["OwlViTForObjectDetection",tD]],["owlv2",["Owlv2ForObjectDetection",tN]]]),aj=new Map([["detr",["DetrForSegmentation",tR]],["clipseg",["CLIPSegForImageSegmentation",sZ]]]),a$=new Map([["segformer",["SegformerForSemanticSegmentation",aw]]]),aW=new Map([["sam",["SamModel",nv]]]),aR=new Map([["wav2vec2",["Wav2Vec2ForCTC",nT]],["wav2vec2-bert",["Wav2Vec2BertForCTC",nX]],["unispeech",["UniSpeechForCTC",nG]],["unispeech-sat",["UniSpeechSatForCTC",n$]],["wavlm",["WavLMForCTC",n0]],["hubert",["HubertForCTC",nJ]]]),aQ=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",nD]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",nK]],["unispeech",["UniSpeechForSequenceClassification",nV]],["unispeech-sat",["UniSpeechSatForSequenceClassification",nW]],["wavlm",["WavLMForSequenceClassification",n1]],["hubert",["HubertForSequenceClassification",nZ]],["audio-spectrogram-transformer",["ASTForAudioClassification",sD]]]),aU=new Map([["wavlm",["WavLMForXVector",n4]]]),aX=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",nR]],["wavlm",["WavLMForAudioFrameClassification",n3]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",nI]]]),aK=new Map([["vitmatte",["VitMatteForImageMatting",tA]]]),aH=new Map([["swin2sr",["Swin2SRForImageSuperResolution",t8]]]),aJ=new Map([["dpt",["DPTForDepthEstimation",nt]],["depth_anything",["DepthAnythingForDepthEstimation",na]],["glpn",["GLPNForDepthEstimation",nr]]]),aZ=new Map([["clip",["CLIPVisionModelWithProjection",s$]],["siglip",["SiglipVisionModel",sU]]]),aY=[[aS,h.EncoderOnly],[aC,h.EncoderDecoder],[aF,h.DecoderOnly],[aE,h.EncoderOnly],[aO,h.EncoderOnly],[aB,h.Seq2Seq],[aL,h.Seq2Seq],[aT,h.DecoderOnly],[aD,h.EncoderOnly],[aI,h.EncoderOnly],[aq,h.Vision2Seq],[aG,h.EncoderOnly],[aj,h.EncoderOnly],[a$,h.EncoderOnly],[aK,h.EncoderOnly],[aH,h.EncoderOnly],[aJ,h.EncoderOnly],[aV,h.EncoderOnly],[az,h.EncoderOnly],[aW,h.MaskGeneration],[aR,h.EncoderOnly],[aQ,h.EncoderOnly],[aA,h.Seq2Seq],[aP,h.EncoderOnly],[aU,h.EncoderOnly],[aX,h.EncoderOnly],[aZ,h.EncoderOnly]];for(let[e,s]of aY)for(let[t,n]of e.values())m.set(t,s),f.set(n,t),p.set(t,n);for(let[e,s,t]of[["CLIPTextModelWithProjection",sj,h.EncoderOnly],["SiglipTextModel",sQ,h.EncoderOnly],["ClapTextModelWithProjection",au,h.EncoderOnly],["ClapAudioModelWithProjection",ah,h.EncoderOnly]])m.set(e,t),f.set(s,e),p.set(e,s);class a2 extends av{static MODEL_CLASS_MAPPINGS=aY.map(e=>e[0]);static BASE_IF_FAIL=!0}class a0 extends av{static MODEL_CLASS_MAPPINGS=[aE]}class a1 extends av{static MODEL_CLASS_MAPPINGS=[aO]}class a4 extends av{static MODEL_CLASS_MAPPINGS=[aB]}class a3 extends av{static MODEL_CLASS_MAPPINGS=[aL]}class a5 extends av{static MODEL_CLASS_MAPPINGS=[aA]}class a6 extends av{static MODEL_CLASS_MAPPINGS=[aP]}class a7 extends av{static MODEL_CLASS_MAPPINGS=[aT]}class a9 extends av{static MODEL_CLASS_MAPPINGS=[aD]}class a8 extends av{static MODEL_CLASS_MAPPINGS=[aI]}class ie extends av{static MODEL_CLASS_MAPPINGS=[aq]}class is extends av{static MODEL_CLASS_MAPPINGS=[aG]}class it extends av{static MODEL_CLASS_MAPPINGS=[aj]}class ia extends av{static MODEL_CLASS_MAPPINGS=[a$]}class ii extends av{static MODEL_CLASS_MAPPINGS=[aV]}class io extends av{static MODEL_CLASS_MAPPINGS=[az]}class ir extends av{static MODEL_CLASS_MAPPINGS=[aR]}class il extends av{static MODEL_CLASS_MAPPINGS=[aQ]}class ic extends av{static MODEL_CLASS_MAPPINGS=[aN]}class id extends av{static MODEL_CLASS_MAPPINGS=[aH]}class i_ extends av{static MODEL_CLASS_MAPPINGS=[aJ]}class iu extends av{static MODEL_CLASS_MAPPINGS=[aZ]}class ih extends O{constructor({logits:e,past_key_values:s,encoder_outputs:t,decoder_attentions:n=null,cross_attentions:a=null}){super(),this.logits=e,this.past_key_values=s,this.encoder_outputs=t,this.decoder_attentions=n,this.cross_attentions=a}}class im extends O{constructor({logits:e}){super(),this.logits=e}}class ip extends O{constructor({logits:e,embeddings:s}){super(),this.logits=e,this.embeddings=s}}class ig extends O{constructor({logits:e}){super(),this.logits=e}}class iw extends O{constructor({logits:e}){super(),this.logits=e}}class ix extends O{constructor({start_logits:e,end_logits:s}){super(),this.start_logits=e,this.end_logits=s}}class iy extends O{constructor({logits:e}){super(),this.logits=e}}class iM extends O{constructor({alphas:e}){super(),this.alphas=e}}class ik extends O{constructor({waveform:e,spectrogram:s}){super(),this.waveform=e,this.spectrogram=s}}}}]);