"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[132],{9454:function(e,s,t){t.d(s,{$Bv:function(){return id},$Sz:function(){return a6},DcG:function(){return ip},ENH:function(){return ih},En$:function(){return il},Hqk:function(){return ia},IFL:function(){return ix},K2m:function(){return im},Kf0:function(){return a9},LdW:function(){return iu},OjJ:function(){return a8},S2d:function(){return ig},U$$:function(){return ic},Zn:function(){return i_},hY6:function(){return iw},hZO:function(){return ie},lbf:function(){return is},o$X:function(){return a7},t78:function(){return ii},tLj:function(){return ir},wiU:function(){return io},z6E:function(){return it}});var n=t(16),a=t(761),i=t(911),o=t(5774),r=t(2414),l=t(1542),c=t(9078);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 F(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 C(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=C):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=F)}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=aV.get(t)??aG.get(t)??aB.get(t)??a$.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 nE(await super._call(e))}}class nE extends T{constructor({iou_scores:e,pred_masks:s}){super(),this.iou_scores=e,this.pred_masks=s}}class nT extends E{}class nO extends nT{}class nB extends nT{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 nD extends E{}class nI extends nD{}class nq extends nD{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 nN extends E{}class nG extends nN{}class nV extends nN{async _call(e){return new iF(await super._call(e))}}class nz extends nN{async _call(e){return new iM(await super._call(e))}}class nj extends nN{async _call(e){return new ib(await super._call(e))}}class n$ extends E{}class nW extends n${}class nR extends n${async _call(e){return new iF(await super._call(e))}}class nQ extends n${async _call(e){return new iM(await super._call(e))}}class nU extends E{}class nX extends nU{}class nK extends nU{async _call(e){return new iF(await super._call(e))}}class nH extends nU{async _call(e){return new iM(await super._call(e))}}class nJ extends nU{async _call(e){return new ib(await super._call(e))}}class nZ extends E{}class nY extends nZ{}class n2 extends nZ{async _call(e){return new iF(await super._call(e))}}class n0 extends nZ{async _call(e){return new iM(await super._call(e))}}class n1 extends nN{}class n4 extends nN{async _call(e){return new iF(await super._call(e))}}class n3 extends nN{async _call(e){return new iM(await super._call(e))}}class n5 extends E{}class n6 extends n5{}class n7 extends n5{async _call(e){return new iF(await super._call(e))}}class n8 extends n5{async _call(e){return new iM(await super._call(e))}}class n9 extends n5{async _call(e){return new ik(await super._call(e))}}class ae extends n5{async _call(e){return new ib(await super._call(e))}}class as extends E{}class at extends as{}class an extends as{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 F(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 aa extends E{main_input_name="spectrogram"}class ai 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 ao extends ai{}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_key_value_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{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 a_ extends ad{}class au extends ad{}class ah 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 am extends ah{}class ap extends ah{}class af extends E{}class ag extends af{}class aw extends af{static async from_pretrained(e,s={}){return s.model_file_name??="text_model",super.from_pretrained(e,s)}}class ax extends af{static async from_pretrained(e,s={}){return s.model_file_name??="audio_model",super.from_pretrained(e,s)}}class ay extends E{}class aM extends ay{async _call(e){return new iL(await super._call(e))}}class ak extends E{}class ab extends ak{}class av extends ak{}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_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class aF extends aS{}class aC extends E{}class aL extends aC{}class aA extends aC{async _call(e){return new iM(await super._call(e))}}class aP{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 aE=new Map([["bert",["BertModel",B]],["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",ag]],["clip",["CLIPModel",sz]],["clipseg",["CLIPSegModel",sJ]],["chinese_clip",["ChineseCLIPModel",sK]],["siglip",["SiglipModel",sR]],["mobilebert",["MobileBertModel",eD]],["squeezebert",["SqueezeBertModel",eQ]],["wav2vec2",["Wav2Vec2Model",nG]],["wav2vec2-bert",["Wav2Vec2BertModel",nY]],["unispeech",["UniSpeechModel",nW]],["unispeech-sat",["UniSpeechSatModel",nX]],["hubert",["HubertModel",n1]],["wavlm",["WavLMModel",n6]],["audio-spectrogram-transformer",["ASTModel",sB]],["vits",["VitsModel",aM]],["detr",["DetrModel",tK]],["table-transformer",["TableTransformerModel",t0]],["vit",["ViTModel",tF]],["fastvit",["FastViTModel",tA]],["mobilevit",["MobileViTModel",tB]],["mobilevitv2",["MobileViTV2Model",tq]],["owlvit",["OwlViTModel",tV]],["owlv2",["Owlv2Model",t$]],["beit",["BeitModel",tQ]],["deit",["DeiTModel",t5]],["convnext",["ConvNextModel",ng]],["convnextv2",["ConvNextV2Model",ny]],["dinov2",["Dinov2Model",nb]],["resnet",["ResNetModel",t8]],["swin",["SwinModel",ns]],["swin2sr",["Swin2SRModel",na]],["donut-swin",["DonutSwinModel",np]],["yolos",["YolosModel",nF]],["dpt",["DPTModel",nr]],["glpn",["GLPNModel",nu]],["hifigan",["SpeechT5HifiGan",aa]],["efficientnet",["EfficientNetModel",aL]]]),aT=new Map([["t5",["T5Model",e1]],["longt5",["LongT5Model",e5]],["mt5",["MT5Model",e8]],["bart",["BartModel",ss]],["mbart",["MBartModel",si]],["marian",["MarianModel",nO]],["whisper",["WhisperModel",sq]],["m2m_100",["M2M100Model",nI]],["blenderbot",["BlenderbotModel",sd]],["blenderbot-small",["BlenderbotSmallModel",sh]]]),aO=new Map([["bloom",["BloomModel",tg]],["gpt2",["GPT2Model",s2]],["gptj",["GPTJModel",s9]],["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",al]],["starcoder2",["Starcoder2Model",a_]],["falcon",["FalconModel",am]]]),aB=new Map([["speecht5",["SpeechT5ForSpeechToText",at]],["whisper",["WhisperForConditionalGeneration",sN]]]),aD=new Map([["speecht5",["SpeechT5ForTextToSpeech",an]]]),aI=new Map([["vits",["VitsModel",aM]]]),aq=new Map([["bert",["BertForSequenceClassification",I]],["roformer",["RoFormerForSequenceClassification",W]],["electra",["ElectraForSequenceClassification",et]],["esm",["EsmForSequenceClassification",eT]],["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]]]),aN=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",R]],["electra",["ElectraForTokenClassification",en]],["esm",["EsmForTokenClassification",eO]],["convbert",["ConvBertForTokenClassification",J]],["camembert",["CamembertForTokenClassification",ec]],["deberta",["DebertaForTokenClassification",ep]],["deberta-v2",["DebertaV2ForTokenClassification",eM]],["mpnet",["MPNetForTokenClassification",e$]],["distilbert",["DistilBertForTokenClassification",eF]],["roberta",["RobertaForTokenClassification",sx]],["xlm",["XLMForTokenClassification",sS]],["xlm-roberta",["XLMRobertaForTokenClassification",sE]]]),aG=new Map([["t5",["T5ForConditionalGeneration",e4]],["longt5",["LongT5ForConditionalGeneration",e6]],["mt5",["MT5ForConditionalGeneration",e9]],["bart",["BartForConditionalGeneration",st]],["mbart",["MBartForConditionalGeneration",so]],["marian",["MarianMTModel",nB]],["m2m_100",["M2M100ForConditionalGeneration",nq]],["blenderbot",["BlenderbotForConditionalGeneration",s_]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",sm]]]),aV=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",ac]],["starcoder2",["Starcoder2ForCausalLM",au]],["falcon",["FalconForCausalLM",ap]],["trocr",["TrOCRForCausalLM",ao]],["stablelm",["StableLmForCausalLM",aF]]]),az=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]]]),aj=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",eC]],["roberta",["RobertaForQuestionAnswering",sy]],["xlm",["XLMForQuestionAnswering",sF]],["xlm-roberta",["XLMRobertaForQuestionAnswering",sT]],["mobilebert",["MobileBertForQuestionAnswering",eN]],["squeezebert",["SqueezeBertForQuestionAnswering",eK]]]),a$=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aW=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",sG]]]),aR=new Map([["vit",["ViTForImageClassification",tC]],["fastvit",["FastViTForImageClassification",tP]],["mobilevit",["MobileViTForImageClassification",tD]],["mobilevitv2",["MobileViTV2ForImageClassification",tN]],["beit",["BeitForImageClassification",tU]],["deit",["DeiTForImageClassification",t6]],["convnext",["ConvNextForImageClassification",nw]],["convnextv2",["ConvNextV2ForImageClassification",nM]],["dinov2",["Dinov2ForImageClassification",nv]],["resnet",["ResNetForImageClassification",t9]],["swin",["SwinForImageClassification",nt]],["segformer",["SegformerForImageClassification",ab]],["efficientnet",["EfficientNetForImageClassification",aA]]]),aQ=new Map([["detr",["DetrForObjectDetection",tH]],["table-transformer",["TableTransformerForObjectDetection",t1]],["yolos",["YolosForObjectDetection",nC]]]),aU=new Map([["owlvit",["OwlViTForObjectDetection",tz]],["owlv2",["Owlv2ForObjectDetection",tW]]]),aX=new Map([["detr",["DetrForSegmentation",tJ]],["clipseg",["CLIPSegForImageSegmentation",sZ]]]),aK=new Map([["segformer",["SegformerForSemanticSegmentation",av]]]),aH=new Map([["sam",["SamModel",nP]]]),aJ=new Map([["wav2vec2",["Wav2Vec2ForCTC",nV]],["wav2vec2-bert",["Wav2Vec2BertForCTC",n2]],["unispeech",["UniSpeechForCTC",nR]],["unispeech-sat",["UniSpeechSatForCTC",nK]],["wavlm",["WavLMForCTC",n7]],["hubert",["HubertForCTC",n4]]]),aZ=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",nz]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",n0]],["unispeech",["UniSpeechForSequenceClassification",nQ]],["unispeech-sat",["UniSpeechSatForSequenceClassification",nH]],["wavlm",["WavLMForSequenceClassification",n8]],["hubert",["HubertForSequenceClassification",n3]],["audio-spectrogram-transformer",["ASTForAudioClassification",sD]]]),aY=new Map([["wavlm",["WavLMForXVector",n9]]]),a2=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",nJ]],["wavlm",["WavLMForAudioFrameClassification",ae]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",nj]]]),a0=new Map([["vitmatte",["VitMatteForImageMatting",tT]]]),a1=new Map([["swin2sr",["Swin2SRForImageSuperResolution",ni]]]),a4=new Map([["dpt",["DPTForDepthEstimation",nl]],["depth_anything",["DepthAnythingForDepthEstimation",nd]],["glpn",["GLPNForDepthEstimation",nh]]]),a3=new Map([["clip",["CLIPVisionModelWithProjection",s$]],["siglip",["SiglipVisionModel",sU]]]),a5=[[aE,h.EncoderOnly],[aT,h.EncoderDecoder],[aO,h.DecoderOnly],[aq,h.EncoderOnly],[aN,h.EncoderOnly],[aG,h.Seq2Seq],[aB,h.Seq2Seq],[aV,h.DecoderOnly],[az,h.EncoderOnly],[aj,h.EncoderOnly],[a$,h.Vision2Seq],[aR,h.EncoderOnly],[aX,h.EncoderOnly],[aK,h.EncoderOnly],[a0,h.EncoderOnly],[a1,h.EncoderOnly],[a4,h.EncoderOnly],[aQ,h.EncoderOnly],[aU,h.EncoderOnly],[aH,h.MaskGeneration],[aJ,h.EncoderOnly],[aZ,h.EncoderOnly],[aD,h.Seq2Seq],[aI,h.EncoderOnly],[aY,h.EncoderOnly],[a2,h.EncoderOnly],[a3,h.EncoderOnly]];for(let[e,s]of a5)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",aw,h.EncoderOnly],["ClapAudioModelWithProjection",ax,h.EncoderOnly]])m.set(e,t),f.set(s,e),p.set(e,s);class a6 extends aP{static MODEL_CLASS_MAPPINGS=a5.map(e=>e[0]);static BASE_IF_FAIL=!0}class a7 extends aP{static MODEL_CLASS_MAPPINGS=[aq]}class a8 extends aP{static MODEL_CLASS_MAPPINGS=[aN]}class a9 extends aP{static MODEL_CLASS_MAPPINGS=[aG]}class ie extends aP{static MODEL_CLASS_MAPPINGS=[aB]}class is extends aP{static MODEL_CLASS_MAPPINGS=[aD]}class it extends aP{static MODEL_CLASS_MAPPINGS=[aI]}class ia extends aP{static MODEL_CLASS_MAPPINGS=[aV]}class ii extends aP{static MODEL_CLASS_MAPPINGS=[az]}class io extends aP{static MODEL_CLASS_MAPPINGS=[aj]}class ir extends aP{static MODEL_CLASS_MAPPINGS=[a$]}class il extends aP{static MODEL_CLASS_MAPPINGS=[aR]}class ic extends aP{static MODEL_CLASS_MAPPINGS=[aX]}class id extends aP{static MODEL_CLASS_MAPPINGS=[aK]}class i_ extends aP{static MODEL_CLASS_MAPPINGS=[aQ]}class iu extends aP{static MODEL_CLASS_MAPPINGS=[aU]}class ih extends aP{static MODEL_CLASS_MAPPINGS=[aJ]}class im extends aP{static MODEL_CLASS_MAPPINGS=[aZ]}class ip extends aP{static MODEL_CLASS_MAPPINGS=[aW]}class ig extends aP{static MODEL_CLASS_MAPPINGS=[a1]}class iw extends aP{static MODEL_CLASS_MAPPINGS=[a4]}class ix extends aP{static MODEL_CLASS_MAPPINGS=[a3]}class iy extends T{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 T{constructor({logits:e}){super(),this.logits=e}}class ik extends T{constructor({logits:e,embeddings:s}){super(),this.logits=e,this.embeddings=s}}class ib extends T{constructor({logits:e}){super(),this.logits=e}}class iv extends T{constructor({logits:e}){super(),this.logits=e}}class iS extends T{constructor({start_logits:e,end_logits:s}){super(),this.start_logits=e,this.end_logits=s}}class iF extends T{constructor({logits:e}){super(),this.logits=e}}class iC extends T{constructor({alphas:e}){super(),this.alphas=e}}class iL extends T{constructor({waveform:e,spectrogram:s}){super(),this.waveform=e,this.spectrogram=s}}}}]);