diff --git "a/assets/worker-DzyjP8xi.js" "b/assets/worker-DzyjP8xi.js" --- "a/assets/worker-DzyjP8xi.js" +++ "b/assets/worker-DzyjP8xi.js" @@ -2784,4 +2784,4 @@ ${K}${ne}`+te.repeat(M)+`${K}`,W}function g(M,b,A,K){return`${b}${K}`+A.repeat(M `}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),te=M.map(U=>R(U,A,K,Y,y.length)));const ne=this.tokenizer(te,b);return{...await this.image_processor(y,b),...ne}}}_e(g,"tokenizer_class",j.AutoTokenizer),_e(g,"image_processor_class",D.AutoImageProcessor),_e(g,"uses_processor_config",!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(Le,I,r)=>{r.r(I),r.d(I,{Phi3VImageProcessor:()=>y});var f=r("./src/base/image_processors_utils.js"),D=r("./src/utils/tensor.js");const j=336,Y=[2,3],{ceil:R,floor:g,sqrt:v}=Math;class y extends f.ImageProcessor{constructor(b){super({...b,do_normalize:!0,do_pad:!0,pad_size:"custom",do_convert_rgb:!0,do_resize:!0}),this._num_crops=b.num_crops}calc_num_image_tokens_from_image_size(b,A){const{num_img_tokens:K}=this.config;return g((g(A/j)*g(b/j)+1)*K+1+(g(A/j)+1)*v(K))}get_resize_output_image_size(b,A){const K=this._num_crops,[te,ne]=b.size;let W=te/ne,U=1;for(;U*Math.ceil(U/W)<=K;)U+=1;U-=1;const X=Math.floor(U*336),$=Math.floor(X/W);return[X,$]}pad_image(b,A,K,te={}){const[ne,W]=A,U=j*R(ne/j),X=j*R(W/j),$=[1,1,1].map((S,w)=>(S-this.image_mean[w])/this.image_std[w]);return super.pad_image(b,A,{width:X,height:U},{center:!0,constant_values:$,...te})}async _call(b,{num_crops:A=null}={}){if(this._num_crops=A??(A=this.config.num_crops),A<4||v(A)%1!==0)throw new Error("num_crops must be a square number >= 4");Array.isArray(b)||(b=[b]);const K=b.length,te=await Promise.all(b.map(x=>this.preprocess(x))),ne=te.map(x=>x.original_size),W=te.map(x=>x.reshaped_input_size),U=[];for(const{pixel_values:x}of te){x.unsqueeze_(0);const[O,ae]=x.dims.slice(-2),oe=await(0,D.interpolate_4d)(x,{size:[j,j],mode:"bicubic"});if(A>0){const ve=[],we=v(A),re=g(ae/we),xe=g(O/we);for(let ke=0;kex.map(O=>j*R(O/j))),S=new D.Tensor("int64",$.flat(),[K,2]),w=$.map(([x,O])=>this.calc_num_image_tokens_from_image_size(O,x));return{pixel_values:X,original_sizes:ne,reshaped_input_sizes:W,image_sizes:S,num_img_tokens:w}}}},"./src/models/phi3_v/processing_phi3_v.js":(Le,I,r)=>{r.r(I),r.d(I,{Phi3VProcessor:()=>g});var f=r("./src/base/processing_utils.js"),D=r("./src/models/auto/image_processing_auto.js"),j=r("./src/tokenizers.js");r("./src/utils/image.js");const Y="<|image|>",R=/<\|image_\d+\|>/g;class g extends f.Processor{async _call(y,M=null,{padding:b=!0,truncation:A=!0,num_crops:K=null}={}){Array.isArray(y)||(y=[y]);let te,ne;if(M){ne=await this.image_processor(M,{num_crops:K});const{num_img_tokens:W}=ne,U=y.map(($,S)=>$.split(R).join(Y.repeat(W[S])));te=this.tokenizer(U,{padding:b,truncation:A});const X=this.tokenizer.model.convert_tokens_to_ids([Y])[0];te.input_ids.map_($=>$==X?-$:$)}else te=this.tokenizer(y);return{...te,...ne}}}_e(g,"image_processor_class",D.AutoImageProcessor),_e(g,"tokenizer_class",j.AutoTokenizer)},"./src/models/processors.js":(Le,I,r)=>{r.r(I),r.d(I,{Florence2Processor:()=>f.Florence2Processor,GroundingDinoProcessor:()=>D.GroundingDinoProcessor,Idefics3Processor:()=>j.Idefics3Processor,JinaCLIPProcessor:()=>R.JinaCLIPProcessor,MgpstrProcessor:()=>g.MgpstrProcessor,MoonshineProcessor:()=>v.MoonshineProcessor,OwlViTProcessor:()=>y.OwlViTProcessor,PaliGemmaProcessor:()=>b.PaliGemmaProcessor,Phi3VProcessor:()=>M.Phi3VProcessor,PyAnnoteProcessor:()=>A.PyAnnoteProcessor,Qwen2VLProcessor:()=>K.Qwen2VLProcessor,SamProcessor:()=>te.SamProcessor,SpeechT5Processor:()=>ne.SpeechT5Processor,VLChatProcessor:()=>Y.VLChatProcessor,Wav2Vec2ProcessorWithLM:()=>W.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>U.WhisperProcessor});var f=r("./src/models/florence2/processing_florence2.js"),D=r("./src/models/grounding_dino/processing_grounding_dino.js"),j=r("./src/models/idefics3/processing_idefics3.js"),Y=r("./src/models/janus/processing_janus.js"),R=r("./src/models/jina_clip/processing_jina_clip.js"),g=r("./src/models/mgp_str/processing_mgp_str.js"),v=r("./src/models/moonshine/processing_moonshine.js"),y=r("./src/models/owlvit/processing_owlvit.js"),M=r("./src/models/phi3_v/processing_phi3_v.js"),b=r("./src/models/paligemma/processing_paligemma.js"),A=r("./src/models/pyannote/processing_pyannote.js"),K=r("./src/models/qwen2_vl/processing_qwen2_vl.js"),te=r("./src/models/sam/processing_sam.js"),ne=r("./src/models/speecht5/processing_speecht5.js"),W=r("./src/models/wav2vec2/processing_wav2vec2.js"),U=r("./src/models/whisper/processing_whisper.js")},"./src/models/pvt/image_processing_pvt.js":(Le,I,r)=>{r.r(I),r.d(I,{PvtImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(Le,I,r)=>{r.r(I),r.d(I,{PyAnnoteFeatureExtractor:()=>Y});var f=r("./src/base/feature_extraction_utils.js"),D=r("./src/utils/tensor.js"),j=r("./src/utils/maths.js");class Y extends f.FeatureExtractor{async _call(g){(0,f.validate_audio_inputs)(g,"PyAnnoteFeatureExtractor"),g instanceof Float64Array&&(g=new Float32Array(g));const v=[1,1,g.length];return{input_values:new D.Tensor("float32",g,v)}}samples_to_frames(g){return(g-this.config.offset)/this.config.step}post_process_speaker_diarization(g,v){const y=v/this.samples_to_frames(v)/this.config.sampling_rate,M=[];for(const b of g.tolist()){const A=[];let K=-1;for(let te=0;te({id:te,start:ne*y,end:W*y,confidence:U/(W-ne)})))}return M}}},"./src/models/pyannote/processing_pyannote.js":(Le,I,r)=>{r.r(I),r.d(I,{PyAnnoteProcessor:()=>j});var f=r("./src/base/processing_utils.js"),D=r("./src/models/pyannote/feature_extraction_pyannote.js");class j extends f.Processor{async _call(R){return await this.feature_extractor(R)}post_process_speaker_diarization(...R){return this.feature_extractor.post_process_speaker_diarization(...R)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}_e(j,"feature_extractor_class",D.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(Le,I,r)=>{r.r(I),r.d(I,{Qwen2VLImageProcessor:()=>j});var f=r("./src/base/image_processors_utils.js"),D=r("./src/utils/tensor.js");class j extends f.ImageProcessor{async _call(R,...g){const{pixel_values:v,original_sizes:y,reshaped_input_sizes:M}=await super._call(R,...g);let b=v;const{temporal_patch_size:A,merge_size:K,patch_size:te}=this.config;b.dims[0]===1&&(b=(0,D.cat)(Array.from({length:A},()=>b),0));const ne=b.dims[0]/A,W=b.dims[1],U=Math.floor(b.dims[2]/te),X=Math.floor(b.dims[3]/te),$=b.view(ne,A,W,Math.floor(U/K),K,te,Math.floor(X/K),K,te).permute(0,3,6,4,7,2,1,5,8).view(ne*U*X,W*A*te*te),S=new D.Tensor("int64",[ne,U,X],[1,3]);return{pixel_values:$,image_grid_thw:S,original_sizes:y,reshaped_input_sizes:M}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(Le,I,r)=>{r.r(I),r.d(I,{Qwen2VLProcessor:()=>Y});var f=r("./src/base/processing_utils.js"),D=r("./src/models/auto/image_processing_auto.js"),j=r("./src/tokenizers.js");r("./src/utils/image.js");class Y extends f.Processor{async _call(g,v=null,...y){Array.isArray(g)||(g=[g]);let M,b;if(v&&(M=await this.image_processor(v),b=M.image_grid_thw),b){let K=this.image_processor.config.merge_size**2,te=0;const ne=b.tolist();g=g.map(W=>{for(;W.includes("<|image_pad|>");){const U=Number(ne[te++].reduce((X,$)=>X*$,1n));W=W.replace("<|image_pad|>","<|placeholder|>".repeat(Math.floor(U/K)))}return W.replaceAll("<|placeholder|>","<|image_pad|>")})}return{...this.tokenizer(g),...M}}}_e(Y,"image_processor_class",D.AutoImageProcessor),_e(Y,"tokenizer_class",j.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(Le,I,r)=>{r.r(I),r.d(I,{RTDetrImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{post_process_object_detection(...Y){return(0,f.post_process_object_detection)(...Y)}}},"./src/models/sam/image_processing_sam.js":(Le,I,r)=>{r.r(I),r.d(I,{SamImageProcessor:()=>Y});var f=r("./src/base/image_processors_utils.js"),D=r("./src/utils/core.js"),j=r("./src/utils/tensor.js");class Y extends f.ImageProcessor{reshape_input_points(g,v,y,M=!1){g=structuredClone(g);let b=(0,D.calculateDimensions)(g);if(b.length===3)M||(b=[1,...b]),g=[g];else if(b.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let A=0;AM!==v.dims[b]))throw Error(`The first ${y.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new j.Tensor("int64",g.flat(1/0).map(BigInt),y)}async _call(g,{input_points:v=null,input_labels:y=null,input_boxes:M=null}={}){const b=await super._call(g);if(v&&(b.input_points=this.reshape_input_points(v,b.original_sizes,b.reshaped_input_sizes)),y){if(!b.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");b.input_labels=this.add_input_labels(y,b.input_points)}return M&&(b.input_boxes=this.reshape_input_points(M,b.original_sizes,b.reshaped_input_sizes,!0)),b}async post_process_masks(g,v,y,{mask_threshold:M=0,binarize:b=!0,pad_size:A=null}={}){const K=[];A=A??this.pad_size;const te=[A.height,A.width];for(let ne=0;neM&&(S[w]=1);X=new j.Tensor("bool",S,X.dims)}K.push(X)}return K}generate_crop_boxes(g,v,{crop_n_layers:y=0,overlap_ratio:M=.3413333333333333,points_per_crop:b=32,crop_n_points_downscale_factor:A=1}={}){}}},"./src/models/sam/processing_sam.js":(Le,I,r)=>{r.r(I),r.d(I,{SamProcessor:()=>j});var f=r("./src/base/processing_utils.js"),D=r("./src/models/auto/image_processing_auto.js");class j extends f.Processor{async _call(...R){return await this.image_processor(...R)}post_process_masks(...R){return this.image_processor.post_process_masks(...R)}reshape_input_points(...R){return this.image_processor.reshape_input_points(...R)}}_e(j,"image_processor_class",D.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(Le,I,r)=>{r.r(I),r.d(I,{SeamlessM4TFeatureExtractor:()=>Y});var f=r("./src/base/feature_extraction_utils.js"),D=r("./src/utils/tensor.js"),j=r("./src/utils/audio.js");class Y extends f.FeatureExtractor{constructor(g){super(g);const v=this.config.sampling_rate,y=(0,j.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(v/2),v,null,"kaldi",!0);for(let M=0;My*32768),(0,j.spectrogram)(g,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:v,transpose:!0})}async _call(g,{padding:v=!0,pad_to_multiple_of:y=2,do_normalize_per_mel_bins:M=!0,return_attention_mask:b=!0}={}){(0,f.validate_audio_inputs)(g,"SeamlessM4TFeatureExtractor");let A=await this._extract_fbank_features(g,this.config.max_length);if(M){const[S,w]=A.dims,x=A.data;for(let O=0;O0){const ae=new Float32Array(w*(S+O));ae.set(x),ae.fill(this.config.padding_value,x.length);const oe=S+O;A=new D.Tensor(A.type,ae,[oe,w]),b&&(K=new D.Tensor("int64",new BigInt64Array(oe),[1,oe]),K.data.fill(1n,0,S))}}const[te,ne]=A.dims,W=this.config.stride;if(te%W!==0)throw new Error(`The number of frames (${te}) must be a multiple of the stride (${W}).`);const X=A.view(1,Math.floor(te/W),ne*W),$={input_features:X};if(b){const S=X.dims[1],w=new BigInt64Array(S);if(K){const x=K.data;for(let O=1,ae=0;O{r.r(I),r.d(I,{SegformerFeatureExtractor:()=>j,SegformerImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{post_process_semantic_segmentation(...R){return(0,f.post_process_semantic_segmentation)(...R)}}class j extends D{}},"./src/models/siglip/image_processing_siglip.js":(Le,I,r)=>{r.r(I),r.d(I,{SiglipImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(Le,I,r)=>{r.r(I),r.d(I,{SpeechT5FeatureExtractor:()=>D});var f=r("./src/base/feature_extraction_utils.js");class D extends f.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(Le,I,r)=>{r.r(I),r.d(I,{SpeechT5Processor:()=>Y});var f=r("./src/base/processing_utils.js"),D=r("./src/tokenizers.js"),j=r("./src/models/auto/feature_extraction_auto.js");class Y extends f.Processor{async _call(g){return await this.feature_extractor(g)}}_e(Y,"tokenizer_class",D.AutoTokenizer),_e(Y,"feature_extractor_class",j.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(Le,I,r)=>{r.r(I),r.d(I,{Swin2SRImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{pad_image(Y,R,g,v={}){const[y,M,b]=R;return super.pad_image(Y,R,{width:M+(g-M%g)%g,height:y+(g-y%g)%g},{mode:"symmetric",center:!1,constant_values:-1,...v})}}},"./src/models/vit/image_processing_vit.js":(Le,I,r)=>{r.r(I),r.d(I,{ViTFeatureExtractor:()=>j,ViTImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{}class j extends D{}},"./src/models/vitmatte/image_processing_vitmatte.js":(Le,I,r)=>{r.r(I),r.d(I,{VitMatteImageProcessor:()=>j});var f=r("./src/base/image_processors_utils.js"),D=r("./src/utils/tensor.js");class j extends f.ImageProcessor{async _call(R,g){Array.isArray(R)||(R=[R]),Array.isArray(g)||(g=[g]);const v=await Promise.all(R.map(b=>this.preprocess(b))),y=await Promise.all(g.map(b=>this.preprocess(b,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,D.stack)(v.map((b,A)=>(0,D.cat)([b.pixel_values,y[A].pixel_values],0)),0),original_sizes:v.map(b=>b.original_size),reshaped_input_sizes:v.map(b=>b.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(Le,I,r)=>{r.r(I),r.d(I,{VitPoseImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{post_process_pose_estimation(Y,R,{threshold:g=null}={}){const v=Y.tolist(),[y,M,b,A]=Y.dims,K=[];for(let te=0;te{r.r(I),r.d(I,{Wav2Vec2FeatureExtractor:()=>j});var f=r("./src/base/feature_extraction_utils.js"),D=r("./src/utils/tensor.js");class j extends f.FeatureExtractor{_zero_mean_unit_var_norm(R){const v=R.reduce((M,b)=>M+b,0)/R.length,y=R.reduce((M,b)=>M+(b-v)**2,0)/R.length;return R.map(M=>(M-v)/Math.sqrt(y+1e-7))}async _call(R){(0,f.validate_audio_inputs)(R,"Wav2Vec2FeatureExtractor"),R instanceof Float64Array&&(R=new Float32Array(R));let g=R;this.config.do_normalize&&(g=this._zero_mean_unit_var_norm(g));const v=[1,g.length];return{input_values:new D.Tensor("float32",g,v),attention_mask:new D.Tensor("int64",new BigInt64Array(g.length).fill(1n),v)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(Le,I,r)=>{r.r(I),r.d(I,{Wav2Vec2ProcessorWithLM:()=>j});var f=r("./src/base/processing_utils.js"),D=r("./src/models/auto/feature_extraction_auto.js");class j extends f.Processor{async _call(R){return await this.feature_extractor(R)}}_e(j,"feature_extractor_class",D.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(Le,I,r)=>{r.r(I),r.d(I,{WeSpeakerFeatureExtractor:()=>j});var f=r("./src/base/feature_extraction_utils.js");r("./src/utils/tensor.js");var D=r("./src/utils/audio.js");class j extends f.FeatureExtractor{constructor(R){super(R);const g=this.config.sampling_rate,v=(0,D.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(g/2),g,null,"kaldi",!0);for(let y=0;yg*32768),(0,D.spectrogram)(R,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(R){(0,f.validate_audio_inputs)(R,"WeSpeakerFeatureExtractor");const g=(await this._extract_fbank_features(R)).unsqueeze_(0);if(this.config.fbank_centering_span===null){const v=g.mean(1).data,y=g.data,[M,b,A]=g.dims;for(let K=0;K{r.r(I),r.d(I,{WHISPER_LANGUAGE_MAPPING:()=>D,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>j,whisper_language_to_code:()=>Y});const f=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],D=new Map(f),j=new Map([...f.map(([R,g])=>[g,R]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function Y(R){R=R.toLowerCase();let g=j.get(R);if(g===void 0)if(D.has(R))g=R;else{const y=R.length===2?D.keys():D.values();throw new Error(`Language "${R}" is not supported. Must be one of: ${JSON.stringify(y)}`)}return g}},"./src/models/whisper/feature_extraction_whisper.js":(Le,I,r)=>{r.r(I),r.d(I,{WhisperFeatureExtractor:()=>Y});var f=r("./src/base/feature_extraction_utils.js");r("./src/utils/tensor.js");var D=r("./src/utils/audio.js"),j=r("./src/utils/maths.js");class Y extends f.FeatureExtractor{constructor(g){var v;super(g),(v=this.config).mel_filters??(v.mel_filters=(0,D.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney")),this.window=(0,D.window_function)(this.config.n_fft,"hann")}async _extract_fbank_features(g){const v=await(0,D.spectrogram)(g,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:this.config.nb_max_frames}),y=v.data,M=(0,j.max)(y)[0];for(let b=0;bthis.config.n_samples?(console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),v=g.slice(0,this.config.n_samples)):(v=new Float32Array(this.config.n_samples),v.set(g)),{input_features:(await this._extract_fbank_features(v)).unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(Le,I,r)=>{r.r(I),r.d(I,{WhisperGenerationConfig:()=>D});var f=r("./src/generation/configuration_utils.js");class D extends f.GenerationConfig{constructor(){super(...arguments);_e(this,"return_timestamps",null);_e(this,"return_token_timestamps",null);_e(this,"num_frames",null);_e(this,"alignment_heads",null);_e(this,"task",null);_e(this,"language",null);_e(this,"no_timestamps_token_id",null);_e(this,"prompt_ids",null);_e(this,"is_multilingual",null);_e(this,"lang_to_id",null);_e(this,"task_to_id",null);_e(this,"max_initial_timestamp_index",1)}}},"./src/models/whisper/processing_whisper.js":(Le,I,r)=>{r.r(I),r.d(I,{WhisperProcessor:()=>Y});var f=r("./src/models/auto/feature_extraction_auto.js"),D=r("./src/tokenizers.js"),j=r("./src/base/processing_utils.js");class Y extends j.Processor{async _call(g){return await this.feature_extractor(g)}}_e(Y,"tokenizer_class",D.AutoTokenizer),_e(Y,"feature_extractor_class",f.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(Le,I,r)=>{r.r(I),r.d(I,{YolosFeatureExtractor:()=>j,YolosImageProcessor:()=>D});var f=r("./src/base/image_processors_utils.js");class D extends f.ImageProcessor{post_process_object_detection(...R){return(0,f.post_process_object_detection)(...R)}}class j extends D{}},"./src/ops/registry.js":(Le,I,r)=>{r.r(I),r.d(I,{TensorOpRegistry:()=>Y});var f=r("./src/backends/onnx.js"),D=r("./src/utils/tensor.js");const j=async(R,g,v)=>{const y=await(0,f.createInferenceSession)(new Uint8Array(R),g);return async M=>{const b=(0,f.isONNXProxy)(),A=Object.fromEntries(Object.entries(M).map(([te,ne])=>[te,(b?ne.clone():ne).ort_tensor])),K=await y.run(A);return Array.isArray(v)?v.map(te=>new D.Tensor(K[te])):new D.Tensor(K[v])}};class Y{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||(this._nearest_interpolate_4d=j([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,"y")),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||(this._bilinear_interpolate_4d=j([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||(this._bicubic_interpolate_4d=j([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||(this._matmul=j([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,"c")),this._matmul}static get stft(){return this._stft||(this._stft=j([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,"o")),this._stft}static get rfft(){return this._rfft||(this._rfft=j([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,"y")),this._rfft}static get top_k(){return this._top_k||(this._top_k=j([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,["v","i"])),this._top_k}static get slice(){return this._slice||(this._slice=j([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,"y")),this._slice}}_e(Y,"session_options",{})},"./src/pipelines.js":(Le,I,r)=>{r.r(I),r.d(I,{AudioClassificationPipeline:()=>we,AutomaticSpeechRecognitionPipeline:()=>xe,DepthEstimationPipeline:()=>Ce,DocumentQuestionAnsweringPipeline:()=>ye,FeatureExtractionPipeline:()=>oe,FillMaskPipeline:()=>X,ImageClassificationPipeline:()=>ke,ImageFeatureExtractionPipeline:()=>ve,ImageSegmentationPipeline:()=>Ie,ImageToImagePipeline:()=>de,ImageToTextPipeline:()=>ce,ObjectDetectionPipeline:()=>tt,Pipeline:()=>te,QuestionAnsweringPipeline:()=>U,SummarizationPipeline:()=>S,Text2TextGenerationPipeline:()=>$,TextClassificationPipeline:()=>ne,TextGenerationPipeline:()=>O,TextToAudioPipeline:()=>J,TokenClassificationPipeline:()=>W,TranslationPipeline:()=>w,ZeroShotAudioClassificationPipeline:()=>re,ZeroShotClassificationPipeline:()=>ae,ZeroShotImageClassificationPipeline:()=>Ee,ZeroShotObjectDetectionPipeline:()=>Ge,pipeline:()=>se});var f=r("./src/tokenizers.js"),D=r("./src/models.js"),j=r("./src/models/auto/processing_auto.js");r("./src/base/processing_utils.js");var Y=r("./src/utils/generic.js"),R=r("./src/utils/core.js"),g=r("./src/utils/maths.js"),v=r("./src/utils/audio.js"),y=r("./src/utils/tensor.js"),M=r("./src/utils/image.js");async function b(je){return Array.isArray(je)||(je=[je]),await Promise.all(je.map(le=>M.RawImage.read(le)))}async function A(je,le){return Array.isArray(je)||(je=[je]),await Promise.all(je.map(Te=>typeof Te=="string"||Te instanceof URL?(0,v.read_audio)(Te,le):Te instanceof Float64Array?new Float32Array(Te):Te))}function K(je,le){le&&(je=je.map(Re=>Re|0));const[Te,Ue,Ve,Ne]=je;return{xmin:Te,ymin:Ue,xmax:Ve,ymax:Ne}}class te extends Y.Callable{constructor({task:le,model:Te,tokenizer:Ue=null,processor:Ve=null}){super(),this.task=le,this.model=Te,this.tokenizer=Ue,this.processor=Ve}async dispose(){await this.model.dispose()}}class ne extends te{constructor(le){super(le)}async _call(le,{top_k:Te=1}={}){const Ue=this.tokenizer(le,{padding:!0,truncation:!0}),Ve=await this.model(Ue),Ne=this.model.config.problem_type==="multi_label_classification"?dt=>dt.sigmoid():dt=>new y.Tensor("float32",(0,g.softmax)(dt.data),dt.dims),Re=this.model.config.id2label,st=[];for(const dt of Ve.logits){const ct=Ne(dt),lt=await(0,y.topk)(ct,Te),ht=lt[0].tolist(),ie=lt[1].tolist().map((H,me)=>({label:Re?Re[H]:`LABEL_${H}`,score:ht[me]}));Te===1?st.push(...ie):st.push(ie)}return Array.isArray(le)||Te===1?st:st[0]}}class W extends te{constructor(le){super(le)}async _call(le,{ignore_labels:Te=["O"]}={}){const Ue=Array.isArray(le),Ve=this.tokenizer(Ue?le:[le],{padding:!0,truncation:!0}),Re=(await this.model(Ve)).logits,st=this.model.config.id2label,dt=[];for(let ct=0;ctut==this.tokenizer.sep_token_id);dt[ht].map((ut,mt)=>ut==1&&(mt===0||mt>ie&&ct.findIndex(vt=>vt==L[mt])===-1));const H=Ne[ht].tolist(),me=Re[ht].tolist();for(let ut=1;utmt==L[ut])!==-1)&&(H[ut]=-1/0,me[ut]=-1/0);const $e=(0,g.softmax)(H).map((ut,mt)=>[ut,mt]),We=(0,g.softmax)(me).map((ut,mt)=>[ut,mt]);$e[0][0]=0,We[0][0]=0;const Je=(0,R.product)($e,We).filter(ut=>ut[0][1]<=ut[1][1]).map(ut=>[ut[0][1],ut[1][1],ut[0][0]*ut[1][0]]).sort((ut,mt)=>mt[2]-ut[2]);for(let ut=0;utH==this.tokenizer.mask_token_id);if(ct===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);const lt=Ve[st][ct],ht=await(0,y.topk)(new y.Tensor("float32",(0,g.softmax)(lt.data),lt.dims),Te),L=ht[0].tolist(),ie=ht[1].tolist();Ne.push(ie.map((H,me)=>{const $e=dt.slice();return $e[ct]=H,{score:L[me],token:Number(H),token_str:this.tokenizer.decode([H]),sequence:this.tokenizer.decode($e,{skip_special_tokens:!0})}}))}return Array.isArray(le)?Ne:Ne[0]}}class $ extends te{constructor(Te){super(Te);_e(this,"_key","generated_text")}async _call(Te,Ue={}){Array.isArray(Te)||(Te=[Te]),this.model.config.prefix&&(Te=Te.map(ct=>this.model.config.prefix+ct));const Ve=this.model.config.task_specific_params;Ve&&Ve[this.task]&&Ve[this.task].prefix&&(Te=Te.map(ct=>Ve[this.task].prefix+ct));const Ne=this.tokenizer,Re={padding:!0,truncation:!0};let st;this instanceof w&&"_build_translation_inputs"in Ne?st=Ne._build_translation_inputs(Te,Re,Ue):st=Ne(Te,Re);const dt=await this.model.generate({...st,...Ue});return Ne.batch_decode(dt,{skip_special_tokens:!0}).map(ct=>({[this._key]:ct}))}}class S extends ${constructor(Te){super(Te);_e(this,"_key","summary_text")}}class w extends ${constructor(Te){super(Te);_e(this,"_key","translation_text")}}function x(je){return Array.isArray(je)&&je.every(le=>"role"in le&&"content"in le)}class O extends te{constructor(le){super(le)}async _call(le,Te={}){let Ue=!1,Ve=!1,Ne;if(typeof le=="string")Ne=le=[le];else if(Array.isArray(le)&&le.every(ie=>typeof ie=="string"))Ue=!0,Ne=le;else{if(x(le))le=[le];else if(Array.isArray(le)&&le.every(x))Ue=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");Ve=!0,Ne=le.map(ie=>this.tokenizer.apply_chat_template(ie,{tokenize:!1,add_generation_prompt:!0}))}const Re=Te.add_special_tokens??!1,st=Ve?!1:Te.return_full_text??!0;this.tokenizer.padding_side="left";const dt=this.tokenizer(Ne,{add_special_tokens:Re,padding:!0,truncation:!0}),ct=await this.model.generate({...dt,...Te}),lt=this.tokenizer.batch_decode(ct,{skip_special_tokens:!0});let ht;!st&&dt.input_ids.dims.at(-1)>0&&(ht=this.tokenizer.batch_decode(dt.input_ids,{skip_special_tokens:!0}).map(ie=>ie.length));const L=Array.from({length:le.length},ie=>[]);for(let ie=0;ie[Te.toLowerCase(),Ue])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(le,Te,{hypothesis_template:Ue="This example is {}.",multi_label:Ve=!1}={}){const Ne=Array.isArray(le);Ne||(le=[le]),Array.isArray(Te)||(Te=[Te]);const Re=Te.map(ct=>Ue.replace("{}",ct)),st=Ve||Te.length===1,dt=[];for(const ct of le){const lt=[];for(const ie of Re){const H=this.tokenizer(ct,{text_pair:ie,padding:!0,truncation:!0}),me=await this.model(H);st?lt.push([me.logits.data[this.contradiction_id],me.logits.data[this.entailment_id]]):lt.push(me.logits.data[this.entailment_id])}const L=(st?lt.map(ie=>(0,g.softmax)(ie)[1]):(0,g.softmax)(lt)).map((ie,H)=>[ie,H]).sort((ie,H)=>H[0]-ie[0]);dt.push({sequence:ct,labels:L.map(ie=>Te[ie[1]]),scores:L.map(ie=>ie[0])})}return Ne?dt:dt[0]}}class oe extends te{constructor(le){super(le)}async _call(le,{pooling:Te="none",normalize:Ue=!1,quantize:Ve=!1,precision:Ne="binary"}={}){const Re=this.tokenizer(le,{padding:!0,truncation:!0}),st=await this.model(Re);let dt=st.last_hidden_state??st.logits??st.token_embeddings;if(Te!=="none")if(Te==="mean")dt=(0,y.mean_pooling)(dt,Re.attention_mask);else if(Te==="cls")dt=dt.slice(null,0);else throw Error(`Pooling method '${Te}' not supported.`);return Ue&&(dt=dt.normalize(2,-1)),Ve&&(dt=(0,y.quantize_embeddings)(dt,Ne)),dt}}class ve extends te{constructor(le){super(le)}async _call(le,{pool:Te=null}={}){const Ue=await b(le),{pixel_values:Ve}=await this.processor(Ue),Ne=await this.model({pixel_values:Ve});let Re;if(Te){if(!("pooler_output"in Ne))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");Re=Ne.pooler_output}else Re=Ne.last_hidden_state??Ne.logits??Ne.image_embeds;return Re}}class we extends te{constructor(le){super(le)}async _call(le,{top_k:Te=5}={}){const Ue=this.processor.feature_extractor.config.sampling_rate,Ve=await A(le,Ue),Ne=this.model.config.id2label,Re=[];for(const st of Ve){const dt=await this.processor(st),lt=(await this.model(dt)).logits[0],ht=await(0,y.topk)(new y.Tensor("float32",(0,g.softmax)(lt.data),lt.dims),Te),L=ht[0].tolist(),H=ht[1].tolist().map((me,$e)=>({label:Ne?Ne[me]:`LABEL_${me}`,score:L[$e]}));Re.push(H)}return Array.isArray(le)?Re:Re[0]}}class re extends te{constructor(le){super(le)}async _call(le,Te,{hypothesis_template:Ue="This is a sound of {}."}={}){const Ve=!Array.isArray(le);Ve&&(le=[le]);const Ne=Te.map(lt=>Ue.replace("{}",lt)),Re=this.tokenizer(Ne,{padding:!0,truncation:!0}),st=this.processor.feature_extractor.config.sampling_rate,dt=await A(le,st),ct=[];for(const lt of dt){const ht=await this.processor(lt),L=await this.model({...Re,...ht}),ie=(0,g.softmax)(L.logits_per_audio.data);ct.push([...ie].map((H,me)=>({score:H,label:Te[me]})))}return Ve?ct[0]:ct}}class xe extends te{constructor(le){super(le)}async _call(le,Te={}){switch(this.model.config.model_type){case"whisper":return this._call_whisper(le,Te);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(le,Te);case"moonshine":return this._call_moonshine(le,Te);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(le,Te){Te.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),Te.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const Ue=!Array.isArray(le);Ue&&(le=[le]);const Ve=this.processor.feature_extractor.config.sampling_rate,Ne=await A(le,Ve),Re=[];for(const st of Ne){const dt=await this.processor(st),lt=(await this.model(dt)).logits[0],ht=[];for(const ie of lt)ht.push((0,g.max)(ie.data)[1]);const L=this.tokenizer.decode(ht);Re.push({text:L})}return Ue?Re[0]:Re}async _call_whisper(le,Te){const Ue=Te.return_timestamps??!1,Ve=Te.chunk_length_s??0,Ne=Te.force_full_sequences??!1;let Re=Te.stride_length_s??null;const st={...Te};Ue==="word"&&(st.return_token_timestamps=!0,st.return_timestamps=!1);const dt=!Array.isArray(le);dt&&(le=[le]);const ct=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,lt=this.processor.feature_extractor.config.hop_length,ht=this.processor.feature_extractor.config.sampling_rate,L=await A(le,ht),ie=[];for(const H of L){let me=[];if(Ve>0){if(Re===null)Re=Ve/6;else if(Ve<=Re)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Je=ht*Ve,ut=ht*Re,mt=Je-2*ut;let vt=0;for(;;){const kt=vt+Je,It=H.subarray(vt,kt),os=await this.processor(It),ws=vt===0,ks=kt>=H.length;if(me.push({stride:[It.length,ws?0:ut,ks?0:ut],input_features:os.input_features,is_last:ks}),ks)break;vt+=mt}}else me=[{stride:[H.length,0,0],input_features:(await this.processor(H)).input_features,is_last:!0}];for(const Je of me){st.num_frames=Math.floor(Je.stride[0]/lt);const ut=await this.model.generate({inputs:Je.input_features,...st});Ue==="word"?(Je.tokens=ut.sequences.tolist()[0],Je.token_timestamps=ut.token_timestamps.tolist()[0].map(mt=>(0,g.round)(mt,2))):Je.tokens=ut[0].tolist(),Je.stride=Je.stride.map(mt=>mt/ht)}const[$e,We]=this.tokenizer._decode_asr(me,{time_precision:ct,return_timestamps:Ue,force_full_sequences:Ne});ie.push({text:$e,...We})}return dt?ie[0]:ie}async _call_moonshine(le,Te){const Ue=!Array.isArray(le);Ue&&(le=[le]);const Ve=this.processor.feature_extractor.config.sampling_rate,Ne=await A(le,Ve),Re=[];for(const st of Ne){const dt=await this.processor(st),ct=Math.floor(st.length/Ve)*6,lt=await this.model.generate({max_new_tokens:ct,...Te,...dt}),ht=this.processor.batch_decode(lt,{skip_special_tokens:!0})[0];Re.push({text:ht})}return Ue?Re[0]:Re}}class ce extends te{constructor(le){super(le)}async _call(le,Te={}){const Ue=Array.isArray(le),Ve=await b(le),{pixel_values:Ne}=await this.processor(Ve),Re=[];for(const st of Ne){st.dims=[1,...st.dims];const dt=await this.model.generate({inputs:st,...Te}),ct=this.tokenizer.batch_decode(dt,{skip_special_tokens:!0}).map(lt=>({generated_text:lt.trim()}));Re.push(ct)}return Ue?Re:Re[0]}}class ke extends te{constructor(le){super(le)}async _call(le,{top_k:Te=5}={}){const Ue=await b(le),{pixel_values:Ve}=await this.processor(Ue),Ne=await this.model({pixel_values:Ve}),Re=this.model.config.id2label,st=[];for(const dt of Ne.logits){const ct=await(0,y.topk)(new y.Tensor("float32",(0,g.softmax)(dt.data),dt.dims),Te),lt=ct[0].tolist(),L=ct[1].tolist().map((ie,H)=>({label:Re?Re[ie]:`LABEL_${ie}`,score:lt[H]}));st.push(L)}return Array.isArray(le)?st:st[0]}}class Ie extends te{constructor(le){super(le),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(le,{threshold:Te=.5,mask_threshold:Ue=.5,overlap_mask_area_threshold:Ve=.8,label_ids_to_fuse:Ne=null,target_sizes:Re=null,subtask:st=null}={}){if(Array.isArray(le)&&le.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const ct=await b(le),lt=ct.map(We=>[We.height,We.width]),{pixel_values:ht,pixel_mask:L}=await this.processor(ct),ie=await this.model({pixel_values:ht,pixel_mask:L});let H=null;if(st!==null)H=this.subtasks_mapping[st];else for(let[We,Je]of Object.entries(this.subtasks_mapping))if(Je in this.processor.image_processor){H=this.processor.image_processor[Je].bind(this.processor.image_processor),st=We;break}const me=this.model.config.id2label,$e=[];if(st==="panoptic"||st==="instance"){const We=H(ie,Te,Ue,Ve,Ne,Re??lt)[0],Je=We.segmentation;for(const ut of We.segments_info){const mt=new Uint8ClampedArray(Je.data.length);for(let kt=0;ktUe.replace("{}",L)),st=this.tokenizer(Re,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:dt}=await this.processor(Ne),ct=await this.model({...st,pixel_values:dt}),lt=this.model.config.model_type==="siglip"?L=>L.sigmoid().data:L=>(0,g.softmax)(L.data),ht=[];for(const L of ct.logits_per_image){const H=[...lt(L)].map((me,$e)=>({score:me,label:Te[$e]}));H.sort((me,$e)=>$e.score-me.score),ht.push(H)}return Ve?ht:ht[0]}}class tt extends te{constructor(le){super(le)}async _call(le,{threshold:Te=.9,percentage:Ue=!1}={}){const Ve=Array.isArray(le);if(Ve&&le.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const Ne=await b(le),Re=Ue?null:Ne.map(ie=>[ie.height,ie.width]),{pixel_values:st,pixel_mask:dt}=await this.processor(Ne),ct=await this.model({pixel_values:st,pixel_mask:dt}),lt=this.processor.image_processor.post_process_object_detection(ct,Te,Re),ht=this.model.config.id2label,L=lt.map(ie=>ie.boxes.map((H,me)=>({score:ie.scores[me],label:ht[ie.classes[me]],box:K(H,!Ue)})));return Ve?L:L[0]}}class Ge extends te{constructor(le){super(le)}async _call(le,Te,{threshold:Ue=.1,top_k:Ve=null,percentage:Ne=!1}={}){const Re=Array.isArray(le),st=await b(le),dt=this.tokenizer(Te,{padding:!0,truncation:!0}),ct=await this.processor(st),lt=[];for(let ht=0;ht({score:We.scores[ut],label:We.labels[ut],box:K(Je,!Ne)}))}else{const We=this.processor.image_processor.post_process_object_detection(me,Ue,ie,!0)[0];$e=We.boxes.map((Je,ut)=>({score:We.scores[ut],label:Te[We.classes[ut]],box:K(Je,!Ne)}))}$e.sort((We,Je)=>Je.score-We.score),Ve!==null&&($e=$e.slice(0,Ve)),lt.push($e)}return Re?lt:lt[0]}}class ye extends te{constructor(le){super(le)}async _call(le,Te,Ue={}){const Ve=(await b(le))[0],{pixel_values:Ne}=await this.processor(Ve),Re=`${Te}`,st=this.tokenizer(Re,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,dt=await this.model.generate({inputs:Ne,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:st,...Ue}),lt=this.tokenizer.batch_decode(dt)[0].match(/(.*?)<\/s_answer>/);let ht=null;return lt&<.length>=2&&(ht=lt[1].trim()),[{answer:ht}]}}class J extends te{constructor(Te){super(Te);_e(this,"DEFAULT_VOCODER_ID","Xenova/speecht5_hifigan");this.vocoder=Te.vocoder??null}async _call(Te,{speaker_embeddings:Ue=null}={}){return this.processor?this._call_text_to_spectrogram(Te,{speaker_embeddings:Ue}):this._call_text_to_waveform(Te)}async _call_text_to_waveform(Te){const Ue=this.tokenizer(Te,{padding:!0,truncation:!0}),{waveform:Ve}=await this.model(Ue),Ne=this.model.config.sampling_rate;return new v.RawAudio(Ve.data,Ne)}async _call_text_to_spectrogram(Te,{speaker_embeddings:Ue}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await D.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:"fp32"})),(typeof Ue=="string"||Ue instanceof URL)&&(Ue=new Float32Array(await(await fetch(Ue)).arrayBuffer())),Ue instanceof Float32Array)Ue=new y.Tensor("float32",Ue,[1,Ue.length]);else if(!(Ue instanceof y.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:Ve}=this.tokenizer(Te,{padding:!0,truncation:!0}),{waveform:Ne}=await this.model.generate_speech(Ve,Ue,{vocoder:this.vocoder}),Re=this.processor.feature_extractor.config.sampling_rate;return new v.RawAudio(Ne.data,Re)}}class de extends te{constructor(le){super(le)}async _call(le){const Te=await b(le),Ue=await this.processor(Te),Ve=await this.model(Ue),Ne=[];for(const Re of Ve.reconstruction){const st=Re.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");Ne.push(M.RawImage.fromTensor(st))}return Ne.length>1?Ne:Ne[0]}}class Ce extends te{constructor(le){super(le)}async _call(le){const Te=await b(le),Ue=await this.processor(Te),{predicted_depth:Ve}=await this.model(Ue),Ne=[];for(let Re=0;Re1?Ne:Ne[0]}}const Be=Object.freeze({"text-classification":{tokenizer:f.AutoTokenizer,pipeline:ne,model:D.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:f.AutoTokenizer,pipeline:W,model:D.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:f.AutoTokenizer,pipeline:U,model:D.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:f.AutoTokenizer,pipeline:X,model:D.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:f.AutoTokenizer,pipeline:S,model:D.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:f.AutoTokenizer,pipeline:w,model:D.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:f.AutoTokenizer,pipeline:$,model:D.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:f.AutoTokenizer,pipeline:O,model:D.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:f.AutoTokenizer,pipeline:ae,model:D.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:we,model:D.AutoModelForAudioClassification,processor:j.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:f.AutoTokenizer,pipeline:re,model:D.AutoModel,processor:j.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:f.AutoTokenizer,pipeline:xe,model:[D.AutoModelForSpeechSeq2Seq,D.AutoModelForCTC],processor:j.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:f.AutoTokenizer,pipeline:J,model:[D.AutoModelForTextToWaveform,D.AutoModelForTextToSpectrogram],processor:[j.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:f.AutoTokenizer,pipeline:ce,model:D.AutoModelForVision2Seq,processor:j.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:ke,model:D.AutoModelForImageClassification,processor:j.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:Ie,model:[D.AutoModelForImageSegmentation,D.AutoModelForSemanticSegmentation,D.AutoModelForUniversalSegmentation],processor:j.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"zero-shot-image-classification":{tokenizer:f.AutoTokenizer,pipeline:Ee,model:D.AutoModel,processor:j.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:tt,model:D.AutoModelForObjectDetection,processor:j.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:f.AutoTokenizer,pipeline:Ge,model:D.AutoModelForZeroShotObjectDetection,processor:j.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:f.AutoTokenizer,pipeline:ye,model:D.AutoModelForDocumentQuestionAnswering,processor:j.AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:de,model:D.AutoModelForImageToImage,processor:j.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:Ce,model:D.AutoModelForDepthEstimation,processor:j.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:f.AutoTokenizer,pipeline:oe,model:D.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:j.AutoProcessor,pipeline:ve,model:[D.AutoModelForImageFeatureExtraction,D.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),Ze=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function se(je,le=null,{progress_callback:Te=null,config:Ue=null,cache_dir:Ve=null,local_files_only:Ne=!1,revision:Re="main",device:st=null,dtype:dt=null,model_file_name:ct=null,session_options:lt={}}={}){je=Ze[je]??je;const ht=Be[je.split("_",1)[0]];if(!ht)throw Error(`Unsupported pipeline: ${je}. Must be one of [${Object.keys(Be)}]`);le||(le=ht.default.model,console.log(`No model specified. Using default model: "${le}".`));const L={progress_callback:Te,config:Ue,cache_dir:Ve,local_files_only:Ne,revision:Re,device:st,dtype:dt,model_file_name:ct,session_options:lt},ie=new Map([["tokenizer",ht.tokenizer],["model",ht.model],["processor",ht.processor]]),H=await Ke(ie,le,L);H.task=je,(0,R.dispatchCallback)(Te,{status:"ready",task:je,model:le});const me=ht.pipeline;return new me(H)}async function Ke(je,le,Te){const Ue=Object.create(null),Ve=[];for(const[Ne,Re]of je.entries()){if(!Re)continue;let st;Array.isArray(Re)?st=new Promise(async(dt,ct)=>{var ht,L;let lt;for(const ie of Re){if(ie===null){dt(null);return}try{dt(await ie.from_pretrained(le,Te));return}catch(H){if((ht=H.message)!=null&&ht.includes("Unsupported model type"))lt=H;else if((L=H.message)!=null&&L.includes("Could not locate file"))lt=H;else{ct(H);return}}}ct(lt)}):st=Re.from_pretrained(le,Te),Ue[Ne]=st,Ve.push(st)}await Promise.all(Ve);for(const[Ne,Re]of Object.entries(Ue))Ue[Ne]=await Re;return Ue}},"./src/tokenizers.js":(Le,I,r)=>{r.r(I),r.d(I,{AlbertTokenizer:()=>$r,AutoTokenizer:()=>as,BartTokenizer:()=>Or,BertTokenizer:()=>Jr,BlenderbotSmallTokenizer:()=>Dn,BlenderbotTokenizer:()=>Fn,BloomTokenizer:()=>Pr,CLIPTokenizer:()=>yn,CamembertTokenizer:()=>ot,CodeGenTokenizer:()=>wn,CodeLlamaTokenizer:()=>Ur,CohereTokenizer:()=>vn,ConvBertTokenizer:()=>Rr,DebertaTokenizer:()=>pr,DebertaV2Tokenizer:()=>en,DistilBertTokenizer:()=>ir,ElectraTokenizer:()=>Dt,EsmTokenizer:()=>Vr,FalconTokenizer:()=>In,GPT2Tokenizer:()=>jr,GPTNeoXTokenizer:()=>An,GemmaTokenizer:()=>ro,Grok1Tokenizer:()=>Wr,HerbertTokenizer:()=>Ar,LlamaTokenizer:()=>fn,M2M100Tokenizer:()=>gn,MBart50Tokenizer:()=>ar,MBartTokenizer:()=>Ms,MPNetTokenizer:()=>$n,MarianTokenizer:()=>zt,MgpstrTokenizer:()=>Bn,MobileBertTokenizer:()=>Ir,NllbTokenizer:()=>lr,NougatTokenizer:()=>Gr,PreTrainedTokenizer:()=>Nt,Qwen2Tokenizer:()=>On,RoFormerTokenizer:()=>Nr,RobertaTokenizer:()=>As,SiglipTokenizer:()=>Mn,SpeechT5Tokenizer:()=>Ln,SqueezeBertTokenizer:()=>Zr,T5Tokenizer:()=>Vs,TokenizerModel:()=>ve,VitsTokenizer:()=>zn,Wav2Vec2CTCTokenizer:()=>bn,WhisperTokenizer:()=>tn,XLMRobertaTokenizer:()=>so,XLMTokenizer:()=>Tt,is_chinese_char:()=>X});var f=r("./src/utils/generic.js"),D=r("./src/utils/core.js"),j=r("./src/utils/hub.js"),Y=r("./src/utils/maths.js"),R=r("./src/utils/tensor.js"),g=r("./src/utils/data-structures.js"),v=r("./node_modules/@huggingface/jinja/dist/index.js"),y=r("./src/models/whisper/common_whisper.js");async function M(Pe,C){const q=await Promise.all([(0,j.getModelJSON)(Pe,"tokenizer.json",!0,C),(0,j.getModelJSON)(Pe,"tokenizer_config.json",!0,C)]);return C.legacy!==null&&(q[1].legacy=C.legacy),q}function b(Pe,C){const q=[];let ue=0;for(const be of Pe.matchAll(C)){const Se=be[0];ue0&&q.push(Se),ue=be.index+Se.length}return ue=19968&&Pe<=40959||Pe>=13312&&Pe<=19903||Pe>=131072&&Pe<=173791||Pe>=173824&&Pe<=177983||Pe>=177984&&Pe<=178207||Pe>=178208&&Pe<=183983||Pe>=63744&&Pe<=64255||Pe>=194560&&Pe<=195103}function $(Pe,C,q){const ue=[];let be=0;for(;bethis.tokens_to_ids.get(q)??this.unk_token_id)}convert_ids_to_tokens(C){return C.map(q=>this.vocab[q]??this.unk_token)}}class we extends ve{constructor(C){super(C),this.tokens_to_ids=K(C.vocab),this.unk_token_id=this.tokens_to_ids.get(C.unk_token),this.unk_token=C.unk_token,this.max_input_chars_per_word=C.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[q,ue]of this.tokens_to_ids)this.vocab[ue]=q}encode(C){const q=[];for(const ue of C){const be=[...ue];if(be.length>this.max_input_chars_per_word){q.push(this.unk_token);continue}let Se=!1,Qe=0;const pt=[];for(;Qe0&&(xt=this.config.continuing_subword_prefix+xt),this.tokens_to_ids.has(xt)){_t=xt;break}--gt}if(_t===null){Se=!0;break}pt.push(_t),Qe=gt}Se?q.push(this.unk_token):q.push(...pt)}return q}}class re extends ve{constructor(C,q){super(C);const ue=C.vocab.length;this.vocab=new Array(ue),this.scores=new Array(ue);for(let be=0;be[be,Se])),this.bos_token=" ",this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=q.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,Y.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new g.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(C){const q=C.chars,ue=1;let be=0;for(;be{const Pe=[...Array.from({length:94},(be,Se)=>Se+33),...Array.from({length:12},(be,Se)=>Se+161),...Array.from({length:82},(be,Se)=>Se+174)],C=Pe.slice();let q=0;for(let be=0;be<256;++be)Pe.includes(be)||(Pe.push(be),C.push(256+q),q+=1);const ue=C.map(be=>String.fromCharCode(be));return Object.fromEntries(Pe.map((be,Se)=>[be,ue[Se]]))})(),ce=(0,D.reverseDictionary)(xe);class ke extends ve{constructor(C){super(C),this.tokens_to_ids=K(C.vocab),this.unk_token_id=this.tokens_to_ids.get(C.unk_token),this.unk_token=C.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[ue,be]of this.tokens_to_ids)this.vocab[be]=ue;const q=Array.isArray(C.merges[0]);this.merges=q?C.merges:C.merges.map(ue=>ue.split(" ",2)),this.bpe_ranks=new Map(this.merges.map((ue,be)=>[JSON.stringify(ue),be])),this.end_of_word_suffix=C.end_of_word_suffix,this.continuing_subword_suffix=C.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.cache=new Map}bpe(C){if(C.length===0)return[];const q=this.cache.get(C);if(q!==void 0)return q;const ue=Array.from(C);this.end_of_word_suffix&&(ue[ue.length-1]+=this.end_of_word_suffix);let be=[];if(ue.length>1){const Se=new g.PriorityQueue((gt,_t)=>gt.score<_t.score);let Qe={token:ue[0],bias:0,prev:null,next:null},pt=Qe;for(let gt=1;gt`<0x${pt.toString(16).toUpperCase().padStart(2,"0")}>`);Qe.every(pt=>this.tokens_to_ids.has(pt))?q.push(...Qe):q.push(this.unk_token)}else q.push(this.unk_token)}return q}}class Ie extends ve{constructor(C,q){super(C),this.tokens_to_ids=K(q.target_lang?C.vocab[q.target_lang]:C.vocab),this.bos_token=q.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=q.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=q.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=q.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[ue,be]of this.tokens_to_ids)this.vocab[be]=ue}encode(C){return C}}class Ee extends f.Callable{constructor(C){super(),this.config=C}static fromConfig(C){if(C===null)return null;switch(C.type){case"BertNormalizer":return new Ke(C);case"Precompiled":return new ws(C);case"Sequence":return new se(C);case"Replace":return new tt(C);case"NFC":return new Ge(C);case"NFKC":return new ye(C);case"NFKD":return new J(C);case"Strip":return new de(C);case"StripAccents":return new Ce(C);case"Lowercase":return new Be(C);case"Prepend":return new Ze(C);default:throw new Error(`Unknown Normalizer type: ${C.type}`)}}normalize(C){throw Error("normalize should be implemented in subclass.")}_call(C){return this.normalize(C)}}class tt extends Ee{normalize(C){const q=A(this.config.pattern);return q===null?C:C.replaceAll(q,this.config.content)}}class Ge extends Ee{normalize(C){return C=C.normalize("NFC"),C}}class ye extends Ee{normalize(C){return C=C.normalize("NFKC"),C}}class J extends Ee{normalize(C){return C=C.normalize("NFKD"),C}}class de extends Ee{normalize(C){return this.config.strip_left&&this.config.strip_right?C=C.trim():(this.config.strip_left&&(C=C.trimStart()),this.config.strip_right&&(C=C.trimEnd())),C}}class Ce extends Ee{normalize(C){return C=W(C),C}}class Be extends Ee{normalize(C){return C=C.toLowerCase(),C}}class Ze extends Ee{normalize(C){return C=this.config.prepend+C,C}}class se extends Ee{constructor(C){super(C),this.normalizers=C.normalizers.map(q=>Ee.fromConfig(q))}normalize(C){return this.normalizers.reduce((q,ue)=>ue.normalize(q),C)}}class Ke extends Ee{_tokenize_chinese_chars(C){const q=[];for(let ue=0;uethis.pre_tokenize_text(ue,q)):this.pre_tokenize_text(C,q)).flat()}_call(C,q){return this.pre_tokenize(C,q)}}class le extends je{constructor(C){super(),this.pattern=new RegExp(`[^\\s${w}]+|[${w}]`,"gu")}pre_tokenize_text(C,q){return C.trim().match(this.pattern)||[]}}class Te extends je{constructor(C){super(),this.config=C,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=xe,this.text_encoder=new TextEncoder}pre_tokenize_text(C,q){return this.add_prefix_space&&!C.startsWith(" ")&&(C=" "+C),(this.use_regex?C.match(this.pattern)||[]:[C]).map(be=>Array.from(this.text_encoder.encode(be),Se=>this.byte_encoder[Se]).join(""))}}class Ue extends je{constructor(C){super(),this.config=C,this.pattern=A(this.config.pattern,this.config.invert)}pre_tokenize_text(C,q){var ue;return this.pattern===null?[]:this.config.invert?C.match(this.pattern)||[]:((ue=this.config.behavior)==null?void 0:ue.toLowerCase())==="removed"?C.split(this.pattern).filter(be=>be):b(C,this.pattern)}}class Ve extends je{constructor(C){super(),this.config=C,this.pattern=new RegExp(`[^${w}]+|[${w}]+`,"gu")}pre_tokenize_text(C,q){return C.match(this.pattern)||[]}}class Ne extends je{constructor(C){super(),this.config=C;const q=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(q,"gu")}pre_tokenize_text(C,q){return C.match(this.pattern)||[]}}class Re extends f.Callable{constructor(C){super(),this.config=C}static fromConfig(C){if(C===null)return null;switch(C.type){case"TemplateProcessing":return new ct(C);case"ByteLevel":return new lt(C);case"RobertaProcessing":return new dt(C);case"BertProcessing":return new st(C);case"Sequence":return new ht(C);default:throw new Error(`Unknown PostProcessor type: ${C.type}`)}}post_process(C,...q){throw Error("post_process should be implemented in subclass.")}_call(C,...q){return this.post_process(C,...q)}}class st extends Re{constructor(C){super(C),this.cls=C.cls[0],this.sep=C.sep[0]}post_process(C,q=null,{add_special_tokens:ue=!0}={}){ue&&(C=(0,D.mergeArrays)([this.cls],C,[this.sep]));let be=new Array(C.length).fill(0);if(q!==null){const Se=ue&&this instanceof dt?[this.sep]:[],Qe=ue?[this.sep]:[];C=(0,D.mergeArrays)(C,Se,q,Qe),be=(0,D.mergeArrays)(be,new Array(q.length+Se.length+Qe.length).fill(1))}return{tokens:C,token_type_ids:be}}}class dt extends st{}class ct extends Re{constructor(C){super(C),this.single=C.single,this.pair=C.pair}post_process(C,q=null,{add_special_tokens:ue=!0}={}){const be=q===null?this.single:this.pair;let Se=[],Qe=[];for(const pt of be)"SpecialToken"in pt?ue&&(Se.push(pt.SpecialToken.id),Qe.push(pt.SpecialToken.type_id)):"Sequence"in pt&&(pt.Sequence.id==="A"?(Se=(0,D.mergeArrays)(Se,C),Qe=(0,D.mergeArrays)(Qe,new Array(C.length).fill(pt.Sequence.type_id))):pt.Sequence.id==="B"&&(Se=(0,D.mergeArrays)(Se,q),Qe=(0,D.mergeArrays)(Qe,new Array(q.length).fill(pt.Sequence.type_id))));return{tokens:Se,token_type_ids:Qe}}}class lt extends Re{post_process(C,q=null){return q&&(C=(0,D.mergeArrays)(C,q)),{tokens:C}}}class ht extends Re{constructor(C){super(C),this.processors=C.processors.map(q=>Re.fromConfig(q))}post_process(C,q=null,ue={}){let be;for(const Se of this.processors)if(Se instanceof lt)C=Se.post_process(C).tokens,q&&(q=Se.post_process(q).tokens);else{const Qe=Se.post_process(C,q,ue);C=Qe.tokens,be=Qe.token_type_ids}return{tokens:C,token_type_ids:be}}}class L extends f.Callable{constructor(C){super(),this.config=C,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=C.trim_offsets}static fromConfig(C){if(C===null)return null;switch(C.type){case"WordPiece":return new We(C);case"Metaspace":return new os(C);case"ByteLevel":return new Je(C);case"Replace":return new ie(C);case"ByteFallback":return new H(C);case"Fuse":return new me(C);case"Strip":return new $e(C);case"Sequence":return new mt(C);case"CTC":return new ut(C);case"BPEDecoder":return new vt(C);default:throw new Error(`Unknown Decoder type: ${C.type}`)}}_call(C){return this.decode(C)}decode(C){return this.decode_chain(C).join("")}decode_chain(C){throw Error("`decode_chain` should be implemented in subclass.")}}class ie extends L{decode_chain(C){const q=A(this.config.pattern);return q===null?C:C.map(ue=>ue.replaceAll(q,this.config.content))}}class H extends L{constructor(C){super(C),this.text_decoder=new TextDecoder}decode_chain(C){const q=[];let ue=[];for(const be of C){let Se=null;if(be.length===6&&be.startsWith("<0x")&&be.endsWith(">")){const Qe=parseInt(be.slice(3,5),16);isNaN(Qe)||(Se=Qe)}if(Se!==null)ue.push(Se);else{if(ue.length>0){const Qe=this.text_decoder.decode(Uint8Array.from(ue));q.push(Qe),ue=[]}q.push(be)}}if(ue.length>0){const be=this.text_decoder.decode(Uint8Array.from(ue));q.push(be),ue=[]}return q}}class me extends L{decode_chain(C){return[C.join("")]}}class $e extends L{constructor(C){super(C),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(C){return C.map(q=>{let ue=0;for(let Se=0;Se(ue!==0&&(q.startsWith(this.config.prefix)?q=q.replace(this.config.prefix,""):q=" "+q),this.cleanup&&(q=ne(q)),q))}}class Je extends L{constructor(C){super(C),this.byte_decoder=ce,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(C){const q=C.join(""),ue=new Uint8Array([...q].map(Se=>this.byte_decoder[Se]));return this.text_decoder.decode(ue)}decode_chain(C){const q=[];let ue=[];for(const be of C)this.added_tokens.find(Se=>Se.content===be)!==void 0?(ue.length>0&&(q.push(this.convert_tokens_to_string(ue)),ue=[]),q.push(be)):ue.push(be);return ue.length>0&&q.push(this.convert_tokens_to_string(ue)),q}}class ut extends L{constructor(C){super(C),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(C){if(C.length===0)return"";const q=[C[0]];for(let Se=1;SeSe!==this.pad_token).join("");return this.cleanup&&(be=ne(be).replaceAll(this.word_delimiter_token," ").trim()),be}decode_chain(C){return[this.convert_tokens_to_string(C)]}}class mt extends L{constructor(C){super(C),this.decoders=C.decoders.map(q=>L.fromConfig(q))}decode_chain(C){return this.decoders.reduce((q,ue)=>ue.decode_chain(q),C)}}class vt extends L{constructor(C){super(C),this.suffix=this.config.suffix}decode_chain(C){return C.map((q,ue)=>q.replaceAll(this.suffix,ue===C.length-1?"":" "))}}class kt extends L{decode_chain(C){let q="";for(let ue=1;ueue.normalize("NFKC")).join("~"):C=C.normalize("NFKC"),C}}class ks extends je{constructor(C){super(),this.tokenizers=C.pretokenizers.map(q=>je.fromConfig(q))}pre_tokenize_text(C,q){return this.tokenizers.reduce((ue,be)=>be.pre_tokenize(ue,q),[C])}}class Ds extends je{constructor(C){super()}pre_tokenize_text(C,q){return C.match(/\w+|[^\w\s]+/g)||[]}}class sr extends je{constructor(C){super()}pre_tokenize_text(C,q){return S(C)}}class Sr extends je{constructor(C){super(),this.config=C,this.pattern=A(this.config.pattern),this.content=this.config.content}pre_tokenize_text(C,q){return this.pattern===null?[C]:[C.replaceAll(this.pattern,this.config.content)]}}const Yr=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function Us(Pe,C,q,ue){for(const be of Object.keys(Pe)){const Se=C-Pe[be].length,Qe=q(be),pt=new Array(Se).fill(Qe);Pe[be]=ue==="right"?(0,D.mergeArrays)(Pe[be],pt):(0,D.mergeArrays)(pt,Pe[be])}}function Tr(Pe,C){for(const q of Object.keys(Pe))Pe[q].length=C}class Nt extends f.Callable{constructor(q,ue){super();_e(this,"return_token_type_ids",!1);_e(this,"padding_side","right");this._tokenizer_config=ue,this.normalizer=Ee.fromConfig(q.normalizer),this.pre_tokenizer=je.fromConfig(q.pre_tokenizer),this.model=ve.fromConfig(q.model,ue),this.post_processor=Re.fromConfig(q.post_processor),this.decoder=L.fromConfig(q.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const be of q.added_tokens){const Se=new oe(be);this.added_tokens.push(Se),this.model.tokens_to_ids.set(Se.content,Se.id),this.model.vocab[Se.id]=Se.content,Se.special&&(this.special_tokens.push(Se.content),this.all_special_ids.push(Se.id))}if(this.additional_special_tokens=ue.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.slice().sort((be,Se)=>Se.content.length-be.content.length).map(be=>`${be.lstrip?"\\s*":""}(${(0,D.escapeRegExp)(be.content)})${be.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken("bos_token"),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken("eos_token"),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=ue.model_max_length,this.remove_space=ue.remove_space,this.clean_up_tokenization_spaces=ue.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=ue.do_lowercase_and_remove_accent??!1,ue.padding_side&&(this.padding_side=ue.padding_side),this.legacy=!1,this.chat_template=ue.chat_template??null,Array.isArray(this.chat_template)){const be=Object.create(null);for(const{name:Se,template:Qe}of this.chat_template){if(typeof Se!="string"||typeof Qe!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');be[Se]=Qe}this.chat_template=be}this._compiled_template_cache=new Map}getToken(...q){for(const ue of q){const be=this._tokenizer_config[ue];if(be)if(typeof be=="object"){if(be.__type==="AddedToken")return be.content;throw Error(`Unknown token: ${be}`)}else return be}return null}static async from_pretrained(q,{progress_callback:ue=null,config:be=null,cache_dir:Se=null,local_files_only:Qe=!1,revision:pt="main",legacy:gt=null}={}){const _t=await M(q,{progress_callback:ue,config:be,cache_dir:Se,local_files_only:Qe,revision:pt,legacy:gt});return new this(..._t)}_call(q,{text_pair:ue=null,add_special_tokens:be=!0,padding:Se=!1,truncation:Qe=null,max_length:pt=null,return_tensor:gt=!0,return_token_type_ids:_t=null}={}){const xt=Array.isArray(q);let Kt;if(xt){if(q.length===0)throw Error("text array must be non-empty");if(ue!==null){if(Array.isArray(ue)){if(q.length!==ue.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");Kt=q.map((us,Fs)=>this._encode_plus(us,{text_pair:ue[Fs],add_special_tokens:be,return_token_type_ids:_t}))}else Kt=q.map(us=>this._encode_plus(us,{add_special_tokens:be,return_token_type_ids:_t}))}else{if(q==null)throw Error("text may not be null or undefined");if(Array.isArray(ue))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");Kt=[this._encode_plus(q,{text_pair:ue,add_special_tokens:be,return_token_type_ids:_t})]}if(pt===null?Se==="max_length"?pt=this.model_max_length:pt=(0,Y.max)(Kt.map(us=>us.input_ids.length))[0]:Qe||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),pt=Math.min(pt,this.model_max_length??1/0),Se||Qe)for(let us=0;uspt?Qe&&Tr(Kt[us],pt):Se&&Us(Kt[us],pt,Fs=>Fs==="input_ids"?this.pad_token_id:0,this.padding_side));const hs={};if(gt){if(!(Se&&Qe)&&Kt.some(Fs=>{var Bt;for(const rs of Object.keys(Fs))if(Fs[rs].length!==((Bt=Kt[0][rs])==null?void 0:Bt.length))return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");const us=[Kt.length,Kt[0].input_ids.length];for(const Fs of Object.keys(Kt[0]))hs[Fs]=new R.Tensor("int64",BigInt64Array.from(Kt.flatMap(Bt=>Bt[Fs]).map(BigInt)),us)}else{for(const us of Object.keys(Kt[0]))hs[us]=Kt.map(Fs=>Fs[us]);if(!xt)for(const us of Object.keys(hs))hs[us]=hs[us][0]}return hs}_encode_text(q){return q===null?null:(this.added_tokens_regex?q.split(this.added_tokens_regex).filter(Se=>Se):[q]).map((Se,Qe)=>{if(this.added_tokens.find(gt=>gt.content===Se)!==void 0)return Se;{if(this.remove_space===!0&&(Se=Se.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(Se=U(Se)),this.normalizer!==null&&(Se=this.normalizer(Se)),Se.length===0)return[];const gt=this.pre_tokenizer!==null?this.pre_tokenizer(Se,{section_index:Qe}):[Se];return this.model(gt)}}).flat()}_encode_plus(q,{text_pair:ue=null,add_special_tokens:be=!0,return_token_type_ids:Se=null}={}){const{tokens:Qe,token_type_ids:pt}=this._tokenize_helper(q,{pair:ue,add_special_tokens:be}),gt=this.model.convert_tokens_to_ids(Qe),_t={input_ids:gt,attention_mask:new Array(gt.length).fill(1)};return(Se??this.return_token_type_ids)&&pt&&(_t.token_type_ids=pt),_t}_tokenize_helper(q,{pair:ue=null,add_special_tokens:be=!1}={}){const Se=this._encode_text(q),Qe=this._encode_text(ue);return this.post_processor?this.post_processor(Se,Qe,{add_special_tokens:be}):{tokens:(0,D.mergeArrays)(Se??[],Qe??[])}}tokenize(q,{pair:ue=null,add_special_tokens:be=!1}={}){return this._tokenize_helper(q,{pair:ue,add_special_tokens:be}).tokens}encode(q,{text_pair:ue=null,add_special_tokens:be=!0,return_token_type_ids:Se=null}={}){return this._encode_plus(q,{text_pair:ue,add_special_tokens:be,return_token_type_ids:Se}).input_ids}batch_decode(q,ue={}){return q instanceof R.Tensor&&(q=q.tolist()),q.map(be=>this.decode(be,ue))}decode(q,ue={}){if(q instanceof R.Tensor&&(q=te(q)),!Array.isArray(q)||q.length===0||!(0,D.isIntegralNumber)(q[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(q,ue)}decode_single(q,{skip_special_tokens:ue=!1,clean_up_tokenization_spaces:be=null}){let Se=this.model.convert_ids_to_tokens(q);ue&&(Se=Se.filter(pt=>!this.special_tokens.includes(pt)));let Qe=this.decoder?this.decoder(Se):Se.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(Qe=Qe.replaceAll(this.decoder.end_of_word_suffix," "),ue&&(Qe=Qe.trim())),(be??this.clean_up_tokenization_spaces)&&(Qe=ne(Qe)),Qe}get_chat_template({chat_template:q=null,tools:ue=null}={}){if(this.chat_template&&typeof this.chat_template=="object"){const be=this.chat_template;if(q!==null&&Object.hasOwn(be,q))q=be[q];else if(q===null)if(ue!==null&&"tool_use"in be)q=be.tool_use;else if("default"in be)q=be.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(be).sort()}.`)}else if(q===null)if(this.chat_template)q=this.chat_template;else throw Error("Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co./docs/transformers/main/en/chat_templating");return q}apply_chat_template(q,{tools:ue=null,documents:be=null,chat_template:Se=null,add_generation_prompt:Qe=!1,tokenize:pt=!0,padding:gt=!1,truncation:_t=!1,max_length:xt=null,return_tensor:Kt=!0,return_dict:hs=!1,tokenizer_kwargs:us={},...Fs}={}){if(Se=this.get_chat_template({chat_template:Se,tools:ue}),typeof Se!="string")throw Error(`chat_template must be a string, but got ${typeof Se}`);let Bt=this._compiled_template_cache.get(Se);Bt===void 0&&(Bt=new v.Template(Se),this._compiled_template_cache.set(Se,Bt));const rs=Object.create(null);for(const Ws of Yr){const ze=this.getToken(Ws);ze&&(rs[Ws]=ze)}const rr=Bt.render({messages:q,add_generation_prompt:Qe,tools:ue,documents:be,...rs,...Fs});if(pt){const Ws=this._call(rr,{add_special_tokens:!1,padding:gt,truncation:_t,max_length:xt,return_tensor:Kt,...us});return hs?Ws:Ws.input_ids}return rr}}class Jr extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class $r extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class Ir extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class Zr extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class pr extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class en extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class Ar extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class Rr extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class Nr extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class ir extends Nt{}class ot extends Nt{}class Tt extends Nt{constructor(q,ue){super(q,ue);_e(this,"return_token_type_ids",!0);console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Dt extends Nt{constructor(){super(...arguments);_e(this,"return_token_type_ids",!0)}}class Vs extends Nt{}class jr extends Nt{}class Or extends Nt{}class Ms extends Nt{constructor(C,q){super(C,q),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(ue=>this.languageRegex.test(ue)),this.lang_to_token=ue=>ue}_build_translation_inputs(C,q,ue){return fr(this,C,q,ue)}}class ar extends Ms{}class As extends Nt{}class Pr extends Nt{}const ts="▁";class fn extends Nt{constructor(q,ue){super(q,ue);_e(this,"padding_side","left");this.legacy=ue.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new It({replacement:ts,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(q){if(q===null)return null;if(this.legacy||q.length===0)return super._encode_text(q);let ue=super._encode_text(ts+q.replaceAll(ts," "));return ue.length>1&&ue[0]===ts&&this.special_tokens.includes(ue[1])&&(ue=ue.slice(1)),ue}}class Ur extends Nt{}class so extends Nt{}class $n extends Nt{}class In extends Nt{}class An extends Nt{}class Vr extends Nt{}class On extends Nt{}class ro extends Nt{}class Wr extends Nt{}function fr(Pe,C,q,ue){if(!("language_codes"in Pe)||!Array.isArray(Pe.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in Pe)||!(Pe.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in Pe)||typeof Pe.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const be=ue.src_lang,Se=ue.tgt_lang;if(!Pe.language_codes.includes(Se))throw new Error(`Target language code "${Se}" is not valid. Must be one of: {${Pe.language_codes.join(", ")}}`);if(be!==void 0){if(!Pe.language_codes.includes(be))throw new Error(`Source language code "${be}" is not valid. Must be one of: {${Pe.language_codes.join(", ")}}`);for(const Qe of Pe.post_processor.config.single)if("SpecialToken"in Qe&&Pe.languageRegex.test(Qe.SpecialToken.id)){Qe.SpecialToken.id=Pe.lang_to_token(be);break}}return ue.forced_bos_token_id=Pe.model.convert_tokens_to_ids([Pe.lang_to_token(Se)])[0],Pe._call(C,q)}class lr extends Nt{constructor(C,q){super(C,q),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(ue=>this.languageRegex.test(ue)),this.lang_to_token=ue=>ue}_build_translation_inputs(C,q,ue){return fr(this,C,q,ue)}}class gn extends Nt{constructor(C,q){super(C,q),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(ue=>this.languageRegex.test(ue)).map(ue=>ue.slice(2,-2)),this.lang_to_token=ue=>`__${ue}__`}_build_translation_inputs(C,q,ue){return fr(this,C,q,ue)}}class tn extends Nt{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr(C,{return_timestamps:q=!1,return_language:ue=!1,time_precision:be=null,force_full_sequences:Se=!0}={}){if(be===null)throw Error("Must specify time_precision");let Qe=null;const pt=q==="word";function gt(){return{language:Qe,timestamp:[null,null],text:""}}const _t=[];let xt=gt(),Kt=0;const hs=this.timestamp_begin,Fs=hs+1500;let Bt=[],rs=[],rr=!1,Ws=null;const ze=new Set(this.all_special_ids);for(const Ss of C){const qs=Ss.tokens,Ot=pt?Ss.token_timestamps:null;let nr=null,gr=hs;if("stride"in Ss){const[yt,qt,Ls]=Ss.stride;if(Kt-=qt,Ws=yt-Ls,qt&&(gr=qt/be+hs),Ls)for(let Is=qs.length-1;Is>=0;--Is){const Gs=Number(qs[Is]);if(Gs>=hs){if(nr!==null&&(Gs-hs)*be=hs&&qt<=Fs){const Ls=(qt-hs)*be+Kt,Is=(0,Y.round)(Ls,2);if(nr!==null&&qt>=nr)rr=!0;else if(rr||Bt.length>0&&qt0?(Bt.push(ms),pt&&rs.push($s)):Bt.every(yt=>yt.length===0)&&(xt=gt(),Bt=[],ms=[],rs=[],$s=[])}if(Bt.length>0){if(Se&&q)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");const[Ss,qs]=this.findLongestCommonSequence(Bt,rs),Ot=this.decode(Ss);xt.text=Ot,pt&&(xt.words=this.collateWordTimestamps(Ss,qs,Qe)),_t.push(xt)}let Js=Object.create(null);const Fr=_t.map(Ss=>Ss.text).join("");if(q||ue){for(let Ss=0;Ss<_t.length;++Ss){const qs=_t[Ss];q||delete qs.timestamp,ue||delete qs.language}if(pt){const Ss=[];for(const qs of _t)for(const Ot of qs.words)Ss.push(Ot);Js={chunks:Ss}}else Js={chunks:_t}}return[Fr,Js]}findLongestCommonSequence(C,q=null){let ue=C[0],be=ue.length,Se=[];const Qe=Array.isArray(q)&&q.length>0;let pt=Qe?[]:null,gt=Qe?q[0]:null;for(let _t=1;_tqt===gr[Ls]&>[Fr+Ls]<=q[_t][Ot+Ls]).length:ms=qs.filter((qt,Ls)=>qt===gr[Ls]).length;const $s=Js/1e4,yt=ms/Js+$s;ms>1&&yt>Kt&&(Kt=yt,hs=[Fr,Ss,Ot,nr])}const[Fs,Bt,rs,rr]=hs,Ws=Math.floor((Bt+Fs)/2),ze=Math.floor((rr+rs)/2);Se.push(...ue.slice(0,Ws)),ue=xt.slice(ze),be=ue.length,Qe&&(pt.push(...gt.slice(0,Ws)),gt=q[_t].slice(ze))}return Se.push(...ue),Qe?(pt.push(...gt),[Se,pt]):[Se,[]]}collateWordTimestamps(C,q,ue){const[be,Se,Qe]=this.combineTokensIntoWords(C,ue),pt=[];for(let gt=0;gt=be){const pt=((Qe-be)*ue).toFixed(2);Se.push(`<|${pt}|>`),Se.push([])}else Se[Se.length-1].push(Qe);return Se=Se.map(Qe=>typeof Qe=="string"?Qe:super.decode(Qe,q)),Se.join("")}splitTokensOnUnicode(C){const q=this.decode(C,{decode_with_timestamps:!0}),ue="�",be=[],Se=[],Qe=[];let pt=[],gt=[],_t=0;for(let xt=0;xt=this.model.tokens_to_ids.get("<|endoftext|>"),Fs=xt.startsWith(" "),Bt=xt.trim(),rs=gt.test(Bt);if(us||Fs||rs||Se.length===0)Se.push(xt),Qe.push(Kt),pt.push(hs);else{const rr=Se.length-1;Se[rr]+=xt,Qe[rr].push(...Kt),pt[rr].push(...hs)}}return[Se,Qe,pt]}mergePunctuations(C,q,ue,be,Se){const Qe=structuredClone(C),pt=structuredClone(q),gt=structuredClone(ue);let _t=Qe.length-2,xt=Qe.length-1;for(;_t>=0;)Qe[_t].startsWith(" ")&&be.includes(Qe[_t].trim())?(Qe[xt]=Qe[_t]+Qe[xt],pt[xt]=(0,D.mergeArrays)(pt[_t],pt[xt]),gt[xt]=(0,D.mergeArrays)(gt[_t],gt[xt]),Qe[_t]="",pt[_t]=[],gt[_t]=[]):xt=_t,--_t;for(_t=0,xt=1;xtKt),pt.filter(Kt=>Kt.length>0),gt.filter(Kt=>Kt.length>0)]}}class wn extends Nt{}class yn extends Nt{}class Mn extends Nt{}class zt extends Nt{constructor(C,q){super(C,q),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(ue=>this.languageRegex.test(ue)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(C){if(C===null)return null;const[q,...ue]=C.trim().split(this.languageRegex);if(ue.length===0)return super._encode_text(q);if(ue.length===2){const[be,Se]=ue;return this.supported_language_codes.includes(be)||console.warn(`Unsupported language code "${be}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,D.mergeArrays)([be],super._encode_text(Se))}}}class bn extends Nt{}class Fn extends Nt{}class Dn extends Nt{}class Ln extends Nt{}class Gr extends Nt{}class zn extends Nt{constructor(C,q){super(C,q),this.decoder=new kt({})}}class vn extends Nt{}class Bn extends Nt{}class as{static async from_pretrained(C,{progress_callback:q=null,config:ue=null,cache_dir:be=null,local_files_only:Se=!1,revision:Qe="main",legacy:pt=null}={}){var hs;const[gt,_t]=await M(C,{progress_callback:q,config:ue,cache_dir:be,local_files_only:Se,revision:Qe,legacy:pt}),xt=((hs=_t.tokenizer_class)==null?void 0:hs.replace(/Fast$/,""))??"PreTrainedTokenizer";let Kt=this.TOKENIZER_CLASS_MAPPING[xt];return Kt||(console.warn(`Unknown tokenizer class "${xt}", attempting to construct from base class.`),Kt=Nt),new Kt(gt,_t)}}_e(as,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:Vs,DistilBertTokenizer:ir,CamembertTokenizer:ot,DebertaTokenizer:pr,DebertaV2Tokenizer:en,BertTokenizer:Jr,HerbertTokenizer:Ar,ConvBertTokenizer:Rr,RoFormerTokenizer:Nr,XLMTokenizer:Tt,ElectraTokenizer:Dt,MobileBertTokenizer:Ir,SqueezeBertTokenizer:Zr,AlbertTokenizer:$r,GPT2Tokenizer:jr,BartTokenizer:Or,MBartTokenizer:Ms,MBart50Tokenizer:ar,RobertaTokenizer:As,WhisperTokenizer:tn,CodeGenTokenizer:wn,CLIPTokenizer:yn,SiglipTokenizer:Mn,MarianTokenizer:zt,BloomTokenizer:Pr,NllbTokenizer:lr,M2M100Tokenizer:gn,LlamaTokenizer:fn,CodeLlamaTokenizer:Ur,XLMRobertaTokenizer:so,MPNetTokenizer:$n,FalconTokenizer:In,GPTNeoXTokenizer:An,EsmTokenizer:Vr,Wav2Vec2CTCTokenizer:bn,BlenderbotTokenizer:Fn,BlenderbotSmallTokenizer:Dn,SpeechT5Tokenizer:Ln,NougatTokenizer:Gr,VitsTokenizer:zn,Qwen2Tokenizer:On,GemmaTokenizer:ro,Grok1Tokenizer:Wr,CohereTokenizer:vn,MgpstrTokenizer:Bn,PreTrainedTokenizer:Nt})},"./src/utils/audio.js":(Le,I,r)=>{r.r(I),r.d(I,{RawAudio:()=>we,hamming:()=>b,hanning:()=>M,mel_filter_bank:()=>X,read_audio:()=>v,spectrogram:()=>O,window_function:()=>ae});var f=r("./src/utils/hub.js"),D=r("./src/utils/maths.js"),j=r("./src/utils/core.js"),Y=r("./src/env.js"),R=r("?7a2c"),g=r("./src/utils/tensor.js");async function v(re,xe){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co./docs/transformers.js/guides/node-audio-processing.");const ce=await(await(0,f.getFile)(re)).arrayBuffer(),ke=new AudioContext({sampleRate:xe});typeof xe>"u"&&console.warn(`No sampling rate provided, using default of ${ke.sampleRate}Hz.`);const Ie=await ke.decodeAudioData(ce);let Ee;if(Ie.numberOfChannels===2){const tt=Math.sqrt(2),Ge=Ie.getChannelData(0),ye=Ie.getChannelData(1);Ee=new Float32Array(Ge.length);for(let J=0;J2595*Math.log10(1+re/700),kaldi:re=>1127*Math.log(1+re/700),slaney:(re,xe=1e3,ce=15,ke=27/Math.log(6.4))=>re>=xe?ce+Math.log(re/xe)*ke:3*re/200};function K(re,xe="htk"){const ce=A[xe];if(!ce)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof re=="number"?ce(re):re.map(ke=>ce(ke))}const te={htk:re=>700*(10**(re/2595)-1),kaldi:re=>700*(Math.exp(re/1127)-1),slaney:(re,xe=1e3,ce=15,ke=Math.log(6.4)/27)=>re>=ce?xe*Math.exp(ke*(re-ce)):200*re/3};function ne(re,xe="htk"){const ce=te[xe];if(!ce)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof re=="number"?ce(re):re.map(ke=>ce(ke))}function W(re,xe){const ce=Float64Array.from({length:xe.length-1},(tt,Ge)=>xe[Ge+1]-xe[Ge]),ke=Array.from({length:re.length},()=>new Array(xe.length));for(let tt=0;ttnew Array(re.length));for(let tt=0;ttre+ke*Ee)}function X(re,xe,ce,ke,Ie,Ee=null,tt="htk",Ge=!1){if(Ee!==null&&Ee!=="slaney")throw new Error('norm must be one of null or "slaney"');const ye=K(ce,tt),J=K(ke,tt),de=U(ye,J,xe+2);let Ce=ne(de,tt),Be;if(Ge){const se=Ie/(re*2);Be=K(Float64Array.from({length:re},(Ke,je)=>je*se),tt),Ce=de}else Be=U(0,Math.floor(Ie/2),re);const Ze=W(Be,Ce);if(Ee!==null&&Ee==="slaney")for(let se=0;seIe)throw Error(`frame_length (${ce}) may not be larger than fft_length (${Ie})`);if(Ne!==ce)throw new Error(`Length of the window (${Ne}) must equal frame_length (${ce})`);if(ke<=0)throw new Error("hop_length must be greater than zero");if(Ee===null&&de!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(tt){if(Ge!=="reflect")throw new Error(`pad_mode="${Ge}" not implemented yet.`);const We=Math.floor((Ie-1)/2)+1;re=$(re,We,We)}let Re=Math.floor(1+Math.floor((re.length-ce)/ke));le!==null&&ReRe?Ue&&(ct=Te):ct=dt=Te);const lt=new D.FFT(Ie),ht=new Float64Array(Ie),L=new Float64Array(lt.outputBufferSize),ie=new Float32Array(st*ct);for(let We=0;We=1;--mt)ht[mt]-=J*ht[mt-1];ht[0]*=1-J}for(let mt=0;mtMath.pow(Ge,.85));break;default:throw new Error(`Unknown window type ${xe}.`)}if(ce&&(tt=tt.subarray(0,re)),ke===null)return tt;if(re>ke)throw new Error(`Length of the window (${re}) may not be larger than frame_length (${ke})`);return tt}function oe(re,xe){let ce=44;const ke=new ArrayBuffer(ce+re.length*4),Ie=new DataView(ke);ve(Ie,0,"RIFF"),Ie.setUint32(4,36+re.length*4,!0),ve(Ie,8,"WAVE"),ve(Ie,12,"fmt "),Ie.setUint32(16,16,!0),Ie.setUint16(20,3,!0),Ie.setUint16(22,1,!0),Ie.setUint32(24,xe,!0),Ie.setUint32(28,xe*4,!0),Ie.setUint16(32,4,!0),Ie.setUint16(34,32,!0),ve(Ie,36,"data"),Ie.setUint32(40,re.length*4,!0);for(let Ee=0;Ee{let Ee=await Ie.arrayBuffer();R.writeFileSync(ke,Buffer.from(Ee))};else throw new Error("Unable to save because filesystem is disabled in this environment.");await ce(xe,this.toBlob())}}},"./src/utils/constants.js":(Le,I,r)=>{r.r(I),r.d(I,{CHAT_TEMPLATE_NAME:()=>g,CONFIG_NAME:()=>D,FEATURE_EXTRACTOR_NAME:()=>j,GENERATION_CONFIG_NAME:()=>v,GITHUB_ISSUE_URL:()=>f,IMAGE_PROCESSOR_NAME:()=>Y,PROCESSOR_NAME:()=>R});const f="https://github.com/huggingface/transformers.js/issues/new/choose",D="config.json",j="preprocessor_config.json",Y=j,R="processor_config.json",g="chat_template.json",v="generation_config.json"},"./src/utils/core.js":(Le,I,r)=>{r.r(I),r.d(I,{calculateDimensions:()=>v,calculateReflectOffset:()=>A,count:()=>W,dispatchCallback:()=>f,escapeRegExp:()=>j,isIntegralNumber:()=>R,isNullishDimension:()=>g,isTypedArray:()=>Y,len:()=>ne,mergeArrays:()=>M,pick:()=>te,pop:()=>y,product:()=>b,reverseDictionary:()=>D,saveBlob:()=>K});function f(U,X){U&&U(X)}function D(U){return Object.fromEntries(Object.entries(U).map(([X,$])=>[$,X]))}function j(U){return U.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(U){var X,$,S;return((S=($=(X=U==null?void 0:U.prototype)==null?void 0:X.__proto__)==null?void 0:$.constructor)==null?void 0:S.name)==="TypedArray"}function R(U){return Number.isInteger(U)||typeof U=="bigint"}function g(U){return U==null||U===-1}function v(U){const X=[];let $=U;for(;Array.isArray($);)X.push($.length),$=$[0];return X}function y(U,X,$=void 0){const S=U[X];if(S!==void 0)return delete U[X],S;if($===void 0)throw Error(`Key ${X} does not exist in object.`);return $}function M(...U){return Array.prototype.concat.apply([],U)}function b(...U){return U.reduce((X,$)=>X.flatMap(S=>$.map(w=>[S,w])))}function A(U,X){return Math.abs((U+X)%(2*X)-X)}function K(U,X){const $=URL.createObjectURL(X),S=document.createElement("a");S.href=$,S.download=U,S.click(),S.remove(),URL.revokeObjectURL($)}function te(U,X){return Object.assign({},...X.map($=>{if(U[$]!==void 0)return{[$]:U[$]}}))}function ne(U){let X=0;for(const $ of U)++X;return X}function W(U,X){let $=0;for(const S of U)S===X&&++$;return $}},"./src/utils/data-structures.js":(Le,I,r)=>{r.r(I),r.d(I,{CharTrie:()=>D,PriorityQueue:()=>f,TokenLattice:()=>Y});class f{constructor(v=(M,b)=>M>b,y=1/0){this._heap=[],this._comparator=v,this._maxSize=y}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...v){return this.extend(v)}extend(v){for(const y of v)if(this.size0&&this._swap(0,y),this._heap.pop(),this._siftDown(),v}replace(v){const y=this.peek();return this._heap[0]=v,this._siftDown(),y}_parent(v){return(v+1>>>1)-1}_left(v){return(v<<1)+1}_right(v){return v+1<<1}_greater(v,y){return this._comparator(this._heap[v],this._heap[y])}_swap(v,y){const M=this._heap[v];this._heap[v]=this._heap[y],this._heap[y]=M}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(v){for(;v>0&&this._greater(v,this._parent(v));)this._swap(v,this._parent(v)),v=this._parent(v)}_siftDown(){let v=0;for(;this._left(v)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const b=new R(this.bosTokenId,0,0,0,0),A=new R(this.eosTokenId,1,this.len,0,0);this.nodes.push(b.clone()),this.nodes.push(A.clone()),this.beginNodes[this.len].push(A),this.endNodes[0].push(b)}insert(v,y,M,b){const A=this.nodes.length,K=new R(b,A,v,y,M);this.beginNodes[v].push(K),this.endNodes[v+y].push(K),this.nodes.push(K)}viterbi(){const v=this.len;let y=0;for(;y<=v;){if(this.beginNodes[y].length==0)return[];for(let te of this.beginNodes[y]){te.prev=null;let ne=0,W=null;for(let U of this.endNodes[y]){const X=U.backtraceScore+te.score;(W===null||X>ne)&&(W=U.clone(),ne=X)}if(W!==null)te.prev=W,te.backtraceScore=ne;else return[]}++y}const M=[],A=this.beginNodes[v][0].prev;if(A===null)return[];let K=A.clone();for(;K.prev!==null;)M.push(K.clone()),K=K.clone().prev.clone();return M.reverse(),M}piece(v){return this.chars.slice(v.pos,v.pos+v.length).join("")}tokens(){return this.viterbi().map(y=>this.piece(y))}tokenIds(){return this.viterbi().map(y=>y.tokenId)}}class R{constructor(v,y,M,b,A){this.tokenId=v,this.nodeId=y,this.pos=M,this.length=b,this.score=A,this.prev=null,this.backtraceScore=0}clone(){const v=new R(this.tokenId,this.nodeId,this.pos,this.length,this.score);return v.prev=this.prev,v.backtraceScore=this.backtraceScore,v}}},"./src/utils/devices.js":(Le,I,r)=>{r.r(I),r.d(I,{DEVICE_TYPES:()=>f});const f=Object.freeze({auto:"auto",gpu:"gpu",cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:"webnn","webnn-npu":"webnn-npu","webnn-gpu":"webnn-gpu","webnn-cpu":"webnn-cpu"})},"./src/utils/dtypes.js":(Le,I,r)=>{r.r(I),r.d(I,{DATA_TYPES:()=>Y,DEFAULT_DEVICE_DTYPE_MAPPING:()=>R,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>g,isWebGpuFp16Supported:()=>j});var f=r("./src/env.js"),D=r("./src/utils/devices.js");const j=function(){let v;return async function(){if(v===void 0)if(!f.apis.IS_WEBGPU_AVAILABLE)v=!1;else try{v=(await navigator.gpu.requestAdapter()).features.has("shader-f16")}catch{v=!1}return v}}(),Y=Object.freeze({auto:"auto",fp32:"fp32",fp16:"fp16",q8:"q8",int8:"int8",uint8:"uint8",q4:"q4",bnb4:"bnb4",q4f16:"q4f16"}),R=Object.freeze({[D.DEVICE_TYPES.wasm]:Y.q8}),g=Object.freeze({[Y.fp32]:"",[Y.fp16]:"_fp16",[Y.int8]:"_int8",[Y.uint8]:"_uint8",[Y.q8]:"_quantized",[Y.q4]:"_q4",[Y.q4f16]:"_q4f16",[Y.bnb4]:"_bnb4"})},"./src/utils/generic.js":(Le,I,r)=>{r.r(I),r.d(I,{Callable:()=>f});const f=class{constructor(){let D=function(...j){return D._call(...j)};return Object.setPrototypeOf(D,new.target.prototype)}_call(...D){throw Error("Must implement _call method in subclass")}}},"./src/utils/hub.js":(Le,I,r)=>{r.r(I),r.d(I,{getFile:()=>y,getModelFile:()=>te,getModelJSON:()=>ne});var f=r("?7a2c"),D=r("?a42a"),j=r("./src/env.js"),Y=r("./src/utils/core.js");const R={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};class g{constructor($){if(this.filePath=$,this.headers=new Headers,this.exists=f.existsSync($),this.exists){this.status=200,this.statusText="OK";let S=f.statSync($);this.headers.set("content-length",S.size.toString()),this.updateContentType();let w=this;this.body=new ReadableStream({start(x){w.arrayBuffer().then(O=>{x.enqueue(new Uint8Array(O)),x.close()})}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const $=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",R[$]??"application/octet-stream")}clone(){let $=new g(this.filePath);return $.exists=this.exists,$.status=this.status,$.statusText=this.statusText,$.headers=new Headers(this.headers),$}async arrayBuffer(){return(await f.promises.readFile(this.filePath)).buffer}async blob(){const $=await f.promises.readFile(this.filePath);return new Blob([$],{type:this.headers.get("content-type")})}async text(){return await f.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function v(X,$=null,S=null){let w;try{w=new URL(X)}catch{return!1}return!($&&!$.includes(w.protocol)||S&&!S.includes(w.hostname))}async function y(X){var $;if(j.env.useFS&&!v(X,["http:","https:","blob:"]))return new g(X);if(typeof process<"u"&&(($=process==null?void 0:process.release)==null?void 0:$.name)==="node"){const S=!!(cr!=null&&cr.TESTING_REMOTELY),w=j.env.version,x=new Headers;if(x.set("User-Agent",`transformers.js/${w}; is_ci/${S};`),v(X,["http:","https:"],["huggingface.co","hf.co"])){const ae=(cr==null?void 0:cr.HF_TOKEN)??(cr==null?void 0:cr.HF_ACCESS_TOKEN);ae&&x.set("Authorization",`Bearer ${ae}`)}return fetch(X,{headers:x})}else return fetch(X)}const M={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function b(X,$,S){if(!S)return null;const w=M[X]??`Error (${X}) occurred while trying to load file`;throw Error(`${w}: "${$}".`)}class A{constructor($){this.path=$}async match($){let S=D.join(this.path,$),w=new g(S);if(w.exists)return w}async put($,S){const w=Buffer.from(await S.arrayBuffer());let x=D.join(this.path,$);try{await f.promises.mkdir(D.dirname(x),{recursive:!0}),await f.promises.writeFile(x,w)}catch(O){console.warn("An error occurred while writing the file to cache:",O)}}}async function K(X,...$){for(let S of $)try{let w=await X.match(S);if(w)return w}catch{continue}}async function te(X,$,S=!0,w={}){if(!j.env.allowLocalModels){if(w.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!j.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,Y.dispatchCallback)(w.progress_callback,{status:"initiate",name:X,file:$});let x;if(!x&&j.env.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{x=await caches.open("transformers-cache")}catch(tt){console.warn("An error occurred while opening the browser cache:",tt)}}if(!x&&j.env.useFSCache&&(x=new A(w.cache_dir??j.env.cacheDir)),!x&&j.env.useCustomCache){if(!j.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!j.env.customCache.match||!j.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");x=j.env.customCache}const O=w.revision??"main";let ae=U(X,$),oe=U(j.env.localModelPath,ae),ve=U(j.env.remoteHost,j.env.remotePathTemplate.replaceAll("{model}",X).replaceAll("{revision}",encodeURIComponent(O)),$),we=O==="main"?ae:U(X,O,$),re,xe=x instanceof A?we:ve,ce=!1,ke;x&&(ke=await K(x,oe,xe));const Ie=ke!==void 0;if(ke===void 0){if(j.env.allowLocalModels)if(v(ae,["http:","https:"])){if(w.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${ae}.`);if(!j.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${ae}.`)}else try{ke=await y(oe),re=oe}catch(Ge){console.warn(`Unable to load from local path "${oe}": "${Ge}"`)}if(ke===void 0||ke.status===404){if(w.local_files_only||!j.env.allowRemoteModels){if(S)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${oe}".`);return null}if(ke=await y(ve),ke.status!==200)return b(ke.status,ve,S);re=xe}ce=x&&typeof Response<"u"&&ke instanceof Response&&ke.status===200}(0,Y.dispatchCallback)(w.progress_callback,{status:"download",name:X,file:$});let Ee;return w.progress_callback?Ie&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(Ee=new Uint8Array(await ke.arrayBuffer()),(0,Y.dispatchCallback)(w.progress_callback,{status:"progress",name:X,file:$,progress:100,loaded:Ee.length,total:Ee.length})):Ee=await W(ke,tt=>{(0,Y.dispatchCallback)(w.progress_callback,{status:"progress",name:X,file:$,...tt})}):Ee=new Uint8Array(await ke.arrayBuffer()),ce&&re&&await x.match(re)===void 0&&await x.put(re,new Response(Ee,{headers:ke.headers})).catch(tt=>{console.warn(`Unable to add response to browser cache: ${tt}.`)}),(0,Y.dispatchCallback)(w.progress_callback,{status:"done",name:X,file:$}),Ee}async function ne(X,$,S=!0,w={}){let x=await te(X,$,S,w);if(x===null)return{};let ae=new TextDecoder("utf-8").decode(x);return JSON.parse(ae)}async function W(X,$){const S=X.headers.get("Content-Length");S===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let w=parseInt(S??"0"),x=new Uint8Array(w),O=0;const ae=X.body.getReader();async function oe(){const{done:ve,value:we}=await ae.read();if(ve)return;let re=O+we.length;if(re>w){w=re;let ce=new Uint8Array(w);ce.set(x),x=ce}x.set(we,O),O=re;const xe=O/w*100;return $({progress:xe,loaded:O,total:w}),oe()}return await oe(),x}function U(...X){return X=X.map(($,S)=>(S&&($=$.replace(new RegExp("^/"),"")),S!==X.length-1&&($=$.replace(new RegExp("/$"),"")),$)),X.join("/")}},"./src/utils/image.js":(Le,I,r)=>{r.r(I),r.d(I,{RawImage:()=>K,load_image:()=>te});var f=r("./src/utils/core.js"),D=r("./src/utils/hub.js"),j=r("./src/env.js"),Y=r("./src/utils/tensor.js"),R=r("?2b25");let g,v,y;const M=j.apis.IS_BROWSER_ENV||j.apis.IS_WEBWORKER_ENV;if(M)g=(ne,W)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(ne,W)},y=self.createImageBitmap,v=self.ImageData;else if(R)y=async ne=>{const U=(await ne.metadata()).channels,{data:X,info:$}=await ne.rotate().raw().toBuffer({resolveWithObject:!0}),S=new K(new Uint8ClampedArray(X),$.width,$.height,$.channels);return U!==void 0&&U!==$.channels&&S.convert(U),S};else throw new Error("Unable to load image processing library.");const b={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},A=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class K{constructor(W,U,X,$){this.data=W,this.width=U,this.height=X,this.channels=$}get size(){return[this.width,this.height]}static async read(W){if(W instanceof K)return W;if(typeof W=="string"||W instanceof URL)return await this.fromURL(W);throw new Error(`Unsupported input type: ${typeof W}`)}static fromCanvas(W){if(!M)throw new Error("fromCanvas() is only supported in browser environments.");const X=W.getContext("2d").getImageData(0,0,W.width,W.height).data;return new K(X,W.width,W.height,4)}static async fromURL(W){const U=await(0,D.getFile)(W);if(U.status!==200)throw new Error(`Unable to read image from "${W}" (${U.status} ${U.statusText})`);const X=await U.blob();return this.fromBlob(X)}static async fromBlob(W){if(M){const U=await y(W),X=g(U.width,U.height).getContext("2d");return X.drawImage(U,0,0),new this(X.getImageData(0,0,U.width,U.height).data,U.width,U.height,4)}else{const U=R(await W.arrayBuffer());return await y(U)}}static fromTensor(W,U="CHW"){if(W.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${W.dims.length} dimensions.`);if(U==="CHW")W=W.transpose(1,2,0);else if(U!=="HWC")throw new Error(`Unsupported channel format: ${U}`);if(!(W.data instanceof Uint8ClampedArray||W.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${W.type}`);switch(W.dims[2]){case 1:case 2:case 3:case 4:return new K(W.data,W.dims[1],W.dims[0],W.dims[2]);default:throw new Error(`Unsupported number of channels: ${W.dims[2]}`)}}grayscale(){if(this.channels===1)return this;const W=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let U=0,X=0;U=0?O=X:oe=-X,$>=0?ae=$:ve=-$,x.drawImage(w,O,ae,W,U,oe,ve,W,U),new K(x.getImageData(0,0,W,U).data,W,U,4).convert(S)}else{let S=this.toSharp();if(X>=0&&$>=0)S=S.extract({left:Math.floor(X),top:Math.floor($),width:W,height:U});else if(X<=0&&$<=0){const w=Math.floor(-$),x=Math.floor(-X);S=S.extend({top:w,left:x,right:W-this.width-x,bottom:U-this.height-w})}else{let w=[0,0],x=0;$<0?(w[0]=Math.floor(-$),w[1]=U-this.height-w[0]):x=Math.floor($);let O=[0,0],ae=0;X<0?(O[0]=Math.floor(-X),O[1]=W-this.width-O[0]):ae=Math.floor(X),S=S.extend({top:w[0],bottom:w[1],left:O[0],right:O[1]}).extract({left:ae,top:x,width:W,height:U})}return await y(S)}}async toBlob(W="image/png",U=1){if(!M)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:W,quality:U})}toTensor(W="CHW"){let U=new Y.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(W!=="HWC")if(W==="CHW")U=U.permute(2,0,1);else throw new Error(`Unsupported channel format: ${W}`);return U}toCanvas(){if(!M)throw new Error("toCanvas() is only supported in browser environments.");const W=this.clone().rgba(),U=g(W.width,W.height),X=new v(W.data,W.width,W.height);return U.getContext("2d").putImageData(X,0,0),U}split(){const{data:W,width:U,height:X,channels:$}=this,S=W.constructor,w=W.length/$,x=Array.from({length:$},()=>new S(w));for(let O=0;Onew K(O,U,X,1))}_update(W,U,X,$=null){return this.data=W,this.width=U,this.height=X,$!==null&&(this.channels=$),this}clone(){return new K(this.data.slice(),this.width,this.height,this.channels)}convert(W){if(this.channels===W)return this;switch(W){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(W){if(M){if(j.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const U=W.split(".").pop().toLowerCase(),X=A.get(U)??"image/png",$=await this.toBlob(X);(0,f.saveBlob)(W,$)}else{if(j.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(W);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(M)throw new Error("toSharp() is only supported in server-side environments.");return R(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}const te=K.read.bind(K)},"./src/utils/maths.js":(Le,I,r)=>{r.r(I),r.d(I,{FFT:()=>te,bankers_round:()=>U,cos_sim:()=>g,dot:()=>R,dynamic_time_warping:()=>X,interpolate_data:()=>f,log_softmax:()=>Y,magnitude:()=>v,max:()=>M,medianFilter:()=>ne,min:()=>y,permute_data:()=>D,round:()=>W,softmax:()=>j});function f($,[S,w,x],[O,ae],oe="bilinear",ve=!1){const we=ae/x,re=O/w,xe=new $.constructor(O*ae*S),ce=w*x,ke=O*ae;for(let Ie=0;Ie=0;--ve)O[ve]=we,x[ve]=S[w[ve]],we*=x[ve];const ae=w.map((ve,we)=>O[w.indexOf(we)]),oe=new $.constructor($.length);for(let ve=0;ve<$.length;++ve){let we=0;for(let re=S.length-1,xe=ve;re>=0;--re)we+=xe%S[re]*ae[re],xe=Math.floor(xe/S[re]);oe[we]=$[ve]}return[oe,x]}function j($){const S=M($)[0],w=$.map(ae=>Math.exp(ae-S)),x=w.reduce((ae,oe)=>ae+oe,0);return w.map(ae=>ae/x)}function Y($){const S=M($)[0];let w=0;for(let ae=0;ae<$.length;++ae)w+=Math.exp($[ae]-S);const x=Math.log(w);return $.map(ae=>ae-S-x)}function R($,S){let w=0;for(let x=0;x<$.length;++x)w+=$[x]*S[x];return w}function g($,S){const w=R($,S),x=v($),O=v(S);return w/(x*O)}function v($){return Math.sqrt($.reduce((S,w)=>S+w*w,0))}function y($){if($.length===0)throw Error("Array must not be empty");let S=$[0],w=0;for(let x=1;x<$.length;++x)$[x]S&&(S=$[x],w=x);return[S,w]}function b($){return $>0&&($&$-1)===0}class A{constructor(S){if(this.size=S|0,this.size<=1||!b(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=S<<1,this.table=new Float64Array(this.size*2);for(let x=0;xx;x<<=1)++w;this._width=w%2===0?w-1:w,this._bitrev=new Int32Array(1<>>O&3)<>>1);for(let O=0;O>>1]=S[O];return x}toComplexArray(S,w){const x=w||this.createComplexArray();for(let O=0;O>>1],x[O+1]=0;return x}transform(S,w){if(S===w)throw new Error("Input and output buffers must be different");this._transform4(S,w,1)}realTransform(S,w){if(S===w)throw new Error("Input and output buffers must be different");this._realTransform4(S,w,1)}inverseTransform(S,w){if(S===w)throw new Error("Input and output buffers must be different");this._transform4(S,w,-1);for(let x=0;x>=2;oe>=2;oe>>=2){ve=O/oe<<1;const ke=ve>>>2;for(we=0;we>>1,oe>>>1)}else for(we=0,re=0;we>>1,oe>>>1,x)}const ce=this.table;for(oe>>=2;oe>=2;oe>>=2){ve=O/oe<<1;const Ie=ve>>>1,Ee=Ie>>>1,tt=Ee>>>1;for(we=0;we>>1;for(let Ie=2;Ie>1;++xe){const ce=(xe+1-S)**2/2,ke=Math.sqrt(we**2+re**2)**ce,Ie=ce*Math.atan2(re,we),Ee=2*xe;ae[Ee]=ke*Math.cos(Ie),ae[Ee+1]=ke*Math.sin(Ie),oe[Ee]=ae[Ee],oe[Ee+1]=-ae[Ee+1]}this._slicedChirpBuffer=ae.subarray(w,x),this._f=new A(O>>1),this._f.transform(this._chirpBuffer,oe)}_transform(S,w,x){const O=this._buffer1,ae=this._buffer2,oe=this._outBuffer1,ve=this._outBuffer2,we=this._chirpBuffer,re=this._slicedChirpBuffer,xe=this._a;if(x)for(let ce=0;ce>1,Ee=w[Ie];O[ce]=Ee*re[ce],O[ke]=Ee*re[ke]}else for(let ce=0;ce=$.length&&(we=2*($.length-1)-we),x[oe++]=$[we]}x.sort(),w[ae]=x[O]}return w}function W($,S){const w=Math.pow(10,S);return Math.round($*w)/w}function U($){const S=Math.round($);return Math.abs($)%1===.5?S%2===0?S:S-1:S}function X($){const S=$.length,w=$[0].length,x=[S+1,w+1],O=Array.from({length:x[0]},()=>Array(x[1]).fill(1/0));O[0][0]=0;const ae=Array.from({length:x[0]},()=>Array(x[1]).fill(-1));for(let xe=1;xe0||ve>0;)switch(we.push(oe-1),re.push(ve-1),ae[oe][ve]){case 0:--oe,--ve;break;case 1:--oe;break;case 2:--ve;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${oe}, ${ve}]. Please file a bug report.`)}return we.reverse(),re.reverse(),[we,re]}},"./src/utils/tensor.js":(Le,I,r)=>{r.r(I),r.d(I,{Tensor:()=>R,cat:()=>w,full:()=>re,full_like:()=>xe,interpolate:()=>y,interpolate_4d:()=>M,layer_norm:()=>U,matmul:()=>b,mean:()=>oe,mean_pooling:()=>W,ones:()=>ce,ones_like:()=>ke,permute:()=>v,quantize_embeddings:()=>Ge,rand:()=>tt,rfft:()=>A,slice:()=>ne,stack:()=>x,std_mean:()=>ae,topk:()=>K,zeros:()=>Ie,zeros_like:()=>Ee});var f=r("./src/utils/maths.js"),D=r("./src/backends/onnx.js"),j=r("./src/ops/registry.js");const Y=Object.freeze({float32:Float32Array,float16:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class R{constructor(...J){_e(this,"ort_tensor");return(0,D.isONNXTensor)(J[0])?this.ort_tensor=J[0]:this.ort_tensor=new D.Tensor(J[0],J[1],J[2]),new Proxy(this,{get:(de,Ce)=>{if(typeof Ce=="string"){let Be=Number(Ce);if(Number.isInteger(Be))return de._getitem(Be)}return de[Ce]},set:(de,Ce,Be)=>de[Ce]=Be})}get dims(){return this.ort_tensor.dims}set dims(J){this.ort_tensor.dims=J}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){const[J,...de]=this.dims;if(de.length>0){const Ce=de.reduce((Be,Ze)=>Be*Ze);for(let Be=0;Be0){const Be=Ce.reduce((Ze,se)=>Ze*se);return this._subarray(J,Be,Ce)}else return new R(this.type,[this.data[J]],Ce)}indexOf(J){const de=this.data;for(let Ce=0;CeVe)throw new Error(`Invalid slice: ${Te}`);const Ne=[Math.max(Ue,0),Math.min(Ve,this.dims[le])];Ce.push(Ne),de.push(Ne[1]-Ne[0])}else throw new Error(`Invalid slice: ${Te}`)}const Be=Ce.map(([le,Te])=>Te-le),Ze=Be.reduce((le,Te)=>le*Te),se=this.data,Ke=new se.constructor(Ze),je=this.stride();for(let le=0;le=0;--Ue){const Ne=Be[Ue];Te+=(Ve%Ne+Ce[Ue][0])*je[Ue],Ve=Math.floor(Ve/Ne)}Ke[le]=se[Te]}return new R(this.type,Ke,de)}permute(...J){return v(this,J)}transpose(...J){return this.permute(...J)}sum(J=null,de=!1){return this.norm(1,J,de)}norm(J="fro",de=null,Ce=!1){if(J==="fro")J=2;else if(typeof J=="string")throw Error(`Unsupported norm: ${J}`);const Be=this.data,Ze=(le,Te)=>le+Te**J;if(de===null){const le=Be.reduce(Ze,0)**(1/J);return new R(this.type,[le],[])}const[se,Ke,je]=O(Ze,this,de,Ce);if(J!==1)for(let le=0;le=0;--je){const Ue=this.dims[je];if(je!==de){const Ve=le%Ue;Ke+=Ve*Te,Te*=this.dims[je]}le=Math.floor(le/Ue)}Be[se]/=Ze[Ke]}return this}normalize(J=2,de=1){return this.clone().normalize_(J,de)}stride(){return ve(this.dims)}squeeze(J=null){return new R(this.type,this.data,X(this.dims,J))}squeeze_(J=null){return this.dims=X(this.dims,J),this}unsqueeze(J=null){return new R(this.type,this.data,$(this.dims,J))}unsqueeze_(J=null){return this.dims=$(this.dims,J),this}flatten_(J=0,de=-1){de=(de+this.dims.length)%this.dims.length;let Ce=this.dims.slice(0,J),Be=this.dims.slice(J,de+1),Ze=this.dims.slice(de+1);return this.dims=[...Ce,Be.reduce((se,Ke)=>se*Ke,1),...Ze],this}flatten(J=0,de=-1){return this.clone().flatten_(J,de)}view(...J){let de=-1;for(let Be=0;BeKe!==de?Ze*se:Ze,1);J[de]=Ce.length/Be}return new R(this.type,Ce,J)}neg_(){const J=this.data;for(let de=0;deJ?1:0;return new R("bool",de,this.dims)}lt(J){const de=new Uint8Array(this.data.length),Ce=this.data;for(let Be=0;BeMath.min(se,Ke),this,J,de,1/0);return new R(Ce,Be,Ze)}max(J=null,de=!1){if(J===null){const se=(0,f.max)(this.data)[0];return new R(this.type,[se],[])}const[Ce,Be,Ze]=O((se,Ke)=>Math.max(se,Ke),this,J,de,-1/0);return new R(Ce,Be,Ze)}argmin(J=null,de=!1){if(J!==null)throw new Error("`dim !== null` not yet implemented.");const Ce=(0,f.min)(this.data)[1];return new R("int64",[BigInt(Ce)],[])}argmax(J=null,de=!1){if(J!==null)throw new Error("`dim !== null` not yet implemented.");const Ce=(0,f.max)(this.data)[1];return new R("int64",[BigInt(Ce)],[])}to(J){if(this.type===J)return this;if(!Y.hasOwnProperty(J))throw new Error(`Unsupported type: ${J}`);let de;const Ce=["int64","uint64"].includes(this.type),Be=["int64","uint64"].includes(J);return Ce&&!Be?de=Number:!Ce&&Be&&(de=BigInt),new R(J,Y[J].from(this.data,de),this.dims)}}function g(ye,J){const de=ye.length,Ce=J.reduce((Ze,se)=>Ze*se);if(de!==Ce)throw Error(`cannot reshape array of size ${de} into shape (${J})`);let Be=ye;for(let Ze=J.length-1;Ze>=0;Ze--)Be=Be.reduce((se,Ke)=>{let je=se[se.length-1];return je.lengthnew R("int64",ye,[ye.length]);async function ne(ye,J,de,Ce,Be){return await(await j.TensorOpRegistry.slice)({x:ye,s:te(J),e:te(de),a:te(Ce),t:te(Be??new Array(Ce.length).fill(1))})}function W(ye,J){const de=ye.data,Ce=J.data,Be=[ye.dims[0],ye.dims[2]],Ze=new de.constructor(Be[0]*Be[1]),[se,Ke,je]=ye.dims;let le=0;for(let Te=0;Tede!==1):typeof J=="number"?ye[J]===1&&ye.splice(J,1):Array.isArray(J)&&(ye=ye.filter((de,Ce)=>de!==1||!J.includes(Ce))),ye}function $(ye,J){return J=S(J,ye.length+1),ye=ye.slice(),ye.splice(J,0,1),ye}function S(ye,J,de=null,Ce=!0){if(Ce&&(ye<-J||ye>=J))throw new Error(`IndexError: index ${ye} is out of bounds for dimension${de===null?"":" "+de} with size ${J}`);return ye<0&&(ye=(ye%J+J)%J),ye}function w(ye,J=0){J=S(J,ye[0].dims.length);const de=ye[0].dims.slice();de[J]=ye.reduce((se,Ke)=>se+Ke.dims[J],0);const Ce=de.reduce((se,Ke)=>se*Ke,1),Be=new ye[0].data.constructor(Ce),Ze=ye[0].type;if(J===0){let se=0;for(const Ke of ye){const je=Ke.data;Be.set(je,se),se+=je.length}}else{let se=0;for(let Ke=0;Ke=0;--Ve){const st=le[Ve];let dt=Ne%st;Ve===J&&(dt+=se),Ue+=dt*Re,Re*=de[Ve],Ne=Math.floor(Ne/st)}Be[Ue]=je[Te]}se+=le[J]}}return new R(Ze,Be,de)}function x(ye,J=0){return w(ye.map(de=>de.unsqueeze(J)),J)}function O(ye,J,de=null,Ce=!1,Be=null){const Ze=J.data,se=J.dims;de=S(de,se.length);const Ke=se.slice();Ke[de]=1;const je=new Ze.constructor(Ze.length/se[de]);Be!==null&&je.fill(Be);for(let le=0;le=0;--Ue){const Re=se[Ue];if(Ue!==de){const st=Ve%Re;Te+=st*Ne,Ne*=Ke[Ue]}Ve=Math.floor(Ve/Re)}je[Te]=ye(je[Te],Ze[le],le,Te)}return Ce||Ke.splice(de,1),[J.type,je,Ke]}function ae(ye,J=null,de=1,Ce=!1){const Be=ye.data,Ze=ye.dims;if(J===null){const Ne=Be.reduce((ct,lt)=>ct+lt,0)/Be.length,Re=Math.sqrt(Be.reduce((ct,lt)=>ct+(lt-Ne)**2,0)/(Be.length-de)),st=new R(ye.type,[Ne],[]);return[new R(ye.type,[Re],[]),st]}J=S(J,Ze.length);const se=oe(ye,J,Ce),Ke=se.data,[je,le,Te]=O((Ve,Ne,Re,st)=>Ve+(Ne-Ke[st])**2,ye,J,Ce);for(let Ve=0;Vele+Te,0);return new R(ye.type,[je/Be.length],[])}J=S(J,Ce.length);const[Ze,se,Ke]=O((je,le)=>je+le,ye,J,de);if(Ce[J]!==1)for(let je=0;je=0;--de)J[de]=Ce,Ce*=ye[de];return J}function we(ye,J,de,Ce){const Be=ye.reduce((Ze,se)=>Ze*se,1);return new R(de,new Ce(Be).fill(J),ye)}function re(ye,J){let de,Ce;if(typeof J=="number")de="float32",Ce=Float32Array;else if(typeof J=="bigint")de="int64",Ce=BigInt64Array;else if(typeof J=="boolean")de="bool",Ce=Uint8Array;else throw new Error(`Unsupported data type: ${typeof J}`);return we(ye,J,de,Ce)}function xe(ye,J){return re(ye.dims,J)}function ce(ye){return we(ye,1n,"int64",BigInt64Array)}function ke(ye){return ce(ye.dims)}function Ie(ye){return we(ye,0n,"int64",BigInt64Array)}function Ee(ye){return Ie(ye.dims)}function tt(ye){const J=ye.reduce((de,Ce)=>de*Ce,1);return new R("float32",Float32Array.from({length:J},()=>Math.random()),ye)}function Ge(ye,J){if(ye.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(ye.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(J))throw new Error("The precision must be either 'binary' or 'ubinary'");const de=J==="binary",Ce=de?"int8":"uint8",Be=de?Int8Array:Uint8Array,Ze=ye.data,se=new Be(Ze.length/8);for(let Ke=0;Ke0?1:0,le=Math.floor(Ke/8),Te=Ke%8;se[le]|=je<<7-Te,de&&Te===0&&(se[le]-=128)}return new R(Ce,se,[ye.dims[0],ye.dims[1]/8])}}},to={};function gs(Le){var I=to[Le];if(I!==void 0)return I.exports;var r=to[Le]={exports:{}};return Xr[Le](r,r.exports,gs),r.exports}gs.m=Xr,(()=>{var Le=Object.getPrototypeOf?r=>Object.getPrototypeOf(r):r=>r.__proto__,I;gs.t=function(r,f){if(f&1&&(r=this(r)),f&8||typeof r=="object"&&r&&(f&4&&r.__esModule||f&16&&typeof r.then=="function"))return r;var D=Object.create(null);gs.r(D);var j={};I=I||[null,Le({}),Le([]),Le(Le)];for(var Y=f&2&&r;typeof Y=="object"&&!~I.indexOf(Y);Y=Le(Y))Object.getOwnPropertyNames(Y).forEach(R=>j[R]=()=>r[R]);return j.default=()=>r,gs.d(D,j),D}})(),gs.d=(Le,I)=>{for(var r in I)gs.o(I,r)&&!gs.o(Le,r)&&Object.defineProperty(Le,r,{enumerable:!0,get:I[r]})},gs.o=(Le,I)=>Object.prototype.hasOwnProperty.call(Le,I),gs.r=Le=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Le,"__esModule",{value:!0})},(()=>{var Le;if(typeof self.location.href=="string"&&(Le=self.location.href),!Le)throw new Error("Automatic publicPath is not supported in this browser");Le=Le.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),gs.p=Le})(),gs.b=new URL("./",self.location.href);var c={};(()=>{/*!*****************************!*\ !*** ./src/transformers.js ***! - \*****************************/gs.r(c),gs.d(c,{ASTFeatureExtractor:()=>y.ASTFeatureExtractor,ASTForAudioClassification:()=>r.ASTForAudioClassification,ASTModel:()=>r.ASTModel,ASTPreTrainedModel:()=>r.ASTPreTrainedModel,AlbertForMaskedLM:()=>r.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>r.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>r.AlbertForSequenceClassification,AlbertModel:()=>r.AlbertModel,AlbertPreTrainedModel:()=>r.AlbertPreTrainedModel,AlbertTokenizer:()=>f.AlbertTokenizer,AudioClassificationPipeline:()=>I.AudioClassificationPipeline,AutoConfig:()=>D.AutoConfig,AutoFeatureExtractor:()=>M.AutoFeatureExtractor,AutoImageProcessor:()=>K.AutoImageProcessor,AutoModel:()=>r.AutoModel,AutoModelForAudioClassification:()=>r.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>r.AutoModelForAudioFrameClassification,AutoModelForCTC:()=>r.AutoModelForCTC,AutoModelForCausalLM:()=>r.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>r.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>r.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>r.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>r.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>r.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>r.AutoModelForImageSegmentation,AutoModelForImageToImage:()=>r.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>r.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>r.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>r.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>r.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>r.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>r.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>r.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>r.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>r.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>r.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>r.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>r.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>r.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>r.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>r.AutoModelForVision2Seq,AutoModelForXVector:()=>r.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>r.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>W.AutoProcessor,AutoTokenizer:()=>f.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>I.AutomaticSpeechRecognitionPipeline,BartForConditionalGeneration:()=>r.BartForConditionalGeneration,BartForSequenceClassification:()=>r.BartForSequenceClassification,BartModel:()=>r.BartModel,BartPretrainedModel:()=>r.BartPretrainedModel,BartTokenizer:()=>f.BartTokenizer,BaseModelOutput:()=>r.BaseModelOutput,BaseStreamer:()=>U.BaseStreamer,BeitFeatureExtractor:()=>A.BeitFeatureExtractor,BeitForImageClassification:()=>r.BeitForImageClassification,BeitModel:()=>r.BeitModel,BeitPreTrainedModel:()=>r.BeitPreTrainedModel,BertForMaskedLM:()=>r.BertForMaskedLM,BertForQuestionAnswering:()=>r.BertForQuestionAnswering,BertForSequenceClassification:()=>r.BertForSequenceClassification,BertForTokenClassification:()=>r.BertForTokenClassification,BertModel:()=>r.BertModel,BertPreTrainedModel:()=>r.BertPreTrainedModel,BertTokenizer:()=>f.BertTokenizer,BitImageProcessor:()=>A.BitImageProcessor,BlenderbotForConditionalGeneration:()=>r.BlenderbotForConditionalGeneration,BlenderbotModel:()=>r.BlenderbotModel,BlenderbotPreTrainedModel:()=>r.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>r.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>r.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>r.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>f.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>f.BlenderbotTokenizer,BloomForCausalLM:()=>r.BloomForCausalLM,BloomModel:()=>r.BloomModel,BloomPreTrainedModel:()=>r.BloomPreTrainedModel,BloomTokenizer:()=>f.BloomTokenizer,CLIPFeatureExtractor:()=>A.CLIPFeatureExtractor,CLIPImageProcessor:()=>A.CLIPImageProcessor,CLIPModel:()=>r.CLIPModel,CLIPPreTrainedModel:()=>r.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>r.CLIPSegForImageSegmentation,CLIPSegModel:()=>r.CLIPSegModel,CLIPSegPreTrainedModel:()=>r.CLIPSegPreTrainedModel,CLIPTextModel:()=>r.CLIPTextModel,CLIPTextModelWithProjection:()=>r.CLIPTextModelWithProjection,CLIPTokenizer:()=>f.CLIPTokenizer,CLIPVisionModel:()=>r.CLIPVisionModel,CLIPVisionModelWithProjection:()=>r.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>r.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>r.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>r.CamembertForSequenceClassification,CamembertForTokenClassification:()=>r.CamembertForTokenClassification,CamembertModel:()=>r.CamembertModel,CamembertPreTrainedModel:()=>r.CamembertPreTrainedModel,CamembertTokenizer:()=>f.CamembertTokenizer,CausalLMOutput:()=>r.CausalLMOutput,CausalLMOutputWithPast:()=>r.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>A.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>r.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>r.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>r.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>y.ClapFeatureExtractor,ClapModel:()=>r.ClapModel,ClapPreTrainedModel:()=>r.ClapPreTrainedModel,ClapTextModelWithProjection:()=>r.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>$.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>r.CodeGenForCausalLM,CodeGenModel:()=>r.CodeGenModel,CodeGenPreTrainedModel:()=>r.CodeGenPreTrainedModel,CodeGenTokenizer:()=>f.CodeGenTokenizer,CodeLlamaTokenizer:()=>f.CodeLlamaTokenizer,CohereForCausalLM:()=>r.CohereForCausalLM,CohereModel:()=>r.CohereModel,CoherePreTrainedModel:()=>r.CoherePreTrainedModel,CohereTokenizer:()=>f.CohereTokenizer,ConvBertForMaskedLM:()=>r.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>r.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>r.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>r.ConvBertForTokenClassification,ConvBertModel:()=>r.ConvBertModel,ConvBertPreTrainedModel:()=>r.ConvBertPreTrainedModel,ConvBertTokenizer:()=>f.ConvBertTokenizer,ConvNextFeatureExtractor:()=>A.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>r.ConvNextForImageClassification,ConvNextImageProcessor:()=>A.ConvNextImageProcessor,ConvNextModel:()=>r.ConvNextModel,ConvNextPreTrainedModel:()=>r.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>r.ConvNextV2ForImageClassification,ConvNextV2Model:()=>r.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>r.ConvNextV2PreTrainedModel,DPTFeatureExtractor:()=>A.DPTFeatureExtractor,DPTForDepthEstimation:()=>r.DPTForDepthEstimation,DPTImageProcessor:()=>A.DPTImageProcessor,DPTModel:()=>r.DPTModel,DPTPreTrainedModel:()=>r.DPTPreTrainedModel,DebertaForMaskedLM:()=>r.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>r.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>r.DebertaForSequenceClassification,DebertaForTokenClassification:()=>r.DebertaForTokenClassification,DebertaModel:()=>r.DebertaModel,DebertaPreTrainedModel:()=>r.DebertaPreTrainedModel,DebertaTokenizer:()=>f.DebertaTokenizer,DebertaV2ForMaskedLM:()=>r.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>r.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>r.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>r.DebertaV2ForTokenClassification,DebertaV2Model:()=>r.DebertaV2Model,DebertaV2PreTrainedModel:()=>r.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>f.DebertaV2Tokenizer,DecisionTransformerModel:()=>r.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>r.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>A.DeiTFeatureExtractor,DeiTForImageClassification:()=>r.DeiTForImageClassification,DeiTImageProcessor:()=>A.DeiTImageProcessor,DeiTModel:()=>r.DeiTModel,DeiTPreTrainedModel:()=>r.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>r.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>r.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>I.DepthEstimationPipeline,DepthProForDepthEstimation:()=>r.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>r.DepthProPreTrainedModel,DetrFeatureExtractor:()=>A.DetrFeatureExtractor,DetrForObjectDetection:()=>r.DetrForObjectDetection,DetrForSegmentation:()=>r.DetrForSegmentation,DetrImageProcessor:()=>A.DetrImageProcessor,DetrModel:()=>r.DetrModel,DetrObjectDetectionOutput:()=>r.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>r.DetrPreTrainedModel,DetrSegmentationOutput:()=>r.DetrSegmentationOutput,Dinov2ForImageClassification:()=>r.Dinov2ForImageClassification,Dinov2Model:()=>r.Dinov2Model,Dinov2PreTrainedModel:()=>r.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>r.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>r.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>r.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>r.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>r.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>r.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>r.DistilBertForTokenClassification,DistilBertModel:()=>r.DistilBertModel,DistilBertPreTrainedModel:()=>r.DistilBertPreTrainedModel,DistilBertTokenizer:()=>f.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>I.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>A.DonutFeatureExtractor,DonutImageProcessor:()=>A.DonutImageProcessor,DonutSwinModel:()=>r.DonutSwinModel,DonutSwinPreTrainedModel:()=>r.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>r.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>A.EfficientNetImageProcessor,EfficientNetModel:()=>r.EfficientNetModel,EfficientNetPreTrainedModel:()=>r.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>r.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>r.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>r.ElectraForSequenceClassification,ElectraForTokenClassification:()=>r.ElectraForTokenClassification,ElectraModel:()=>r.ElectraModel,ElectraPreTrainedModel:()=>r.ElectraPreTrainedModel,ElectraTokenizer:()=>f.ElectraTokenizer,EosTokenCriteria:()=>X.EosTokenCriteria,EsmForMaskedLM:()=>r.EsmForMaskedLM,EsmForSequenceClassification:()=>r.EsmForSequenceClassification,EsmForTokenClassification:()=>r.EsmForTokenClassification,EsmModel:()=>r.EsmModel,EsmPreTrainedModel:()=>r.EsmPreTrainedModel,EsmTokenizer:()=>f.EsmTokenizer,ExaoneForCausalLM:()=>r.ExaoneForCausalLM,ExaoneModel:()=>r.ExaoneModel,ExaonePreTrainedModel:()=>r.ExaonePreTrainedModel,FFT:()=>g.FFT,FalconForCausalLM:()=>r.FalconForCausalLM,FalconModel:()=>r.FalconModel,FalconPreTrainedModel:()=>r.FalconPreTrainedModel,FalconTokenizer:()=>f.FalconTokenizer,FastViTForImageClassification:()=>r.FastViTForImageClassification,FastViTModel:()=>r.FastViTModel,FastViTPreTrainedModel:()=>r.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>I.FeatureExtractionPipeline,FeatureExtractor:()=>v.FeatureExtractor,FillMaskPipeline:()=>I.FillMaskPipeline,Florence2ForConditionalGeneration:()=>r.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>r.Florence2PreTrainedModel,Florence2Processor:()=>ne.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>$.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>$.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>A.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>r.GLPNForDepthEstimation,GLPNModel:()=>r.GLPNModel,GLPNPreTrainedModel:()=>r.GLPNPreTrainedModel,GPT2LMHeadModel:()=>r.GPT2LMHeadModel,GPT2Model:()=>r.GPT2Model,GPT2PreTrainedModel:()=>r.GPT2PreTrainedModel,GPT2Tokenizer:()=>f.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>r.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>r.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>r.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>r.GPTJForCausalLM,GPTJModel:()=>r.GPTJModel,GPTJPreTrainedModel:()=>r.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>r.GPTNeoForCausalLM,GPTNeoModel:()=>r.GPTNeoModel,GPTNeoPreTrainedModel:()=>r.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>r.GPTNeoXForCausalLM,GPTNeoXModel:()=>r.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>r.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>f.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>r.Gemma2ForCausalLM,Gemma2Model:()=>r.Gemma2Model,Gemma2PreTrainedModel:()=>r.Gemma2PreTrainedModel,GemmaForCausalLM:()=>r.GemmaForCausalLM,GemmaModel:()=>r.GemmaModel,GemmaPreTrainedModel:()=>r.GemmaPreTrainedModel,GemmaTokenizer:()=>f.GemmaTokenizer,GraniteForCausalLM:()=>r.GraniteForCausalLM,GraniteModel:()=>r.GraniteModel,GranitePreTrainedModel:()=>r.GranitePreTrainedModel,Grok1Tokenizer:()=>f.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>r.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>A.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>r.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>ne.GroundingDinoProcessor,GroupViTModel:()=>r.GroupViTModel,GroupViTPreTrainedModel:()=>r.GroupViTPreTrainedModel,HerbertTokenizer:()=>f.HerbertTokenizer,HieraForImageClassification:()=>r.HieraForImageClassification,HieraModel:()=>r.HieraModel,HieraPreTrainedModel:()=>r.HieraPreTrainedModel,HubertForCTC:()=>r.HubertForCTC,HubertForSequenceClassification:()=>r.HubertForSequenceClassification,HubertModel:()=>r.HubertModel,HubertPreTrainedModel:()=>r.HubertPreTrainedModel,IJepaForImageClassification:()=>r.IJepaForImageClassification,IJepaModel:()=>r.IJepaModel,IJepaPreTrainedModel:()=>r.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>r.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>A.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>r.Idefics3PreTrainedModel,Idefics3Processor:()=>ne.Idefics3Processor,ImageClassificationPipeline:()=>I.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>I.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>y.ImageFeatureExtractor,ImageMattingOutput:()=>r.ImageMattingOutput,ImageProcessor:()=>b.ImageProcessor,ImageSegmentationPipeline:()=>I.ImageSegmentationPipeline,ImageToImagePipeline:()=>I.ImageToImagePipeline,ImageToTextPipeline:()=>I.ImageToTextPipeline,InterruptableStoppingCriteria:()=>X.InterruptableStoppingCriteria,JAISLMHeadModel:()=>r.JAISLMHeadModel,JAISModel:()=>r.JAISModel,JAISPreTrainedModel:()=>r.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>A.JinaCLIPImageProcessor,JinaCLIPModel:()=>r.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>r.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>ne.JinaCLIPProcessor,JinaCLIPTextModel:()=>r.JinaCLIPTextModel,JinaCLIPVisionModel:()=>r.JinaCLIPVisionModel,LlamaForCausalLM:()=>r.LlamaForCausalLM,LlamaModel:()=>r.LlamaModel,LlamaPreTrainedModel:()=>r.LlamaPreTrainedModel,LlamaTokenizer:()=>f.LlamaTokenizer,LlavaForConditionalGeneration:()=>r.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>r.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>A.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>r.LlavaPreTrainedModel,LogitsProcessor:()=>$.LogitsProcessor,LogitsProcessorList:()=>$.LogitsProcessorList,LogitsWarper:()=>$.LogitsWarper,LongT5ForConditionalGeneration:()=>r.LongT5ForConditionalGeneration,LongT5Model:()=>r.LongT5Model,LongT5PreTrainedModel:()=>r.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>r.M2M100ForConditionalGeneration,M2M100Model:()=>r.M2M100Model,M2M100PreTrainedModel:()=>r.M2M100PreTrainedModel,M2M100Tokenizer:()=>f.M2M100Tokenizer,MBart50Tokenizer:()=>f.MBart50Tokenizer,MBartForCausalLM:()=>r.MBartForCausalLM,MBartForConditionalGeneration:()=>r.MBartForConditionalGeneration,MBartForSequenceClassification:()=>r.MBartForSequenceClassification,MBartModel:()=>r.MBartModel,MBartPreTrainedModel:()=>r.MBartPreTrainedModel,MBartTokenizer:()=>f.MBartTokenizer,MPNetForMaskedLM:()=>r.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>r.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>r.MPNetForSequenceClassification,MPNetForTokenClassification:()=>r.MPNetForTokenClassification,MPNetModel:()=>r.MPNetModel,MPNetPreTrainedModel:()=>r.MPNetPreTrainedModel,MPNetTokenizer:()=>f.MPNetTokenizer,MT5ForConditionalGeneration:()=>r.MT5ForConditionalGeneration,MT5Model:()=>r.MT5Model,MT5PreTrainedModel:()=>r.MT5PreTrainedModel,MarianMTModel:()=>r.MarianMTModel,MarianModel:()=>r.MarianModel,MarianPreTrainedModel:()=>r.MarianPreTrainedModel,MarianTokenizer:()=>f.MarianTokenizer,Mask2FormerImageProcessor:()=>A.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>A.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>r.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>A.MaskFormerImageProcessor,MaskFormerModel:()=>r.MaskFormerModel,MaskFormerPreTrainedModel:()=>r.MaskFormerPreTrainedModel,MaskedLMOutput:()=>r.MaskedLMOutput,MaxLengthCriteria:()=>X.MaxLengthCriteria,MgpstrForSceneTextRecognition:()=>r.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>r.MgpstrModelOutput,MgpstrPreTrainedModel:()=>r.MgpstrPreTrainedModel,MgpstrProcessor:()=>ne.MgpstrProcessor,MgpstrTokenizer:()=>f.MgpstrTokenizer,MinLengthLogitsProcessor:()=>$.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>$.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>r.MistralForCausalLM,MistralModel:()=>r.MistralModel,MistralPreTrainedModel:()=>r.MistralPreTrainedModel,MobileBertForMaskedLM:()=>r.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>r.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>r.MobileBertForSequenceClassification,MobileBertModel:()=>r.MobileBertModel,MobileBertPreTrainedModel:()=>r.MobileBertPreTrainedModel,MobileBertTokenizer:()=>f.MobileBertTokenizer,MobileLLMForCausalLM:()=>r.MobileLLMForCausalLM,MobileLLMModel:()=>r.MobileLLMModel,MobileLLMPreTrainedModel:()=>r.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>A.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>r.MobileNetV1ForImageClassification,MobileNetV1ImageProcessor:()=>A.MobileNetV1ImageProcessor,MobileNetV1Model:()=>r.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>r.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>A.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>r.MobileNetV2ForImageClassification,MobileNetV2ImageProcessor:()=>A.MobileNetV2ImageProcessor,MobileNetV2Model:()=>r.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>r.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>A.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>r.MobileNetV3ForImageClassification,MobileNetV3ImageProcessor:()=>A.MobileNetV3ImageProcessor,MobileNetV3Model:()=>r.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>r.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>A.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>r.MobileNetV4ForImageClassification,MobileNetV4ImageProcessor:()=>A.MobileNetV4ImageProcessor,MobileNetV4Model:()=>r.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>r.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>A.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>r.MobileViTForImageClassification,MobileViTImageProcessor:()=>A.MobileViTImageProcessor,MobileViTModel:()=>r.MobileViTModel,MobileViTPreTrainedModel:()=>r.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>r.MobileViTV2ForImageClassification,MobileViTV2Model:()=>r.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>r.MobileViTV2PreTrainedModel,ModelOutput:()=>r.ModelOutput,ModernBertForMaskedLM:()=>r.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>r.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>r.ModernBertForTokenClassification,ModernBertModel:()=>r.ModernBertModel,ModernBertPreTrainedModel:()=>r.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>r.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>y.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>r.MoonshineForConditionalGeneration,MoonshineModel:()=>r.MoonshineModel,MoonshinePreTrainedModel:()=>r.MoonshinePreTrainedModel,MoonshineProcessor:()=>ne.MoonshineProcessor,MptForCausalLM:()=>r.MptForCausalLM,MptModel:()=>r.MptModel,MptPreTrainedModel:()=>r.MptPreTrainedModel,MultiModalityCausalLM:()=>r.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>r.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>r.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>r.MusicgenForConditionalGeneration,MusicgenModel:()=>r.MusicgenModel,MusicgenPreTrainedModel:()=>r.MusicgenPreTrainedModel,NllbTokenizer:()=>f.NllbTokenizer,NoBadWordsLogitsProcessor:()=>$.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>$.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>r.NomicBertModel,NomicBertPreTrainedModel:()=>r.NomicBertPreTrainedModel,NougatImageProcessor:()=>A.NougatImageProcessor,NougatTokenizer:()=>f.NougatTokenizer,OPTForCausalLM:()=>r.OPTForCausalLM,OPTModel:()=>r.OPTModel,OPTPreTrainedModel:()=>r.OPTPreTrainedModel,ObjectDetectionPipeline:()=>I.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>r.Olmo2ForCausalLM,Olmo2Model:()=>r.Olmo2Model,Olmo2PreTrainedModel:()=>r.Olmo2PreTrainedModel,OlmoForCausalLM:()=>r.OlmoForCausalLM,OlmoModel:()=>r.OlmoModel,OlmoPreTrainedModel:()=>r.OlmoPreTrainedModel,OpenELMForCausalLM:()=>r.OpenELMForCausalLM,OpenELMModel:()=>r.OpenELMModel,OpenELMPreTrainedModel:()=>r.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>A.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>r.OwlViTForObjectDetection,OwlViTImageProcessor:()=>A.OwlViTImageProcessor,OwlViTModel:()=>r.OwlViTModel,OwlViTPreTrainedModel:()=>r.OwlViTPreTrainedModel,OwlViTProcessor:()=>ne.OwlViTProcessor,Owlv2ForObjectDetection:()=>r.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>A.Owlv2ImageProcessor,Owlv2Model:()=>r.Owlv2Model,Owlv2PreTrainedModel:()=>r.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>r.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>r.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>ne.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>r.PatchTSMixerForPrediction,PatchTSMixerModel:()=>r.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>r.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>r.PatchTSTForPrediction,PatchTSTModel:()=>r.PatchTSTModel,PatchTSTPreTrainedModel:()=>r.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>r.Phi3ForCausalLM,Phi3Model:()=>r.Phi3Model,Phi3PreTrainedModel:()=>r.Phi3PreTrainedModel,Phi3VForCausalLM:()=>r.Phi3VForCausalLM,Phi3VImageProcessor:()=>A.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>r.Phi3VPreTrainedModel,Phi3VProcessor:()=>ne.Phi3VProcessor,PhiForCausalLM:()=>r.PhiForCausalLM,PhiModel:()=>r.PhiModel,PhiPreTrainedModel:()=>r.PhiPreTrainedModel,Pipeline:()=>I.Pipeline,PreTrainedModel:()=>r.PreTrainedModel,PreTrainedTokenizer:()=>f.PreTrainedTokenizer,PretrainedConfig:()=>D.PretrainedConfig,PretrainedMixin:()=>r.PretrainedMixin,Processor:()=>te.Processor,PvtForImageClassification:()=>r.PvtForImageClassification,PvtImageProcessor:()=>A.PvtImageProcessor,PvtModel:()=>r.PvtModel,PvtPreTrainedModel:()=>r.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>y.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>r.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>r.PyAnnoteModel,PyAnnotePreTrainedModel:()=>r.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>ne.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>r.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>I.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>r.Qwen2ForCausalLM,Qwen2Model:()=>r.Qwen2Model,Qwen2PreTrainedModel:()=>r.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>f.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>r.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>A.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>r.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>ne.Qwen2VLProcessor,RTDetrForObjectDetection:()=>r.RTDetrForObjectDetection,RTDetrImageProcessor:()=>A.RTDetrImageProcessor,RTDetrModel:()=>r.RTDetrModel,RTDetrObjectDetectionOutput:()=>r.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>r.RTDetrPreTrainedModel,RawAudio:()=>j.RawAudio,RawImage:()=>Y.RawImage,RepetitionPenaltyLogitsProcessor:()=>$.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>r.ResNetForImageClassification,ResNetModel:()=>r.ResNetModel,ResNetPreTrainedModel:()=>r.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>r.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>r.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>r.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>r.RoFormerForTokenClassification,RoFormerModel:()=>r.RoFormerModel,RoFormerPreTrainedModel:()=>r.RoFormerPreTrainedModel,RoFormerTokenizer:()=>f.RoFormerTokenizer,RobertaForMaskedLM:()=>r.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>r.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>r.RobertaForSequenceClassification,RobertaForTokenClassification:()=>r.RobertaForTokenClassification,RobertaModel:()=>r.RobertaModel,RobertaPreTrainedModel:()=>r.RobertaPreTrainedModel,RobertaTokenizer:()=>f.RobertaTokenizer,SamImageProcessor:()=>A.SamImageProcessor,SamImageSegmentationOutput:()=>r.SamImageSegmentationOutput,SamModel:()=>r.SamModel,SamPreTrainedModel:()=>r.SamPreTrainedModel,SamProcessor:()=>ne.SamProcessor,SapiensForDepthEstimation:()=>r.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>r.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>r.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>r.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>y.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>A.SegformerFeatureExtractor,SegformerForImageClassification:()=>r.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>r.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>A.SegformerImageProcessor,SegformerModel:()=>r.SegformerModel,SegformerPreTrainedModel:()=>r.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>r.Seq2SeqLMOutput,SequenceClassifierOutput:()=>r.SequenceClassifierOutput,SiglipImageProcessor:()=>A.SiglipImageProcessor,SiglipModel:()=>r.SiglipModel,SiglipPreTrainedModel:()=>r.SiglipPreTrainedModel,SiglipTextModel:()=>r.SiglipTextModel,SiglipTokenizer:()=>f.SiglipTokenizer,SiglipVisionModel:()=>r.SiglipVisionModel,SpeechT5FeatureExtractor:()=>y.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>r.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>r.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>r.SpeechT5HifiGan,SpeechT5Model:()=>r.SpeechT5Model,SpeechT5PreTrainedModel:()=>r.SpeechT5PreTrainedModel,SpeechT5Processor:()=>ne.SpeechT5Processor,SpeechT5Tokenizer:()=>f.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>r.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>r.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>r.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>r.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>r.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>f.SqueezeBertTokenizer,StableLmForCausalLM:()=>r.StableLmForCausalLM,StableLmModel:()=>r.StableLmModel,StableLmPreTrainedModel:()=>r.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>r.Starcoder2ForCausalLM,Starcoder2Model:()=>r.Starcoder2Model,Starcoder2PreTrainedModel:()=>r.Starcoder2PreTrainedModel,StoppingCriteria:()=>X.StoppingCriteria,StoppingCriteriaList:()=>X.StoppingCriteriaList,StyleTextToSpeech2Model:()=>r.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>r.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>I.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>$.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>r.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>A.Swin2SRImageProcessor,Swin2SRModel:()=>r.Swin2SRModel,Swin2SRPreTrainedModel:()=>r.Swin2SRPreTrainedModel,SwinForImageClassification:()=>r.SwinForImageClassification,SwinModel:()=>r.SwinModel,SwinPreTrainedModel:()=>r.SwinPreTrainedModel,T5ForConditionalGeneration:()=>r.T5ForConditionalGeneration,T5Model:()=>r.T5Model,T5PreTrainedModel:()=>r.T5PreTrainedModel,T5Tokenizer:()=>f.T5Tokenizer,TableTransformerForObjectDetection:()=>r.TableTransformerForObjectDetection,TableTransformerModel:()=>r.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>r.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>r.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>$.TemperatureLogitsWarper,Tensor:()=>R.Tensor,Text2TextGenerationPipeline:()=>I.Text2TextGenerationPipeline,TextClassificationPipeline:()=>I.TextClassificationPipeline,TextGenerationPipeline:()=>I.TextGenerationPipeline,TextStreamer:()=>U.TextStreamer,TextToAudioPipeline:()=>I.TextToAudioPipeline,TokenClassificationPipeline:()=>I.TokenClassificationPipeline,TokenClassifierOutput:()=>r.TokenClassifierOutput,TokenizerModel:()=>f.TokenizerModel,TopKLogitsWarper:()=>$.TopKLogitsWarper,TopPLogitsWarper:()=>$.TopPLogitsWarper,TrOCRForCausalLM:()=>r.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>r.TrOCRPreTrainedModel,TranslationPipeline:()=>I.TranslationPipeline,UniSpeechForCTC:()=>r.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>r.UniSpeechForSequenceClassification,UniSpeechModel:()=>r.UniSpeechModel,UniSpeechPreTrainedModel:()=>r.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>r.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>r.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>r.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>r.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>r.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>ne.VLChatProcessor,VLMImageProcessor:()=>A.VLMImageProcessor,ViTFeatureExtractor:()=>A.ViTFeatureExtractor,ViTForImageClassification:()=>r.ViTForImageClassification,ViTImageProcessor:()=>A.ViTImageProcessor,ViTMAEModel:()=>r.ViTMAEModel,ViTMAEPreTrainedModel:()=>r.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>r.ViTMSNForImageClassification,ViTMSNModel:()=>r.ViTMSNModel,ViTMSNPreTrainedModel:()=>r.ViTMSNPreTrainedModel,ViTModel:()=>r.ViTModel,ViTPreTrainedModel:()=>r.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>r.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>r.VitMatteForImageMatting,VitMatteImageProcessor:()=>A.VitMatteImageProcessor,VitMattePreTrainedModel:()=>r.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>r.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>A.VitPoseImageProcessor,VitPosePreTrainedModel:()=>r.VitPosePreTrainedModel,VitsModel:()=>r.VitsModel,VitsModelOutput:()=>r.VitsModelOutput,VitsPreTrainedModel:()=>r.VitsPreTrainedModel,VitsTokenizer:()=>f.VitsTokenizer,Wav2Vec2BertForCTC:()=>r.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>r.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>r.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>r.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>f.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>y.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>r.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>r.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>r.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>r.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>r.Wav2Vec2PreTrainedModel,Wav2Vec2ProcessorWithLM:()=>ne.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>r.WavLMForAudioFrameClassification,WavLMForCTC:()=>r.WavLMForCTC,WavLMForSequenceClassification:()=>r.WavLMForSequenceClassification,WavLMForXVector:()=>r.WavLMForXVector,WavLMModel:()=>r.WavLMModel,WavLMPreTrainedModel:()=>r.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>y.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>r.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>r.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>y.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>r.WhisperForConditionalGeneration,WhisperModel:()=>r.WhisperModel,WhisperPreTrainedModel:()=>r.WhisperPreTrainedModel,WhisperProcessor:()=>ne.WhisperProcessor,WhisperTextStreamer:()=>U.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>$.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>f.WhisperTokenizer,XLMForQuestionAnswering:()=>r.XLMForQuestionAnswering,XLMForSequenceClassification:()=>r.XLMForSequenceClassification,XLMForTokenClassification:()=>r.XLMForTokenClassification,XLMModel:()=>r.XLMModel,XLMPreTrainedModel:()=>r.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>r.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>r.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>r.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>r.XLMRobertaForTokenClassification,XLMRobertaModel:()=>r.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>r.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>f.XLMRobertaTokenizer,XLMTokenizer:()=>f.XLMTokenizer,XLMWithLMHeadModel:()=>r.XLMWithLMHeadModel,XVectorOutput:()=>r.XVectorOutput,YolosFeatureExtractor:()=>A.YolosFeatureExtractor,YolosForObjectDetection:()=>r.YolosForObjectDetection,YolosImageProcessor:()=>A.YolosImageProcessor,YolosModel:()=>r.YolosModel,YolosObjectDetectionOutput:()=>r.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>r.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>I.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>I.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>I.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>I.ZeroShotObjectDetectionPipeline,bankers_round:()=>g.bankers_round,cat:()=>R.cat,cos_sim:()=>g.cos_sim,dot:()=>g.dot,dynamic_time_warping:()=>g.dynamic_time_warping,env:()=>Le.env,full:()=>R.full,full_like:()=>R.full_like,getKeyValueShapes:()=>D.getKeyValueShapes,hamming:()=>j.hamming,hanning:()=>j.hanning,interpolate:()=>R.interpolate,interpolate_4d:()=>R.interpolate_4d,interpolate_data:()=>g.interpolate_data,is_chinese_char:()=>f.is_chinese_char,layer_norm:()=>R.layer_norm,load_image:()=>Y.load_image,log_softmax:()=>g.log_softmax,magnitude:()=>g.magnitude,matmul:()=>R.matmul,max:()=>g.max,mean:()=>R.mean,mean_pooling:()=>R.mean_pooling,medianFilter:()=>g.medianFilter,mel_filter_bank:()=>j.mel_filter_bank,min:()=>g.min,ones:()=>R.ones,ones_like:()=>R.ones_like,permute:()=>R.permute,permute_data:()=>g.permute_data,pipeline:()=>I.pipeline,quantize_embeddings:()=>R.quantize_embeddings,rand:()=>R.rand,read_audio:()=>j.read_audio,rfft:()=>R.rfft,round:()=>g.round,slice:()=>R.slice,softmax:()=>g.softmax,spectrogram:()=>j.spectrogram,stack:()=>R.stack,std_mean:()=>R.std_mean,topk:()=>R.topk,window_function:()=>j.window_function,zeros:()=>R.zeros,zeros_like:()=>R.zeros_like});var Le=gs("./src/env.js"),I=gs("./src/pipelines.js"),r=gs("./src/models.js"),f=gs("./src/tokenizers.js"),D=gs("./src/configs.js"),j=gs("./src/utils/audio.js"),Y=gs("./src/utils/image.js"),R=gs("./src/utils/tensor.js"),g=gs("./src/utils/maths.js"),v=gs("./src/base/feature_extraction_utils.js"),y=gs("./src/models/feature_extractors.js"),M=gs("./src/models/auto/feature_extraction_auto.js"),b=gs("./src/base/image_processors_utils.js"),A=gs("./src/models/image_processors.js"),K=gs("./src/models/auto/image_processing_auto.js"),te=gs("./src/base/processing_utils.js"),ne=gs("./src/models/processors.js"),W=gs("./src/models/auto/processing_auto.js"),U=gs("./src/generation/streamers.js"),X=gs("./src/generation/stopping_criteria.js"),$=gs("./src/generation/logits_process.js")})(),c.ASTFeatureExtractor,c.ASTForAudioClassification,c.ASTModel,c.ASTPreTrainedModel,c.AlbertForMaskedLM,c.AlbertForQuestionAnswering,c.AlbertForSequenceClassification,c.AlbertModel,c.AlbertPreTrainedModel,c.AlbertTokenizer,c.AudioClassificationPipeline,c.AutoConfig,c.AutoFeatureExtractor,c.AutoImageProcessor,c.AutoModel,c.AutoModelForAudioClassification,c.AutoModelForAudioFrameClassification,c.AutoModelForCTC;var r_=c.AutoModelForCausalLM;c.AutoModelForDepthEstimation,c.AutoModelForDocumentQuestionAnswering,c.AutoModelForImageClassification,c.AutoModelForImageFeatureExtraction,c.AutoModelForImageMatting,c.AutoModelForImageSegmentation,c.AutoModelForImageToImage,c.AutoModelForMaskGeneration,c.AutoModelForMaskedLM,c.AutoModelForNormalEstimation,c.AutoModelForObjectDetection,c.AutoModelForPoseEstimation,c.AutoModelForQuestionAnswering,c.AutoModelForSemanticSegmentation,c.AutoModelForSeq2SeqLM,c.AutoModelForSequenceClassification,c.AutoModelForSpeechSeq2Seq,c.AutoModelForTextToSpectrogram,c.AutoModelForTextToWaveform,c.AutoModelForTokenClassification,c.AutoModelForUniversalSegmentation,c.AutoModelForVision2Seq,c.AutoModelForXVector,c.AutoModelForZeroShotObjectDetection,c.AutoProcessor;var n_=c.AutoTokenizer;c.AutomaticSpeechRecognitionPipeline,c.BartForConditionalGeneration,c.BartForSequenceClassification,c.BartModel,c.BartPretrainedModel,c.BartTokenizer,c.BaseModelOutput,c.BaseStreamer,c.BeitFeatureExtractor,c.BeitForImageClassification,c.BeitModel,c.BeitPreTrainedModel,c.BertForMaskedLM,c.BertForQuestionAnswering,c.BertForSequenceClassification,c.BertForTokenClassification,c.BertModel,c.BertPreTrainedModel,c.BertTokenizer,c.BitImageProcessor,c.BlenderbotForConditionalGeneration,c.BlenderbotModel,c.BlenderbotPreTrainedModel,c.BlenderbotSmallForConditionalGeneration,c.BlenderbotSmallModel,c.BlenderbotSmallPreTrainedModel,c.BlenderbotSmallTokenizer,c.BlenderbotTokenizer,c.BloomForCausalLM,c.BloomModel,c.BloomPreTrainedModel,c.BloomTokenizer,c.CLIPFeatureExtractor,c.CLIPImageProcessor,c.CLIPModel,c.CLIPPreTrainedModel,c.CLIPSegForImageSegmentation,c.CLIPSegModel,c.CLIPSegPreTrainedModel,c.CLIPTextModel,c.CLIPTextModelWithProjection,c.CLIPTokenizer,c.CLIPVisionModel,c.CLIPVisionModelWithProjection,c.CamembertForMaskedLM,c.CamembertForQuestionAnswering,c.CamembertForSequenceClassification,c.CamembertForTokenClassification,c.CamembertModel,c.CamembertPreTrainedModel,c.CamembertTokenizer,c.CausalLMOutput,c.CausalLMOutputWithPast,c.ChineseCLIPFeatureExtractor,c.ChineseCLIPModel,c.ChineseCLIPPreTrainedModel,c.ClapAudioModelWithProjection,c.ClapFeatureExtractor,c.ClapModel,c.ClapPreTrainedModel,c.ClapTextModelWithProjection,c.ClassifierFreeGuidanceLogitsProcessor,c.CodeGenForCausalLM,c.CodeGenModel,c.CodeGenPreTrainedModel,c.CodeGenTokenizer,c.CodeLlamaTokenizer,c.CohereForCausalLM,c.CohereModel,c.CoherePreTrainedModel,c.CohereTokenizer,c.ConvBertForMaskedLM,c.ConvBertForQuestionAnswering,c.ConvBertForSequenceClassification,c.ConvBertForTokenClassification,c.ConvBertModel,c.ConvBertPreTrainedModel,c.ConvBertTokenizer,c.ConvNextFeatureExtractor,c.ConvNextForImageClassification,c.ConvNextImageProcessor,c.ConvNextModel,c.ConvNextPreTrainedModel,c.ConvNextV2ForImageClassification,c.ConvNextV2Model,c.ConvNextV2PreTrainedModel,c.DPTFeatureExtractor,c.DPTForDepthEstimation,c.DPTImageProcessor,c.DPTModel,c.DPTPreTrainedModel,c.DebertaForMaskedLM,c.DebertaForQuestionAnswering,c.DebertaForSequenceClassification,c.DebertaForTokenClassification,c.DebertaModel,c.DebertaPreTrainedModel,c.DebertaTokenizer,c.DebertaV2ForMaskedLM,c.DebertaV2ForQuestionAnswering,c.DebertaV2ForSequenceClassification,c.DebertaV2ForTokenClassification,c.DebertaV2Model,c.DebertaV2PreTrainedModel,c.DebertaV2Tokenizer,c.DecisionTransformerModel,c.DecisionTransformerPreTrainedModel,c.DeiTFeatureExtractor,c.DeiTForImageClassification,c.DeiTImageProcessor,c.DeiTModel,c.DeiTPreTrainedModel,c.DepthAnythingForDepthEstimation,c.DepthAnythingPreTrainedModel,c.DepthEstimationPipeline,c.DepthProForDepthEstimation,c.DepthProPreTrainedModel,c.DetrFeatureExtractor,c.DetrForObjectDetection,c.DetrForSegmentation,c.DetrImageProcessor,c.DetrModel,c.DetrObjectDetectionOutput,c.DetrPreTrainedModel,c.DetrSegmentationOutput,c.Dinov2ForImageClassification,c.Dinov2Model,c.Dinov2PreTrainedModel,c.Dinov2WithRegistersForImageClassification,c.Dinov2WithRegistersModel,c.Dinov2WithRegistersPreTrainedModel,c.DistilBertForMaskedLM,c.DistilBertForQuestionAnswering,c.DistilBertForSequenceClassification,c.DistilBertForTokenClassification,c.DistilBertModel,c.DistilBertPreTrainedModel,c.DistilBertTokenizer,c.DocumentQuestionAnsweringPipeline,c.DonutFeatureExtractor,c.DonutImageProcessor,c.DonutSwinModel,c.DonutSwinPreTrainedModel,c.EfficientNetForImageClassification,c.EfficientNetImageProcessor,c.EfficientNetModel,c.EfficientNetPreTrainedModel,c.ElectraForMaskedLM,c.ElectraForQuestionAnswering,c.ElectraForSequenceClassification,c.ElectraForTokenClassification,c.ElectraModel,c.ElectraPreTrainedModel,c.ElectraTokenizer,c.EosTokenCriteria,c.EsmForMaskedLM,c.EsmForSequenceClassification,c.EsmForTokenClassification,c.EsmModel,c.EsmPreTrainedModel,c.EsmTokenizer,c.ExaoneForCausalLM,c.ExaoneModel,c.ExaonePreTrainedModel,c.FFT,c.FalconForCausalLM,c.FalconModel,c.FalconPreTrainedModel,c.FalconTokenizer,c.FastViTForImageClassification,c.FastViTModel,c.FastViTPreTrainedModel,c.FeatureExtractionPipeline,c.FeatureExtractor,c.FillMaskPipeline,c.Florence2ForConditionalGeneration,c.Florence2PreTrainedModel,c.Florence2Processor,c.ForcedBOSTokenLogitsProcessor,c.ForcedEOSTokenLogitsProcessor,c.GLPNFeatureExtractor,c.GLPNForDepthEstimation,c.GLPNModel,c.GLPNPreTrainedModel,c.GPT2LMHeadModel,c.GPT2Model,c.GPT2PreTrainedModel,c.GPT2Tokenizer,c.GPTBigCodeForCausalLM,c.GPTBigCodeModel,c.GPTBigCodePreTrainedModel,c.GPTJForCausalLM,c.GPTJModel,c.GPTJPreTrainedModel,c.GPTNeoForCausalLM,c.GPTNeoModel,c.GPTNeoPreTrainedModel,c.GPTNeoXForCausalLM,c.GPTNeoXModel,c.GPTNeoXPreTrainedModel,c.GPTNeoXTokenizer,c.Gemma2ForCausalLM,c.Gemma2Model,c.Gemma2PreTrainedModel,c.GemmaForCausalLM,c.GemmaModel,c.GemmaPreTrainedModel,c.GemmaTokenizer,c.GraniteForCausalLM,c.GraniteModel,c.GranitePreTrainedModel,c.Grok1Tokenizer,c.GroundingDinoForObjectDetection,c.GroundingDinoImageProcessor,c.GroundingDinoPreTrainedModel,c.GroundingDinoProcessor,c.GroupViTModel,c.GroupViTPreTrainedModel,c.HerbertTokenizer,c.HieraForImageClassification,c.HieraModel,c.HieraPreTrainedModel,c.HubertForCTC,c.HubertForSequenceClassification,c.HubertModel,c.HubertPreTrainedModel,c.IJepaForImageClassification,c.IJepaModel,c.IJepaPreTrainedModel,c.Idefics3ForConditionalGeneration,c.Idefics3ImageProcessor,c.Idefics3PreTrainedModel,c.Idefics3Processor,c.ImageClassificationPipeline,c.ImageFeatureExtractionPipeline,c.ImageFeatureExtractor,c.ImageMattingOutput,c.ImageProcessor,c.ImageSegmentationPipeline,c.ImageToImagePipeline,c.ImageToTextPipeline;var o_=c.InterruptableStoppingCriteria;c.JAISLMHeadModel,c.JAISModel,c.JAISPreTrainedModel,c.JinaCLIPImageProcessor,c.JinaCLIPModel,c.JinaCLIPPreTrainedModel,c.JinaCLIPProcessor,c.JinaCLIPTextModel,c.JinaCLIPVisionModel,c.LlamaForCausalLM,c.LlamaModel,c.LlamaPreTrainedModel,c.LlamaTokenizer,c.LlavaForConditionalGeneration,c.LlavaOnevisionForConditionalGeneration,c.LlavaOnevisionImageProcessor,c.LlavaPreTrainedModel,c.LogitsProcessor,c.LogitsProcessorList,c.LogitsWarper,c.LongT5ForConditionalGeneration,c.LongT5Model,c.LongT5PreTrainedModel,c.M2M100ForConditionalGeneration,c.M2M100Model,c.M2M100PreTrainedModel,c.M2M100Tokenizer,c.MBart50Tokenizer,c.MBartForCausalLM,c.MBartForConditionalGeneration,c.MBartForSequenceClassification,c.MBartModel,c.MBartPreTrainedModel,c.MBartTokenizer,c.MPNetForMaskedLM,c.MPNetForQuestionAnswering,c.MPNetForSequenceClassification,c.MPNetForTokenClassification,c.MPNetModel,c.MPNetPreTrainedModel,c.MPNetTokenizer,c.MT5ForConditionalGeneration,c.MT5Model,c.MT5PreTrainedModel,c.MarianMTModel,c.MarianModel,c.MarianPreTrainedModel,c.MarianTokenizer,c.Mask2FormerImageProcessor,c.MaskFormerFeatureExtractor,c.MaskFormerForInstanceSegmentation,c.MaskFormerImageProcessor,c.MaskFormerModel,c.MaskFormerPreTrainedModel,c.MaskedLMOutput,c.MaxLengthCriteria,c.MgpstrForSceneTextRecognition,c.MgpstrModelOutput,c.MgpstrPreTrainedModel,c.MgpstrProcessor,c.MgpstrTokenizer,c.MinLengthLogitsProcessor,c.MinNewTokensLengthLogitsProcessor,c.MistralForCausalLM,c.MistralModel,c.MistralPreTrainedModel,c.MobileBertForMaskedLM,c.MobileBertForQuestionAnswering,c.MobileBertForSequenceClassification,c.MobileBertModel,c.MobileBertPreTrainedModel,c.MobileBertTokenizer,c.MobileLLMForCausalLM,c.MobileLLMModel,c.MobileLLMPreTrainedModel,c.MobileNetV1FeatureExtractor,c.MobileNetV1ForImageClassification,c.MobileNetV1ImageProcessor,c.MobileNetV1Model,c.MobileNetV1PreTrainedModel,c.MobileNetV2FeatureExtractor,c.MobileNetV2ForImageClassification,c.MobileNetV2ImageProcessor,c.MobileNetV2Model,c.MobileNetV2PreTrainedModel,c.MobileNetV3FeatureExtractor,c.MobileNetV3ForImageClassification,c.MobileNetV3ImageProcessor,c.MobileNetV3Model,c.MobileNetV3PreTrainedModel,c.MobileNetV4FeatureExtractor,c.MobileNetV4ForImageClassification,c.MobileNetV4ImageProcessor,c.MobileNetV4Model,c.MobileNetV4PreTrainedModel,c.MobileViTFeatureExtractor,c.MobileViTForImageClassification,c.MobileViTImageProcessor,c.MobileViTModel,c.MobileViTPreTrainedModel,c.MobileViTV2ForImageClassification,c.MobileViTV2Model,c.MobileViTV2PreTrainedModel,c.ModelOutput,c.ModernBertForMaskedLM,c.ModernBertForSequenceClassification,c.ModernBertForTokenClassification,c.ModernBertModel,c.ModernBertPreTrainedModel,c.Moondream1ForConditionalGeneration,c.MoonshineFeatureExtractor,c.MoonshineForConditionalGeneration,c.MoonshineModel,c.MoonshinePreTrainedModel,c.MoonshineProcessor,c.MptForCausalLM,c.MptModel,c.MptPreTrainedModel,c.MultiModalityCausalLM,c.MultiModalityPreTrainedModel,c.MusicgenForCausalLM,c.MusicgenForConditionalGeneration,c.MusicgenModel,c.MusicgenPreTrainedModel,c.NllbTokenizer,c.NoBadWordsLogitsProcessor,c.NoRepeatNGramLogitsProcessor,c.NomicBertModel,c.NomicBertPreTrainedModel,c.NougatImageProcessor,c.NougatTokenizer,c.OPTForCausalLM,c.OPTModel,c.OPTPreTrainedModel,c.ObjectDetectionPipeline,c.Olmo2ForCausalLM,c.Olmo2Model,c.Olmo2PreTrainedModel,c.OlmoForCausalLM,c.OlmoModel,c.OlmoPreTrainedModel,c.OpenELMForCausalLM,c.OpenELMModel,c.OpenELMPreTrainedModel,c.OwlViTFeatureExtractor,c.OwlViTForObjectDetection,c.OwlViTImageProcessor,c.OwlViTModel,c.OwlViTPreTrainedModel,c.OwlViTProcessor,c.Owlv2ForObjectDetection,c.Owlv2ImageProcessor,c.Owlv2Model,c.Owlv2PreTrainedModel,c.PaliGemmaForConditionalGeneration,c.PaliGemmaPreTrainedModel,c.PaliGemmaProcessor,c.PatchTSMixerForPrediction,c.PatchTSMixerModel,c.PatchTSMixerPreTrainedModel,c.PatchTSTForPrediction,c.PatchTSTModel,c.PatchTSTPreTrainedModel,c.Phi3ForCausalLM,c.Phi3Model,c.Phi3PreTrainedModel,c.Phi3VForCausalLM,c.Phi3VImageProcessor,c.Phi3VPreTrainedModel,c.Phi3VProcessor,c.PhiForCausalLM,c.PhiModel,c.PhiPreTrainedModel,c.Pipeline,c.PreTrainedModel,c.PreTrainedTokenizer,c.PretrainedConfig,c.PretrainedMixin,c.Processor,c.PvtForImageClassification,c.PvtImageProcessor,c.PvtModel,c.PvtPreTrainedModel,c.PyAnnoteFeatureExtractor,c.PyAnnoteForAudioFrameClassification,c.PyAnnoteModel,c.PyAnnotePreTrainedModel,c.PyAnnoteProcessor,c.QuestionAnsweringModelOutput,c.QuestionAnsweringPipeline,c.Qwen2ForCausalLM,c.Qwen2Model,c.Qwen2PreTrainedModel,c.Qwen2Tokenizer,c.Qwen2VLForConditionalGeneration,c.Qwen2VLImageProcessor,c.Qwen2VLPreTrainedModel,c.Qwen2VLProcessor,c.RTDetrForObjectDetection,c.RTDetrImageProcessor,c.RTDetrModel,c.RTDetrObjectDetectionOutput,c.RTDetrPreTrainedModel,c.RawAudio,c.RawImage,c.RepetitionPenaltyLogitsProcessor,c.ResNetForImageClassification,c.ResNetModel,c.ResNetPreTrainedModel,c.RoFormerForMaskedLM,c.RoFormerForQuestionAnswering,c.RoFormerForSequenceClassification,c.RoFormerForTokenClassification,c.RoFormerModel,c.RoFormerPreTrainedModel,c.RoFormerTokenizer,c.RobertaForMaskedLM,c.RobertaForQuestionAnswering,c.RobertaForSequenceClassification,c.RobertaForTokenClassification,c.RobertaModel,c.RobertaPreTrainedModel,c.RobertaTokenizer,c.SamImageProcessor,c.SamImageSegmentationOutput,c.SamModel,c.SamPreTrainedModel,c.SamProcessor,c.SapiensForDepthEstimation,c.SapiensForNormalEstimation,c.SapiensForSemanticSegmentation,c.SapiensPreTrainedModel,c.SeamlessM4TFeatureExtractor,c.SegformerFeatureExtractor,c.SegformerForImageClassification,c.SegformerForSemanticSegmentation,c.SegformerImageProcessor,c.SegformerModel,c.SegformerPreTrainedModel,c.Seq2SeqLMOutput,c.SequenceClassifierOutput,c.SiglipImageProcessor,c.SiglipModel,c.SiglipPreTrainedModel,c.SiglipTextModel,c.SiglipTokenizer,c.SiglipVisionModel,c.SpeechT5FeatureExtractor,c.SpeechT5ForSpeechToText,c.SpeechT5ForTextToSpeech,c.SpeechT5HifiGan,c.SpeechT5Model,c.SpeechT5PreTrainedModel,c.SpeechT5Processor,c.SpeechT5Tokenizer,c.SqueezeBertForMaskedLM,c.SqueezeBertForQuestionAnswering,c.SqueezeBertForSequenceClassification,c.SqueezeBertModel,c.SqueezeBertPreTrainedModel,c.SqueezeBertTokenizer,c.StableLmForCausalLM,c.StableLmModel,c.StableLmPreTrainedModel,c.Starcoder2ForCausalLM,c.Starcoder2Model,c.Starcoder2PreTrainedModel,c.StoppingCriteria,c.StoppingCriteriaList,c.StyleTextToSpeech2Model,c.StyleTextToSpeech2PreTrainedModel,c.SummarizationPipeline,c.SuppressTokensAtBeginLogitsProcessor,c.Swin2SRForImageSuperResolution,c.Swin2SRImageProcessor,c.Swin2SRModel,c.Swin2SRPreTrainedModel,c.SwinForImageClassification,c.SwinModel,c.SwinPreTrainedModel,c.T5ForConditionalGeneration,c.T5Model,c.T5PreTrainedModel,c.T5Tokenizer,c.TableTransformerForObjectDetection,c.TableTransformerModel,c.TableTransformerObjectDetectionOutput,c.TableTransformerPreTrainedModel,c.TemperatureLogitsWarper,c.Tensor,c.Text2TextGenerationPipeline,c.TextClassificationPipeline,c.TextGenerationPipeline;var i_=c.TextStreamer;c.TextToAudioPipeline,c.TokenClassificationPipeline,c.TokenClassifierOutput,c.TokenizerModel,c.TopKLogitsWarper,c.TopPLogitsWarper,c.TrOCRForCausalLM,c.TrOCRPreTrainedModel,c.TranslationPipeline,c.UniSpeechForCTC,c.UniSpeechForSequenceClassification,c.UniSpeechModel,c.UniSpeechPreTrainedModel,c.UniSpeechSatForAudioFrameClassification,c.UniSpeechSatForCTC,c.UniSpeechSatForSequenceClassification,c.UniSpeechSatModel,c.UniSpeechSatPreTrainedModel,c.VLChatProcessor,c.VLMImageProcessor,c.ViTFeatureExtractor,c.ViTForImageClassification,c.ViTImageProcessor,c.ViTMAEModel,c.ViTMAEPreTrainedModel,c.ViTMSNForImageClassification,c.ViTMSNModel,c.ViTMSNPreTrainedModel,c.ViTModel,c.ViTPreTrainedModel,c.VisionEncoderDecoderModel,c.VitMatteForImageMatting,c.VitMatteImageProcessor,c.VitMattePreTrainedModel,c.VitPoseForPoseEstimation,c.VitPoseImageProcessor,c.VitPosePreTrainedModel,c.VitsModel,c.VitsModelOutput,c.VitsPreTrainedModel,c.VitsTokenizer,c.Wav2Vec2BertForCTC,c.Wav2Vec2BertForSequenceClassification,c.Wav2Vec2BertModel,c.Wav2Vec2BertPreTrainedModel,c.Wav2Vec2CTCTokenizer,c.Wav2Vec2FeatureExtractor,c.Wav2Vec2ForAudioFrameClassification,c.Wav2Vec2ForCTC,c.Wav2Vec2ForSequenceClassification,c.Wav2Vec2Model,c.Wav2Vec2PreTrainedModel,c.Wav2Vec2ProcessorWithLM,c.WavLMForAudioFrameClassification,c.WavLMForCTC,c.WavLMForSequenceClassification,c.WavLMForXVector,c.WavLMModel,c.WavLMPreTrainedModel,c.WeSpeakerFeatureExtractor,c.WeSpeakerResNetModel,c.WeSpeakerResNetPreTrainedModel,c.WhisperFeatureExtractor,c.WhisperForConditionalGeneration,c.WhisperModel,c.WhisperPreTrainedModel,c.WhisperProcessor,c.WhisperTextStreamer,c.WhisperTimeStampLogitsProcessor,c.WhisperTokenizer,c.XLMForQuestionAnswering,c.XLMForSequenceClassification,c.XLMForTokenClassification,c.XLMModel,c.XLMPreTrainedModel,c.XLMRobertaForMaskedLM,c.XLMRobertaForQuestionAnswering,c.XLMRobertaForSequenceClassification,c.XLMRobertaForTokenClassification,c.XLMRobertaModel,c.XLMRobertaPreTrainedModel,c.XLMRobertaTokenizer,c.XLMTokenizer,c.XLMWithLMHeadModel,c.XVectorOutput,c.YolosFeatureExtractor,c.YolosForObjectDetection,c.YolosImageProcessor,c.YolosModel,c.YolosObjectDetectionOutput,c.YolosPreTrainedModel,c.ZeroShotAudioClassificationPipeline,c.ZeroShotClassificationPipeline,c.ZeroShotImageClassificationPipeline,c.ZeroShotObjectDetectionPipeline,c.bankers_round,c.cat,c.cos_sim,c.dot,c.dynamic_time_warping,c.env,c.full,c.full_like,c.getKeyValueShapes,c.hamming,c.hanning,c.interpolate,c.interpolate_4d,c.interpolate_data,c.is_chinese_char,c.layer_norm,c.load_image,c.log_softmax,c.magnitude,c.matmul,c.max,c.mean,c.mean_pooling,c.medianFilter,c.mel_filter_bank,c.min,c.ones,c.ones_like,c.permute,c.permute_data,c.pipeline,c.quantize_embeddings,c.rand,c.read_audio,c.rfft,c.round,c.slice,c.softmax,c.spectrogram,c.stack,c.std_mean,c.topk,c.window_function,c.zeros,c.zeros_like;async function a_(){try{if(!await navigator.gpu.requestAdapter())throw new Error("WebGPU is not supported (no adapter found)")}catch(Le){self.postMessage({status:"error",data:Le.toString()})}}class Np{static async getInstance(I=null){return this.tokenizer??(this.tokenizer=n_.from_pretrained(this.model_id,{progress_callback:I})),this.model??(this.model=r_.from_pretrained(this.model_id,{dtype:"q8",device:"webgpu",progress_callback:I})),Promise.all([this.tokenizer,this.model])}}_e(Np,"model_id","onnx-community/DeepSeek-R1-Distill-Qwen-1.5B-ONNX");const Bc=new o_;async function l_(Le){const[I,r]=await Np.getInstance(),f=I.apply_chat_template(Le,{add_generation_prompt:!0,return_dict:!0}),[D,j]=I.encode("",{add_special_tokens:!1});let Y="thinking",R,g=0,v;const y=ne=>{R??(R=performance.now()),g++>0&&(v=g/(performance.now()-R)*1e3),ne[0]==j&&(Y="answering")},M=ne=>{self.postMessage({status:"update",output:ne,tps:v,numTokens:g,state:Y})},b=new i_(I,{skip_prompt:!0,skip_special_tokens:!0,callback_function:M,token_callback_function:y});self.postMessage({status:"start"});const{past_key_values:A,sequences:K}=await r.generate({...f,do_sample:!1,max_new_tokens:2048,streamer:b,stopping_criteria:Bc,return_dict_in_generate:!0}),te=I.batch_decode(K,{skip_special_tokens:!0});self.postMessage({status:"complete",output:te})}async function u_(){self.postMessage({status:"loading",data:"Loading model..."});const[Le,I]=await Np.getInstance(f=>{self.postMessage(f)});self.postMessage({status:"loading",data:"Compiling shaders and warming up model..."});const r=Le("a");await I.generate({...r,max_new_tokens:1}),self.postMessage({status:"ready"})}self.addEventListener("message",async Le=>{const{type:I,data:r}=Le.data;switch(I){case"check":a_();break;case"load":u_();break;case"generate":Bc.reset(),l_(r);break;case"interrupt":Bc.interrupt();break;case"reset":Bc.reset();break}})})(); + \*****************************/gs.r(c),gs.d(c,{ASTFeatureExtractor:()=>y.ASTFeatureExtractor,ASTForAudioClassification:()=>r.ASTForAudioClassification,ASTModel:()=>r.ASTModel,ASTPreTrainedModel:()=>r.ASTPreTrainedModel,AlbertForMaskedLM:()=>r.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>r.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>r.AlbertForSequenceClassification,AlbertModel:()=>r.AlbertModel,AlbertPreTrainedModel:()=>r.AlbertPreTrainedModel,AlbertTokenizer:()=>f.AlbertTokenizer,AudioClassificationPipeline:()=>I.AudioClassificationPipeline,AutoConfig:()=>D.AutoConfig,AutoFeatureExtractor:()=>M.AutoFeatureExtractor,AutoImageProcessor:()=>K.AutoImageProcessor,AutoModel:()=>r.AutoModel,AutoModelForAudioClassification:()=>r.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>r.AutoModelForAudioFrameClassification,AutoModelForCTC:()=>r.AutoModelForCTC,AutoModelForCausalLM:()=>r.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>r.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>r.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>r.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>r.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>r.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>r.AutoModelForImageSegmentation,AutoModelForImageToImage:()=>r.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>r.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>r.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>r.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>r.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>r.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>r.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>r.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>r.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>r.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>r.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>r.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>r.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>r.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>r.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>r.AutoModelForVision2Seq,AutoModelForXVector:()=>r.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>r.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>W.AutoProcessor,AutoTokenizer:()=>f.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>I.AutomaticSpeechRecognitionPipeline,BartForConditionalGeneration:()=>r.BartForConditionalGeneration,BartForSequenceClassification:()=>r.BartForSequenceClassification,BartModel:()=>r.BartModel,BartPretrainedModel:()=>r.BartPretrainedModel,BartTokenizer:()=>f.BartTokenizer,BaseModelOutput:()=>r.BaseModelOutput,BaseStreamer:()=>U.BaseStreamer,BeitFeatureExtractor:()=>A.BeitFeatureExtractor,BeitForImageClassification:()=>r.BeitForImageClassification,BeitModel:()=>r.BeitModel,BeitPreTrainedModel:()=>r.BeitPreTrainedModel,BertForMaskedLM:()=>r.BertForMaskedLM,BertForQuestionAnswering:()=>r.BertForQuestionAnswering,BertForSequenceClassification:()=>r.BertForSequenceClassification,BertForTokenClassification:()=>r.BertForTokenClassification,BertModel:()=>r.BertModel,BertPreTrainedModel:()=>r.BertPreTrainedModel,BertTokenizer:()=>f.BertTokenizer,BitImageProcessor:()=>A.BitImageProcessor,BlenderbotForConditionalGeneration:()=>r.BlenderbotForConditionalGeneration,BlenderbotModel:()=>r.BlenderbotModel,BlenderbotPreTrainedModel:()=>r.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>r.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>r.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>r.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>f.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>f.BlenderbotTokenizer,BloomForCausalLM:()=>r.BloomForCausalLM,BloomModel:()=>r.BloomModel,BloomPreTrainedModel:()=>r.BloomPreTrainedModel,BloomTokenizer:()=>f.BloomTokenizer,CLIPFeatureExtractor:()=>A.CLIPFeatureExtractor,CLIPImageProcessor:()=>A.CLIPImageProcessor,CLIPModel:()=>r.CLIPModel,CLIPPreTrainedModel:()=>r.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>r.CLIPSegForImageSegmentation,CLIPSegModel:()=>r.CLIPSegModel,CLIPSegPreTrainedModel:()=>r.CLIPSegPreTrainedModel,CLIPTextModel:()=>r.CLIPTextModel,CLIPTextModelWithProjection:()=>r.CLIPTextModelWithProjection,CLIPTokenizer:()=>f.CLIPTokenizer,CLIPVisionModel:()=>r.CLIPVisionModel,CLIPVisionModelWithProjection:()=>r.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>r.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>r.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>r.CamembertForSequenceClassification,CamembertForTokenClassification:()=>r.CamembertForTokenClassification,CamembertModel:()=>r.CamembertModel,CamembertPreTrainedModel:()=>r.CamembertPreTrainedModel,CamembertTokenizer:()=>f.CamembertTokenizer,CausalLMOutput:()=>r.CausalLMOutput,CausalLMOutputWithPast:()=>r.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>A.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>r.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>r.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>r.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>y.ClapFeatureExtractor,ClapModel:()=>r.ClapModel,ClapPreTrainedModel:()=>r.ClapPreTrainedModel,ClapTextModelWithProjection:()=>r.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>$.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>r.CodeGenForCausalLM,CodeGenModel:()=>r.CodeGenModel,CodeGenPreTrainedModel:()=>r.CodeGenPreTrainedModel,CodeGenTokenizer:()=>f.CodeGenTokenizer,CodeLlamaTokenizer:()=>f.CodeLlamaTokenizer,CohereForCausalLM:()=>r.CohereForCausalLM,CohereModel:()=>r.CohereModel,CoherePreTrainedModel:()=>r.CoherePreTrainedModel,CohereTokenizer:()=>f.CohereTokenizer,ConvBertForMaskedLM:()=>r.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>r.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>r.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>r.ConvBertForTokenClassification,ConvBertModel:()=>r.ConvBertModel,ConvBertPreTrainedModel:()=>r.ConvBertPreTrainedModel,ConvBertTokenizer:()=>f.ConvBertTokenizer,ConvNextFeatureExtractor:()=>A.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>r.ConvNextForImageClassification,ConvNextImageProcessor:()=>A.ConvNextImageProcessor,ConvNextModel:()=>r.ConvNextModel,ConvNextPreTrainedModel:()=>r.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>r.ConvNextV2ForImageClassification,ConvNextV2Model:()=>r.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>r.ConvNextV2PreTrainedModel,DPTFeatureExtractor:()=>A.DPTFeatureExtractor,DPTForDepthEstimation:()=>r.DPTForDepthEstimation,DPTImageProcessor:()=>A.DPTImageProcessor,DPTModel:()=>r.DPTModel,DPTPreTrainedModel:()=>r.DPTPreTrainedModel,DebertaForMaskedLM:()=>r.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>r.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>r.DebertaForSequenceClassification,DebertaForTokenClassification:()=>r.DebertaForTokenClassification,DebertaModel:()=>r.DebertaModel,DebertaPreTrainedModel:()=>r.DebertaPreTrainedModel,DebertaTokenizer:()=>f.DebertaTokenizer,DebertaV2ForMaskedLM:()=>r.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>r.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>r.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>r.DebertaV2ForTokenClassification,DebertaV2Model:()=>r.DebertaV2Model,DebertaV2PreTrainedModel:()=>r.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>f.DebertaV2Tokenizer,DecisionTransformerModel:()=>r.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>r.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>A.DeiTFeatureExtractor,DeiTForImageClassification:()=>r.DeiTForImageClassification,DeiTImageProcessor:()=>A.DeiTImageProcessor,DeiTModel:()=>r.DeiTModel,DeiTPreTrainedModel:()=>r.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>r.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>r.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>I.DepthEstimationPipeline,DepthProForDepthEstimation:()=>r.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>r.DepthProPreTrainedModel,DetrFeatureExtractor:()=>A.DetrFeatureExtractor,DetrForObjectDetection:()=>r.DetrForObjectDetection,DetrForSegmentation:()=>r.DetrForSegmentation,DetrImageProcessor:()=>A.DetrImageProcessor,DetrModel:()=>r.DetrModel,DetrObjectDetectionOutput:()=>r.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>r.DetrPreTrainedModel,DetrSegmentationOutput:()=>r.DetrSegmentationOutput,Dinov2ForImageClassification:()=>r.Dinov2ForImageClassification,Dinov2Model:()=>r.Dinov2Model,Dinov2PreTrainedModel:()=>r.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>r.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>r.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>r.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>r.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>r.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>r.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>r.DistilBertForTokenClassification,DistilBertModel:()=>r.DistilBertModel,DistilBertPreTrainedModel:()=>r.DistilBertPreTrainedModel,DistilBertTokenizer:()=>f.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>I.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>A.DonutFeatureExtractor,DonutImageProcessor:()=>A.DonutImageProcessor,DonutSwinModel:()=>r.DonutSwinModel,DonutSwinPreTrainedModel:()=>r.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>r.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>A.EfficientNetImageProcessor,EfficientNetModel:()=>r.EfficientNetModel,EfficientNetPreTrainedModel:()=>r.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>r.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>r.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>r.ElectraForSequenceClassification,ElectraForTokenClassification:()=>r.ElectraForTokenClassification,ElectraModel:()=>r.ElectraModel,ElectraPreTrainedModel:()=>r.ElectraPreTrainedModel,ElectraTokenizer:()=>f.ElectraTokenizer,EosTokenCriteria:()=>X.EosTokenCriteria,EsmForMaskedLM:()=>r.EsmForMaskedLM,EsmForSequenceClassification:()=>r.EsmForSequenceClassification,EsmForTokenClassification:()=>r.EsmForTokenClassification,EsmModel:()=>r.EsmModel,EsmPreTrainedModel:()=>r.EsmPreTrainedModel,EsmTokenizer:()=>f.EsmTokenizer,ExaoneForCausalLM:()=>r.ExaoneForCausalLM,ExaoneModel:()=>r.ExaoneModel,ExaonePreTrainedModel:()=>r.ExaonePreTrainedModel,FFT:()=>g.FFT,FalconForCausalLM:()=>r.FalconForCausalLM,FalconModel:()=>r.FalconModel,FalconPreTrainedModel:()=>r.FalconPreTrainedModel,FalconTokenizer:()=>f.FalconTokenizer,FastViTForImageClassification:()=>r.FastViTForImageClassification,FastViTModel:()=>r.FastViTModel,FastViTPreTrainedModel:()=>r.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>I.FeatureExtractionPipeline,FeatureExtractor:()=>v.FeatureExtractor,FillMaskPipeline:()=>I.FillMaskPipeline,Florence2ForConditionalGeneration:()=>r.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>r.Florence2PreTrainedModel,Florence2Processor:()=>ne.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>$.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>$.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>A.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>r.GLPNForDepthEstimation,GLPNModel:()=>r.GLPNModel,GLPNPreTrainedModel:()=>r.GLPNPreTrainedModel,GPT2LMHeadModel:()=>r.GPT2LMHeadModel,GPT2Model:()=>r.GPT2Model,GPT2PreTrainedModel:()=>r.GPT2PreTrainedModel,GPT2Tokenizer:()=>f.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>r.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>r.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>r.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>r.GPTJForCausalLM,GPTJModel:()=>r.GPTJModel,GPTJPreTrainedModel:()=>r.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>r.GPTNeoForCausalLM,GPTNeoModel:()=>r.GPTNeoModel,GPTNeoPreTrainedModel:()=>r.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>r.GPTNeoXForCausalLM,GPTNeoXModel:()=>r.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>r.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>f.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>r.Gemma2ForCausalLM,Gemma2Model:()=>r.Gemma2Model,Gemma2PreTrainedModel:()=>r.Gemma2PreTrainedModel,GemmaForCausalLM:()=>r.GemmaForCausalLM,GemmaModel:()=>r.GemmaModel,GemmaPreTrainedModel:()=>r.GemmaPreTrainedModel,GemmaTokenizer:()=>f.GemmaTokenizer,GraniteForCausalLM:()=>r.GraniteForCausalLM,GraniteModel:()=>r.GraniteModel,GranitePreTrainedModel:()=>r.GranitePreTrainedModel,Grok1Tokenizer:()=>f.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>r.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>A.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>r.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>ne.GroundingDinoProcessor,GroupViTModel:()=>r.GroupViTModel,GroupViTPreTrainedModel:()=>r.GroupViTPreTrainedModel,HerbertTokenizer:()=>f.HerbertTokenizer,HieraForImageClassification:()=>r.HieraForImageClassification,HieraModel:()=>r.HieraModel,HieraPreTrainedModel:()=>r.HieraPreTrainedModel,HubertForCTC:()=>r.HubertForCTC,HubertForSequenceClassification:()=>r.HubertForSequenceClassification,HubertModel:()=>r.HubertModel,HubertPreTrainedModel:()=>r.HubertPreTrainedModel,IJepaForImageClassification:()=>r.IJepaForImageClassification,IJepaModel:()=>r.IJepaModel,IJepaPreTrainedModel:()=>r.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>r.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>A.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>r.Idefics3PreTrainedModel,Idefics3Processor:()=>ne.Idefics3Processor,ImageClassificationPipeline:()=>I.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>I.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>y.ImageFeatureExtractor,ImageMattingOutput:()=>r.ImageMattingOutput,ImageProcessor:()=>b.ImageProcessor,ImageSegmentationPipeline:()=>I.ImageSegmentationPipeline,ImageToImagePipeline:()=>I.ImageToImagePipeline,ImageToTextPipeline:()=>I.ImageToTextPipeline,InterruptableStoppingCriteria:()=>X.InterruptableStoppingCriteria,JAISLMHeadModel:()=>r.JAISLMHeadModel,JAISModel:()=>r.JAISModel,JAISPreTrainedModel:()=>r.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>A.JinaCLIPImageProcessor,JinaCLIPModel:()=>r.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>r.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>ne.JinaCLIPProcessor,JinaCLIPTextModel:()=>r.JinaCLIPTextModel,JinaCLIPVisionModel:()=>r.JinaCLIPVisionModel,LlamaForCausalLM:()=>r.LlamaForCausalLM,LlamaModel:()=>r.LlamaModel,LlamaPreTrainedModel:()=>r.LlamaPreTrainedModel,LlamaTokenizer:()=>f.LlamaTokenizer,LlavaForConditionalGeneration:()=>r.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>r.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>A.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>r.LlavaPreTrainedModel,LogitsProcessor:()=>$.LogitsProcessor,LogitsProcessorList:()=>$.LogitsProcessorList,LogitsWarper:()=>$.LogitsWarper,LongT5ForConditionalGeneration:()=>r.LongT5ForConditionalGeneration,LongT5Model:()=>r.LongT5Model,LongT5PreTrainedModel:()=>r.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>r.M2M100ForConditionalGeneration,M2M100Model:()=>r.M2M100Model,M2M100PreTrainedModel:()=>r.M2M100PreTrainedModel,M2M100Tokenizer:()=>f.M2M100Tokenizer,MBart50Tokenizer:()=>f.MBart50Tokenizer,MBartForCausalLM:()=>r.MBartForCausalLM,MBartForConditionalGeneration:()=>r.MBartForConditionalGeneration,MBartForSequenceClassification:()=>r.MBartForSequenceClassification,MBartModel:()=>r.MBartModel,MBartPreTrainedModel:()=>r.MBartPreTrainedModel,MBartTokenizer:()=>f.MBartTokenizer,MPNetForMaskedLM:()=>r.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>r.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>r.MPNetForSequenceClassification,MPNetForTokenClassification:()=>r.MPNetForTokenClassification,MPNetModel:()=>r.MPNetModel,MPNetPreTrainedModel:()=>r.MPNetPreTrainedModel,MPNetTokenizer:()=>f.MPNetTokenizer,MT5ForConditionalGeneration:()=>r.MT5ForConditionalGeneration,MT5Model:()=>r.MT5Model,MT5PreTrainedModel:()=>r.MT5PreTrainedModel,MarianMTModel:()=>r.MarianMTModel,MarianModel:()=>r.MarianModel,MarianPreTrainedModel:()=>r.MarianPreTrainedModel,MarianTokenizer:()=>f.MarianTokenizer,Mask2FormerImageProcessor:()=>A.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>A.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>r.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>A.MaskFormerImageProcessor,MaskFormerModel:()=>r.MaskFormerModel,MaskFormerPreTrainedModel:()=>r.MaskFormerPreTrainedModel,MaskedLMOutput:()=>r.MaskedLMOutput,MaxLengthCriteria:()=>X.MaxLengthCriteria,MgpstrForSceneTextRecognition:()=>r.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>r.MgpstrModelOutput,MgpstrPreTrainedModel:()=>r.MgpstrPreTrainedModel,MgpstrProcessor:()=>ne.MgpstrProcessor,MgpstrTokenizer:()=>f.MgpstrTokenizer,MinLengthLogitsProcessor:()=>$.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>$.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>r.MistralForCausalLM,MistralModel:()=>r.MistralModel,MistralPreTrainedModel:()=>r.MistralPreTrainedModel,MobileBertForMaskedLM:()=>r.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>r.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>r.MobileBertForSequenceClassification,MobileBertModel:()=>r.MobileBertModel,MobileBertPreTrainedModel:()=>r.MobileBertPreTrainedModel,MobileBertTokenizer:()=>f.MobileBertTokenizer,MobileLLMForCausalLM:()=>r.MobileLLMForCausalLM,MobileLLMModel:()=>r.MobileLLMModel,MobileLLMPreTrainedModel:()=>r.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>A.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>r.MobileNetV1ForImageClassification,MobileNetV1ImageProcessor:()=>A.MobileNetV1ImageProcessor,MobileNetV1Model:()=>r.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>r.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>A.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>r.MobileNetV2ForImageClassification,MobileNetV2ImageProcessor:()=>A.MobileNetV2ImageProcessor,MobileNetV2Model:()=>r.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>r.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>A.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>r.MobileNetV3ForImageClassification,MobileNetV3ImageProcessor:()=>A.MobileNetV3ImageProcessor,MobileNetV3Model:()=>r.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>r.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>A.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>r.MobileNetV4ForImageClassification,MobileNetV4ImageProcessor:()=>A.MobileNetV4ImageProcessor,MobileNetV4Model:()=>r.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>r.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>A.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>r.MobileViTForImageClassification,MobileViTImageProcessor:()=>A.MobileViTImageProcessor,MobileViTModel:()=>r.MobileViTModel,MobileViTPreTrainedModel:()=>r.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>r.MobileViTV2ForImageClassification,MobileViTV2Model:()=>r.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>r.MobileViTV2PreTrainedModel,ModelOutput:()=>r.ModelOutput,ModernBertForMaskedLM:()=>r.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>r.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>r.ModernBertForTokenClassification,ModernBertModel:()=>r.ModernBertModel,ModernBertPreTrainedModel:()=>r.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>r.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>y.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>r.MoonshineForConditionalGeneration,MoonshineModel:()=>r.MoonshineModel,MoonshinePreTrainedModel:()=>r.MoonshinePreTrainedModel,MoonshineProcessor:()=>ne.MoonshineProcessor,MptForCausalLM:()=>r.MptForCausalLM,MptModel:()=>r.MptModel,MptPreTrainedModel:()=>r.MptPreTrainedModel,MultiModalityCausalLM:()=>r.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>r.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>r.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>r.MusicgenForConditionalGeneration,MusicgenModel:()=>r.MusicgenModel,MusicgenPreTrainedModel:()=>r.MusicgenPreTrainedModel,NllbTokenizer:()=>f.NllbTokenizer,NoBadWordsLogitsProcessor:()=>$.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>$.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>r.NomicBertModel,NomicBertPreTrainedModel:()=>r.NomicBertPreTrainedModel,NougatImageProcessor:()=>A.NougatImageProcessor,NougatTokenizer:()=>f.NougatTokenizer,OPTForCausalLM:()=>r.OPTForCausalLM,OPTModel:()=>r.OPTModel,OPTPreTrainedModel:()=>r.OPTPreTrainedModel,ObjectDetectionPipeline:()=>I.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>r.Olmo2ForCausalLM,Olmo2Model:()=>r.Olmo2Model,Olmo2PreTrainedModel:()=>r.Olmo2PreTrainedModel,OlmoForCausalLM:()=>r.OlmoForCausalLM,OlmoModel:()=>r.OlmoModel,OlmoPreTrainedModel:()=>r.OlmoPreTrainedModel,OpenELMForCausalLM:()=>r.OpenELMForCausalLM,OpenELMModel:()=>r.OpenELMModel,OpenELMPreTrainedModel:()=>r.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>A.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>r.OwlViTForObjectDetection,OwlViTImageProcessor:()=>A.OwlViTImageProcessor,OwlViTModel:()=>r.OwlViTModel,OwlViTPreTrainedModel:()=>r.OwlViTPreTrainedModel,OwlViTProcessor:()=>ne.OwlViTProcessor,Owlv2ForObjectDetection:()=>r.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>A.Owlv2ImageProcessor,Owlv2Model:()=>r.Owlv2Model,Owlv2PreTrainedModel:()=>r.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>r.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>r.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>ne.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>r.PatchTSMixerForPrediction,PatchTSMixerModel:()=>r.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>r.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>r.PatchTSTForPrediction,PatchTSTModel:()=>r.PatchTSTModel,PatchTSTPreTrainedModel:()=>r.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>r.Phi3ForCausalLM,Phi3Model:()=>r.Phi3Model,Phi3PreTrainedModel:()=>r.Phi3PreTrainedModel,Phi3VForCausalLM:()=>r.Phi3VForCausalLM,Phi3VImageProcessor:()=>A.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>r.Phi3VPreTrainedModel,Phi3VProcessor:()=>ne.Phi3VProcessor,PhiForCausalLM:()=>r.PhiForCausalLM,PhiModel:()=>r.PhiModel,PhiPreTrainedModel:()=>r.PhiPreTrainedModel,Pipeline:()=>I.Pipeline,PreTrainedModel:()=>r.PreTrainedModel,PreTrainedTokenizer:()=>f.PreTrainedTokenizer,PretrainedConfig:()=>D.PretrainedConfig,PretrainedMixin:()=>r.PretrainedMixin,Processor:()=>te.Processor,PvtForImageClassification:()=>r.PvtForImageClassification,PvtImageProcessor:()=>A.PvtImageProcessor,PvtModel:()=>r.PvtModel,PvtPreTrainedModel:()=>r.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>y.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>r.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>r.PyAnnoteModel,PyAnnotePreTrainedModel:()=>r.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>ne.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>r.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>I.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>r.Qwen2ForCausalLM,Qwen2Model:()=>r.Qwen2Model,Qwen2PreTrainedModel:()=>r.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>f.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>r.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>A.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>r.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>ne.Qwen2VLProcessor,RTDetrForObjectDetection:()=>r.RTDetrForObjectDetection,RTDetrImageProcessor:()=>A.RTDetrImageProcessor,RTDetrModel:()=>r.RTDetrModel,RTDetrObjectDetectionOutput:()=>r.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>r.RTDetrPreTrainedModel,RawAudio:()=>j.RawAudio,RawImage:()=>Y.RawImage,RepetitionPenaltyLogitsProcessor:()=>$.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>r.ResNetForImageClassification,ResNetModel:()=>r.ResNetModel,ResNetPreTrainedModel:()=>r.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>r.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>r.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>r.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>r.RoFormerForTokenClassification,RoFormerModel:()=>r.RoFormerModel,RoFormerPreTrainedModel:()=>r.RoFormerPreTrainedModel,RoFormerTokenizer:()=>f.RoFormerTokenizer,RobertaForMaskedLM:()=>r.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>r.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>r.RobertaForSequenceClassification,RobertaForTokenClassification:()=>r.RobertaForTokenClassification,RobertaModel:()=>r.RobertaModel,RobertaPreTrainedModel:()=>r.RobertaPreTrainedModel,RobertaTokenizer:()=>f.RobertaTokenizer,SamImageProcessor:()=>A.SamImageProcessor,SamImageSegmentationOutput:()=>r.SamImageSegmentationOutput,SamModel:()=>r.SamModel,SamPreTrainedModel:()=>r.SamPreTrainedModel,SamProcessor:()=>ne.SamProcessor,SapiensForDepthEstimation:()=>r.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>r.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>r.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>r.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>y.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>A.SegformerFeatureExtractor,SegformerForImageClassification:()=>r.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>r.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>A.SegformerImageProcessor,SegformerModel:()=>r.SegformerModel,SegformerPreTrainedModel:()=>r.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>r.Seq2SeqLMOutput,SequenceClassifierOutput:()=>r.SequenceClassifierOutput,SiglipImageProcessor:()=>A.SiglipImageProcessor,SiglipModel:()=>r.SiglipModel,SiglipPreTrainedModel:()=>r.SiglipPreTrainedModel,SiglipTextModel:()=>r.SiglipTextModel,SiglipTokenizer:()=>f.SiglipTokenizer,SiglipVisionModel:()=>r.SiglipVisionModel,SpeechT5FeatureExtractor:()=>y.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>r.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>r.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>r.SpeechT5HifiGan,SpeechT5Model:()=>r.SpeechT5Model,SpeechT5PreTrainedModel:()=>r.SpeechT5PreTrainedModel,SpeechT5Processor:()=>ne.SpeechT5Processor,SpeechT5Tokenizer:()=>f.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>r.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>r.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>r.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>r.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>r.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>f.SqueezeBertTokenizer,StableLmForCausalLM:()=>r.StableLmForCausalLM,StableLmModel:()=>r.StableLmModel,StableLmPreTrainedModel:()=>r.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>r.Starcoder2ForCausalLM,Starcoder2Model:()=>r.Starcoder2Model,Starcoder2PreTrainedModel:()=>r.Starcoder2PreTrainedModel,StoppingCriteria:()=>X.StoppingCriteria,StoppingCriteriaList:()=>X.StoppingCriteriaList,StyleTextToSpeech2Model:()=>r.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>r.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>I.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>$.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>r.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>A.Swin2SRImageProcessor,Swin2SRModel:()=>r.Swin2SRModel,Swin2SRPreTrainedModel:()=>r.Swin2SRPreTrainedModel,SwinForImageClassification:()=>r.SwinForImageClassification,SwinModel:()=>r.SwinModel,SwinPreTrainedModel:()=>r.SwinPreTrainedModel,T5ForConditionalGeneration:()=>r.T5ForConditionalGeneration,T5Model:()=>r.T5Model,T5PreTrainedModel:()=>r.T5PreTrainedModel,T5Tokenizer:()=>f.T5Tokenizer,TableTransformerForObjectDetection:()=>r.TableTransformerForObjectDetection,TableTransformerModel:()=>r.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>r.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>r.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>$.TemperatureLogitsWarper,Tensor:()=>R.Tensor,Text2TextGenerationPipeline:()=>I.Text2TextGenerationPipeline,TextClassificationPipeline:()=>I.TextClassificationPipeline,TextGenerationPipeline:()=>I.TextGenerationPipeline,TextStreamer:()=>U.TextStreamer,TextToAudioPipeline:()=>I.TextToAudioPipeline,TokenClassificationPipeline:()=>I.TokenClassificationPipeline,TokenClassifierOutput:()=>r.TokenClassifierOutput,TokenizerModel:()=>f.TokenizerModel,TopKLogitsWarper:()=>$.TopKLogitsWarper,TopPLogitsWarper:()=>$.TopPLogitsWarper,TrOCRForCausalLM:()=>r.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>r.TrOCRPreTrainedModel,TranslationPipeline:()=>I.TranslationPipeline,UniSpeechForCTC:()=>r.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>r.UniSpeechForSequenceClassification,UniSpeechModel:()=>r.UniSpeechModel,UniSpeechPreTrainedModel:()=>r.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>r.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>r.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>r.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>r.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>r.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>ne.VLChatProcessor,VLMImageProcessor:()=>A.VLMImageProcessor,ViTFeatureExtractor:()=>A.ViTFeatureExtractor,ViTForImageClassification:()=>r.ViTForImageClassification,ViTImageProcessor:()=>A.ViTImageProcessor,ViTMAEModel:()=>r.ViTMAEModel,ViTMAEPreTrainedModel:()=>r.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>r.ViTMSNForImageClassification,ViTMSNModel:()=>r.ViTMSNModel,ViTMSNPreTrainedModel:()=>r.ViTMSNPreTrainedModel,ViTModel:()=>r.ViTModel,ViTPreTrainedModel:()=>r.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>r.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>r.VitMatteForImageMatting,VitMatteImageProcessor:()=>A.VitMatteImageProcessor,VitMattePreTrainedModel:()=>r.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>r.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>A.VitPoseImageProcessor,VitPosePreTrainedModel:()=>r.VitPosePreTrainedModel,VitsModel:()=>r.VitsModel,VitsModelOutput:()=>r.VitsModelOutput,VitsPreTrainedModel:()=>r.VitsPreTrainedModel,VitsTokenizer:()=>f.VitsTokenizer,Wav2Vec2BertForCTC:()=>r.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>r.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>r.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>r.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>f.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>y.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>r.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>r.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>r.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>r.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>r.Wav2Vec2PreTrainedModel,Wav2Vec2ProcessorWithLM:()=>ne.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>r.WavLMForAudioFrameClassification,WavLMForCTC:()=>r.WavLMForCTC,WavLMForSequenceClassification:()=>r.WavLMForSequenceClassification,WavLMForXVector:()=>r.WavLMForXVector,WavLMModel:()=>r.WavLMModel,WavLMPreTrainedModel:()=>r.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>y.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>r.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>r.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>y.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>r.WhisperForConditionalGeneration,WhisperModel:()=>r.WhisperModel,WhisperPreTrainedModel:()=>r.WhisperPreTrainedModel,WhisperProcessor:()=>ne.WhisperProcessor,WhisperTextStreamer:()=>U.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>$.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>f.WhisperTokenizer,XLMForQuestionAnswering:()=>r.XLMForQuestionAnswering,XLMForSequenceClassification:()=>r.XLMForSequenceClassification,XLMForTokenClassification:()=>r.XLMForTokenClassification,XLMModel:()=>r.XLMModel,XLMPreTrainedModel:()=>r.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>r.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>r.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>r.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>r.XLMRobertaForTokenClassification,XLMRobertaModel:()=>r.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>r.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>f.XLMRobertaTokenizer,XLMTokenizer:()=>f.XLMTokenizer,XLMWithLMHeadModel:()=>r.XLMWithLMHeadModel,XVectorOutput:()=>r.XVectorOutput,YolosFeatureExtractor:()=>A.YolosFeatureExtractor,YolosForObjectDetection:()=>r.YolosForObjectDetection,YolosImageProcessor:()=>A.YolosImageProcessor,YolosModel:()=>r.YolosModel,YolosObjectDetectionOutput:()=>r.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>r.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>I.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>I.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>I.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>I.ZeroShotObjectDetectionPipeline,bankers_round:()=>g.bankers_round,cat:()=>R.cat,cos_sim:()=>g.cos_sim,dot:()=>g.dot,dynamic_time_warping:()=>g.dynamic_time_warping,env:()=>Le.env,full:()=>R.full,full_like:()=>R.full_like,getKeyValueShapes:()=>D.getKeyValueShapes,hamming:()=>j.hamming,hanning:()=>j.hanning,interpolate:()=>R.interpolate,interpolate_4d:()=>R.interpolate_4d,interpolate_data:()=>g.interpolate_data,is_chinese_char:()=>f.is_chinese_char,layer_norm:()=>R.layer_norm,load_image:()=>Y.load_image,log_softmax:()=>g.log_softmax,magnitude:()=>g.magnitude,matmul:()=>R.matmul,max:()=>g.max,mean:()=>R.mean,mean_pooling:()=>R.mean_pooling,medianFilter:()=>g.medianFilter,mel_filter_bank:()=>j.mel_filter_bank,min:()=>g.min,ones:()=>R.ones,ones_like:()=>R.ones_like,permute:()=>R.permute,permute_data:()=>g.permute_data,pipeline:()=>I.pipeline,quantize_embeddings:()=>R.quantize_embeddings,rand:()=>R.rand,read_audio:()=>j.read_audio,rfft:()=>R.rfft,round:()=>g.round,slice:()=>R.slice,softmax:()=>g.softmax,spectrogram:()=>j.spectrogram,stack:()=>R.stack,std_mean:()=>R.std_mean,topk:()=>R.topk,window_function:()=>j.window_function,zeros:()=>R.zeros,zeros_like:()=>R.zeros_like});var Le=gs("./src/env.js"),I=gs("./src/pipelines.js"),r=gs("./src/models.js"),f=gs("./src/tokenizers.js"),D=gs("./src/configs.js"),j=gs("./src/utils/audio.js"),Y=gs("./src/utils/image.js"),R=gs("./src/utils/tensor.js"),g=gs("./src/utils/maths.js"),v=gs("./src/base/feature_extraction_utils.js"),y=gs("./src/models/feature_extractors.js"),M=gs("./src/models/auto/feature_extraction_auto.js"),b=gs("./src/base/image_processors_utils.js"),A=gs("./src/models/image_processors.js"),K=gs("./src/models/auto/image_processing_auto.js"),te=gs("./src/base/processing_utils.js"),ne=gs("./src/models/processors.js"),W=gs("./src/models/auto/processing_auto.js"),U=gs("./src/generation/streamers.js"),X=gs("./src/generation/stopping_criteria.js"),$=gs("./src/generation/logits_process.js")})(),c.ASTFeatureExtractor,c.ASTForAudioClassification,c.ASTModel,c.ASTPreTrainedModel,c.AlbertForMaskedLM,c.AlbertForQuestionAnswering,c.AlbertForSequenceClassification,c.AlbertModel,c.AlbertPreTrainedModel,c.AlbertTokenizer,c.AudioClassificationPipeline,c.AutoConfig,c.AutoFeatureExtractor,c.AutoImageProcessor,c.AutoModel,c.AutoModelForAudioClassification,c.AutoModelForAudioFrameClassification,c.AutoModelForCTC;var r_=c.AutoModelForCausalLM;c.AutoModelForDepthEstimation,c.AutoModelForDocumentQuestionAnswering,c.AutoModelForImageClassification,c.AutoModelForImageFeatureExtraction,c.AutoModelForImageMatting,c.AutoModelForImageSegmentation,c.AutoModelForImageToImage,c.AutoModelForMaskGeneration,c.AutoModelForMaskedLM,c.AutoModelForNormalEstimation,c.AutoModelForObjectDetection,c.AutoModelForPoseEstimation,c.AutoModelForQuestionAnswering,c.AutoModelForSemanticSegmentation,c.AutoModelForSeq2SeqLM,c.AutoModelForSequenceClassification,c.AutoModelForSpeechSeq2Seq,c.AutoModelForTextToSpectrogram,c.AutoModelForTextToWaveform,c.AutoModelForTokenClassification,c.AutoModelForUniversalSegmentation,c.AutoModelForVision2Seq,c.AutoModelForXVector,c.AutoModelForZeroShotObjectDetection,c.AutoProcessor;var n_=c.AutoTokenizer;c.AutomaticSpeechRecognitionPipeline,c.BartForConditionalGeneration,c.BartForSequenceClassification,c.BartModel,c.BartPretrainedModel,c.BartTokenizer,c.BaseModelOutput,c.BaseStreamer,c.BeitFeatureExtractor,c.BeitForImageClassification,c.BeitModel,c.BeitPreTrainedModel,c.BertForMaskedLM,c.BertForQuestionAnswering,c.BertForSequenceClassification,c.BertForTokenClassification,c.BertModel,c.BertPreTrainedModel,c.BertTokenizer,c.BitImageProcessor,c.BlenderbotForConditionalGeneration,c.BlenderbotModel,c.BlenderbotPreTrainedModel,c.BlenderbotSmallForConditionalGeneration,c.BlenderbotSmallModel,c.BlenderbotSmallPreTrainedModel,c.BlenderbotSmallTokenizer,c.BlenderbotTokenizer,c.BloomForCausalLM,c.BloomModel,c.BloomPreTrainedModel,c.BloomTokenizer,c.CLIPFeatureExtractor,c.CLIPImageProcessor,c.CLIPModel,c.CLIPPreTrainedModel,c.CLIPSegForImageSegmentation,c.CLIPSegModel,c.CLIPSegPreTrainedModel,c.CLIPTextModel,c.CLIPTextModelWithProjection,c.CLIPTokenizer,c.CLIPVisionModel,c.CLIPVisionModelWithProjection,c.CamembertForMaskedLM,c.CamembertForQuestionAnswering,c.CamembertForSequenceClassification,c.CamembertForTokenClassification,c.CamembertModel,c.CamembertPreTrainedModel,c.CamembertTokenizer,c.CausalLMOutput,c.CausalLMOutputWithPast,c.ChineseCLIPFeatureExtractor,c.ChineseCLIPModel,c.ChineseCLIPPreTrainedModel,c.ClapAudioModelWithProjection,c.ClapFeatureExtractor,c.ClapModel,c.ClapPreTrainedModel,c.ClapTextModelWithProjection,c.ClassifierFreeGuidanceLogitsProcessor,c.CodeGenForCausalLM,c.CodeGenModel,c.CodeGenPreTrainedModel,c.CodeGenTokenizer,c.CodeLlamaTokenizer,c.CohereForCausalLM,c.CohereModel,c.CoherePreTrainedModel,c.CohereTokenizer,c.ConvBertForMaskedLM,c.ConvBertForQuestionAnswering,c.ConvBertForSequenceClassification,c.ConvBertForTokenClassification,c.ConvBertModel,c.ConvBertPreTrainedModel,c.ConvBertTokenizer,c.ConvNextFeatureExtractor,c.ConvNextForImageClassification,c.ConvNextImageProcessor,c.ConvNextModel,c.ConvNextPreTrainedModel,c.ConvNextV2ForImageClassification,c.ConvNextV2Model,c.ConvNextV2PreTrainedModel,c.DPTFeatureExtractor,c.DPTForDepthEstimation,c.DPTImageProcessor,c.DPTModel,c.DPTPreTrainedModel,c.DebertaForMaskedLM,c.DebertaForQuestionAnswering,c.DebertaForSequenceClassification,c.DebertaForTokenClassification,c.DebertaModel,c.DebertaPreTrainedModel,c.DebertaTokenizer,c.DebertaV2ForMaskedLM,c.DebertaV2ForQuestionAnswering,c.DebertaV2ForSequenceClassification,c.DebertaV2ForTokenClassification,c.DebertaV2Model,c.DebertaV2PreTrainedModel,c.DebertaV2Tokenizer,c.DecisionTransformerModel,c.DecisionTransformerPreTrainedModel,c.DeiTFeatureExtractor,c.DeiTForImageClassification,c.DeiTImageProcessor,c.DeiTModel,c.DeiTPreTrainedModel,c.DepthAnythingForDepthEstimation,c.DepthAnythingPreTrainedModel,c.DepthEstimationPipeline,c.DepthProForDepthEstimation,c.DepthProPreTrainedModel,c.DetrFeatureExtractor,c.DetrForObjectDetection,c.DetrForSegmentation,c.DetrImageProcessor,c.DetrModel,c.DetrObjectDetectionOutput,c.DetrPreTrainedModel,c.DetrSegmentationOutput,c.Dinov2ForImageClassification,c.Dinov2Model,c.Dinov2PreTrainedModel,c.Dinov2WithRegistersForImageClassification,c.Dinov2WithRegistersModel,c.Dinov2WithRegistersPreTrainedModel,c.DistilBertForMaskedLM,c.DistilBertForQuestionAnswering,c.DistilBertForSequenceClassification,c.DistilBertForTokenClassification,c.DistilBertModel,c.DistilBertPreTrainedModel,c.DistilBertTokenizer,c.DocumentQuestionAnsweringPipeline,c.DonutFeatureExtractor,c.DonutImageProcessor,c.DonutSwinModel,c.DonutSwinPreTrainedModel,c.EfficientNetForImageClassification,c.EfficientNetImageProcessor,c.EfficientNetModel,c.EfficientNetPreTrainedModel,c.ElectraForMaskedLM,c.ElectraForQuestionAnswering,c.ElectraForSequenceClassification,c.ElectraForTokenClassification,c.ElectraModel,c.ElectraPreTrainedModel,c.ElectraTokenizer,c.EosTokenCriteria,c.EsmForMaskedLM,c.EsmForSequenceClassification,c.EsmForTokenClassification,c.EsmModel,c.EsmPreTrainedModel,c.EsmTokenizer,c.ExaoneForCausalLM,c.ExaoneModel,c.ExaonePreTrainedModel,c.FFT,c.FalconForCausalLM,c.FalconModel,c.FalconPreTrainedModel,c.FalconTokenizer,c.FastViTForImageClassification,c.FastViTModel,c.FastViTPreTrainedModel,c.FeatureExtractionPipeline,c.FeatureExtractor,c.FillMaskPipeline,c.Florence2ForConditionalGeneration,c.Florence2PreTrainedModel,c.Florence2Processor,c.ForcedBOSTokenLogitsProcessor,c.ForcedEOSTokenLogitsProcessor,c.GLPNFeatureExtractor,c.GLPNForDepthEstimation,c.GLPNModel,c.GLPNPreTrainedModel,c.GPT2LMHeadModel,c.GPT2Model,c.GPT2PreTrainedModel,c.GPT2Tokenizer,c.GPTBigCodeForCausalLM,c.GPTBigCodeModel,c.GPTBigCodePreTrainedModel,c.GPTJForCausalLM,c.GPTJModel,c.GPTJPreTrainedModel,c.GPTNeoForCausalLM,c.GPTNeoModel,c.GPTNeoPreTrainedModel,c.GPTNeoXForCausalLM,c.GPTNeoXModel,c.GPTNeoXPreTrainedModel,c.GPTNeoXTokenizer,c.Gemma2ForCausalLM,c.Gemma2Model,c.Gemma2PreTrainedModel,c.GemmaForCausalLM,c.GemmaModel,c.GemmaPreTrainedModel,c.GemmaTokenizer,c.GraniteForCausalLM,c.GraniteModel,c.GranitePreTrainedModel,c.Grok1Tokenizer,c.GroundingDinoForObjectDetection,c.GroundingDinoImageProcessor,c.GroundingDinoPreTrainedModel,c.GroundingDinoProcessor,c.GroupViTModel,c.GroupViTPreTrainedModel,c.HerbertTokenizer,c.HieraForImageClassification,c.HieraModel,c.HieraPreTrainedModel,c.HubertForCTC,c.HubertForSequenceClassification,c.HubertModel,c.HubertPreTrainedModel,c.IJepaForImageClassification,c.IJepaModel,c.IJepaPreTrainedModel,c.Idefics3ForConditionalGeneration,c.Idefics3ImageProcessor,c.Idefics3PreTrainedModel,c.Idefics3Processor,c.ImageClassificationPipeline,c.ImageFeatureExtractionPipeline,c.ImageFeatureExtractor,c.ImageMattingOutput,c.ImageProcessor,c.ImageSegmentationPipeline,c.ImageToImagePipeline,c.ImageToTextPipeline;var o_=c.InterruptableStoppingCriteria;c.JAISLMHeadModel,c.JAISModel,c.JAISPreTrainedModel,c.JinaCLIPImageProcessor,c.JinaCLIPModel,c.JinaCLIPPreTrainedModel,c.JinaCLIPProcessor,c.JinaCLIPTextModel,c.JinaCLIPVisionModel,c.LlamaForCausalLM,c.LlamaModel,c.LlamaPreTrainedModel,c.LlamaTokenizer,c.LlavaForConditionalGeneration,c.LlavaOnevisionForConditionalGeneration,c.LlavaOnevisionImageProcessor,c.LlavaPreTrainedModel,c.LogitsProcessor,c.LogitsProcessorList,c.LogitsWarper,c.LongT5ForConditionalGeneration,c.LongT5Model,c.LongT5PreTrainedModel,c.M2M100ForConditionalGeneration,c.M2M100Model,c.M2M100PreTrainedModel,c.M2M100Tokenizer,c.MBart50Tokenizer,c.MBartForCausalLM,c.MBartForConditionalGeneration,c.MBartForSequenceClassification,c.MBartModel,c.MBartPreTrainedModel,c.MBartTokenizer,c.MPNetForMaskedLM,c.MPNetForQuestionAnswering,c.MPNetForSequenceClassification,c.MPNetForTokenClassification,c.MPNetModel,c.MPNetPreTrainedModel,c.MPNetTokenizer,c.MT5ForConditionalGeneration,c.MT5Model,c.MT5PreTrainedModel,c.MarianMTModel,c.MarianModel,c.MarianPreTrainedModel,c.MarianTokenizer,c.Mask2FormerImageProcessor,c.MaskFormerFeatureExtractor,c.MaskFormerForInstanceSegmentation,c.MaskFormerImageProcessor,c.MaskFormerModel,c.MaskFormerPreTrainedModel,c.MaskedLMOutput,c.MaxLengthCriteria,c.MgpstrForSceneTextRecognition,c.MgpstrModelOutput,c.MgpstrPreTrainedModel,c.MgpstrProcessor,c.MgpstrTokenizer,c.MinLengthLogitsProcessor,c.MinNewTokensLengthLogitsProcessor,c.MistralForCausalLM,c.MistralModel,c.MistralPreTrainedModel,c.MobileBertForMaskedLM,c.MobileBertForQuestionAnswering,c.MobileBertForSequenceClassification,c.MobileBertModel,c.MobileBertPreTrainedModel,c.MobileBertTokenizer,c.MobileLLMForCausalLM,c.MobileLLMModel,c.MobileLLMPreTrainedModel,c.MobileNetV1FeatureExtractor,c.MobileNetV1ForImageClassification,c.MobileNetV1ImageProcessor,c.MobileNetV1Model,c.MobileNetV1PreTrainedModel,c.MobileNetV2FeatureExtractor,c.MobileNetV2ForImageClassification,c.MobileNetV2ImageProcessor,c.MobileNetV2Model,c.MobileNetV2PreTrainedModel,c.MobileNetV3FeatureExtractor,c.MobileNetV3ForImageClassification,c.MobileNetV3ImageProcessor,c.MobileNetV3Model,c.MobileNetV3PreTrainedModel,c.MobileNetV4FeatureExtractor,c.MobileNetV4ForImageClassification,c.MobileNetV4ImageProcessor,c.MobileNetV4Model,c.MobileNetV4PreTrainedModel,c.MobileViTFeatureExtractor,c.MobileViTForImageClassification,c.MobileViTImageProcessor,c.MobileViTModel,c.MobileViTPreTrainedModel,c.MobileViTV2ForImageClassification,c.MobileViTV2Model,c.MobileViTV2PreTrainedModel,c.ModelOutput,c.ModernBertForMaskedLM,c.ModernBertForSequenceClassification,c.ModernBertForTokenClassification,c.ModernBertModel,c.ModernBertPreTrainedModel,c.Moondream1ForConditionalGeneration,c.MoonshineFeatureExtractor,c.MoonshineForConditionalGeneration,c.MoonshineModel,c.MoonshinePreTrainedModel,c.MoonshineProcessor,c.MptForCausalLM,c.MptModel,c.MptPreTrainedModel,c.MultiModalityCausalLM,c.MultiModalityPreTrainedModel,c.MusicgenForCausalLM,c.MusicgenForConditionalGeneration,c.MusicgenModel,c.MusicgenPreTrainedModel,c.NllbTokenizer,c.NoBadWordsLogitsProcessor,c.NoRepeatNGramLogitsProcessor,c.NomicBertModel,c.NomicBertPreTrainedModel,c.NougatImageProcessor,c.NougatTokenizer,c.OPTForCausalLM,c.OPTModel,c.OPTPreTrainedModel,c.ObjectDetectionPipeline,c.Olmo2ForCausalLM,c.Olmo2Model,c.Olmo2PreTrainedModel,c.OlmoForCausalLM,c.OlmoModel,c.OlmoPreTrainedModel,c.OpenELMForCausalLM,c.OpenELMModel,c.OpenELMPreTrainedModel,c.OwlViTFeatureExtractor,c.OwlViTForObjectDetection,c.OwlViTImageProcessor,c.OwlViTModel,c.OwlViTPreTrainedModel,c.OwlViTProcessor,c.Owlv2ForObjectDetection,c.Owlv2ImageProcessor,c.Owlv2Model,c.Owlv2PreTrainedModel,c.PaliGemmaForConditionalGeneration,c.PaliGemmaPreTrainedModel,c.PaliGemmaProcessor,c.PatchTSMixerForPrediction,c.PatchTSMixerModel,c.PatchTSMixerPreTrainedModel,c.PatchTSTForPrediction,c.PatchTSTModel,c.PatchTSTPreTrainedModel,c.Phi3ForCausalLM,c.Phi3Model,c.Phi3PreTrainedModel,c.Phi3VForCausalLM,c.Phi3VImageProcessor,c.Phi3VPreTrainedModel,c.Phi3VProcessor,c.PhiForCausalLM,c.PhiModel,c.PhiPreTrainedModel,c.Pipeline,c.PreTrainedModel,c.PreTrainedTokenizer,c.PretrainedConfig,c.PretrainedMixin,c.Processor,c.PvtForImageClassification,c.PvtImageProcessor,c.PvtModel,c.PvtPreTrainedModel,c.PyAnnoteFeatureExtractor,c.PyAnnoteForAudioFrameClassification,c.PyAnnoteModel,c.PyAnnotePreTrainedModel,c.PyAnnoteProcessor,c.QuestionAnsweringModelOutput,c.QuestionAnsweringPipeline,c.Qwen2ForCausalLM,c.Qwen2Model,c.Qwen2PreTrainedModel,c.Qwen2Tokenizer,c.Qwen2VLForConditionalGeneration,c.Qwen2VLImageProcessor,c.Qwen2VLPreTrainedModel,c.Qwen2VLProcessor,c.RTDetrForObjectDetection,c.RTDetrImageProcessor,c.RTDetrModel,c.RTDetrObjectDetectionOutput,c.RTDetrPreTrainedModel,c.RawAudio,c.RawImage,c.RepetitionPenaltyLogitsProcessor,c.ResNetForImageClassification,c.ResNetModel,c.ResNetPreTrainedModel,c.RoFormerForMaskedLM,c.RoFormerForQuestionAnswering,c.RoFormerForSequenceClassification,c.RoFormerForTokenClassification,c.RoFormerModel,c.RoFormerPreTrainedModel,c.RoFormerTokenizer,c.RobertaForMaskedLM,c.RobertaForQuestionAnswering,c.RobertaForSequenceClassification,c.RobertaForTokenClassification,c.RobertaModel,c.RobertaPreTrainedModel,c.RobertaTokenizer,c.SamImageProcessor,c.SamImageSegmentationOutput,c.SamModel,c.SamPreTrainedModel,c.SamProcessor,c.SapiensForDepthEstimation,c.SapiensForNormalEstimation,c.SapiensForSemanticSegmentation,c.SapiensPreTrainedModel,c.SeamlessM4TFeatureExtractor,c.SegformerFeatureExtractor,c.SegformerForImageClassification,c.SegformerForSemanticSegmentation,c.SegformerImageProcessor,c.SegformerModel,c.SegformerPreTrainedModel,c.Seq2SeqLMOutput,c.SequenceClassifierOutput,c.SiglipImageProcessor,c.SiglipModel,c.SiglipPreTrainedModel,c.SiglipTextModel,c.SiglipTokenizer,c.SiglipVisionModel,c.SpeechT5FeatureExtractor,c.SpeechT5ForSpeechToText,c.SpeechT5ForTextToSpeech,c.SpeechT5HifiGan,c.SpeechT5Model,c.SpeechT5PreTrainedModel,c.SpeechT5Processor,c.SpeechT5Tokenizer,c.SqueezeBertForMaskedLM,c.SqueezeBertForQuestionAnswering,c.SqueezeBertForSequenceClassification,c.SqueezeBertModel,c.SqueezeBertPreTrainedModel,c.SqueezeBertTokenizer,c.StableLmForCausalLM,c.StableLmModel,c.StableLmPreTrainedModel,c.Starcoder2ForCausalLM,c.Starcoder2Model,c.Starcoder2PreTrainedModel,c.StoppingCriteria,c.StoppingCriteriaList,c.StyleTextToSpeech2Model,c.StyleTextToSpeech2PreTrainedModel,c.SummarizationPipeline,c.SuppressTokensAtBeginLogitsProcessor,c.Swin2SRForImageSuperResolution,c.Swin2SRImageProcessor,c.Swin2SRModel,c.Swin2SRPreTrainedModel,c.SwinForImageClassification,c.SwinModel,c.SwinPreTrainedModel,c.T5ForConditionalGeneration,c.T5Model,c.T5PreTrainedModel,c.T5Tokenizer,c.TableTransformerForObjectDetection,c.TableTransformerModel,c.TableTransformerObjectDetectionOutput,c.TableTransformerPreTrainedModel,c.TemperatureLogitsWarper,c.Tensor,c.Text2TextGenerationPipeline,c.TextClassificationPipeline,c.TextGenerationPipeline;var i_=c.TextStreamer;c.TextToAudioPipeline,c.TokenClassificationPipeline,c.TokenClassifierOutput,c.TokenizerModel,c.TopKLogitsWarper,c.TopPLogitsWarper,c.TrOCRForCausalLM,c.TrOCRPreTrainedModel,c.TranslationPipeline,c.UniSpeechForCTC,c.UniSpeechForSequenceClassification,c.UniSpeechModel,c.UniSpeechPreTrainedModel,c.UniSpeechSatForAudioFrameClassification,c.UniSpeechSatForCTC,c.UniSpeechSatForSequenceClassification,c.UniSpeechSatModel,c.UniSpeechSatPreTrainedModel,c.VLChatProcessor,c.VLMImageProcessor,c.ViTFeatureExtractor,c.ViTForImageClassification,c.ViTImageProcessor,c.ViTMAEModel,c.ViTMAEPreTrainedModel,c.ViTMSNForImageClassification,c.ViTMSNModel,c.ViTMSNPreTrainedModel,c.ViTModel,c.ViTPreTrainedModel,c.VisionEncoderDecoderModel,c.VitMatteForImageMatting,c.VitMatteImageProcessor,c.VitMattePreTrainedModel,c.VitPoseForPoseEstimation,c.VitPoseImageProcessor,c.VitPosePreTrainedModel,c.VitsModel,c.VitsModelOutput,c.VitsPreTrainedModel,c.VitsTokenizer,c.Wav2Vec2BertForCTC,c.Wav2Vec2BertForSequenceClassification,c.Wav2Vec2BertModel,c.Wav2Vec2BertPreTrainedModel,c.Wav2Vec2CTCTokenizer,c.Wav2Vec2FeatureExtractor,c.Wav2Vec2ForAudioFrameClassification,c.Wav2Vec2ForCTC,c.Wav2Vec2ForSequenceClassification,c.Wav2Vec2Model,c.Wav2Vec2PreTrainedModel,c.Wav2Vec2ProcessorWithLM,c.WavLMForAudioFrameClassification,c.WavLMForCTC,c.WavLMForSequenceClassification,c.WavLMForXVector,c.WavLMModel,c.WavLMPreTrainedModel,c.WeSpeakerFeatureExtractor,c.WeSpeakerResNetModel,c.WeSpeakerResNetPreTrainedModel,c.WhisperFeatureExtractor,c.WhisperForConditionalGeneration,c.WhisperModel,c.WhisperPreTrainedModel,c.WhisperProcessor,c.WhisperTextStreamer,c.WhisperTimeStampLogitsProcessor,c.WhisperTokenizer,c.XLMForQuestionAnswering,c.XLMForSequenceClassification,c.XLMForTokenClassification,c.XLMModel,c.XLMPreTrainedModel,c.XLMRobertaForMaskedLM,c.XLMRobertaForQuestionAnswering,c.XLMRobertaForSequenceClassification,c.XLMRobertaForTokenClassification,c.XLMRobertaModel,c.XLMRobertaPreTrainedModel,c.XLMRobertaTokenizer,c.XLMTokenizer,c.XLMWithLMHeadModel,c.XVectorOutput,c.YolosFeatureExtractor,c.YolosForObjectDetection,c.YolosImageProcessor,c.YolosModel,c.YolosObjectDetectionOutput,c.YolosPreTrainedModel,c.ZeroShotAudioClassificationPipeline,c.ZeroShotClassificationPipeline,c.ZeroShotImageClassificationPipeline,c.ZeroShotObjectDetectionPipeline,c.bankers_round,c.cat,c.cos_sim,c.dot,c.dynamic_time_warping,c.env,c.full,c.full_like,c.getKeyValueShapes,c.hamming,c.hanning,c.interpolate,c.interpolate_4d,c.interpolate_data,c.is_chinese_char,c.layer_norm,c.load_image,c.log_softmax,c.magnitude,c.matmul,c.max,c.mean,c.mean_pooling,c.medianFilter,c.mel_filter_bank,c.min,c.ones,c.ones_like,c.permute,c.permute_data,c.pipeline,c.quantize_embeddings,c.rand,c.read_audio,c.rfft,c.round,c.slice,c.softmax,c.spectrogram,c.stack,c.std_mean,c.topk,c.window_function,c.zeros,c.zeros_like;async function a_(){try{if(!await navigator.gpu.requestAdapter())throw new Error("WebGPU is not supported (no adapter found)")}catch(Le){self.postMessage({status:"error",data:Le.toString()})}}class Np{static async getInstance(I=null){return this.tokenizer??(this.tokenizer=n_.from_pretrained(this.model_id,{progress_callback:I})),this.model??(this.model=r_.from_pretrained(this.model_id,{dtype:"q4f16",device:"webgpu",progress_callback:I})),Promise.all([this.tokenizer,this.model])}}_e(Np,"model_id","onnx-community/DeepSeek-R1-Distill-Qwen-1.5B-ONNX");const Bc=new o_;async function l_(Le){const[I,r]=await Np.getInstance(),f=I.apply_chat_template(Le,{add_generation_prompt:!0,return_dict:!0}),[D,j]=I.encode("",{add_special_tokens:!1});let Y="thinking",R,g=0,v;const y=ne=>{R??(R=performance.now()),g++>0&&(v=g/(performance.now()-R)*1e3),ne[0]==j&&(Y="answering")},M=ne=>{self.postMessage({status:"update",output:ne,tps:v,numTokens:g,state:Y})},b=new i_(I,{skip_prompt:!0,skip_special_tokens:!0,callback_function:M,token_callback_function:y});self.postMessage({status:"start"});const{past_key_values:A,sequences:K}=await r.generate({...f,do_sample:!1,max_new_tokens:2048,streamer:b,stopping_criteria:Bc,return_dict_in_generate:!0}),te=I.batch_decode(K,{skip_special_tokens:!0});self.postMessage({status:"complete",output:te})}async function u_(){self.postMessage({status:"loading",data:"Loading model..."});const[Le,I]=await Np.getInstance(f=>{self.postMessage(f)});self.postMessage({status:"loading",data:"Compiling shaders and warming up model..."});const r=Le("a");await I.generate({...r,max_new_tokens:1}),self.postMessage({status:"ready"})}self.addEventListener("message",async Le=>{const{type:I,data:r}=Le.data;switch(I){case"check":a_();break;case"load":u_();break;case"generate":Bc.reset(),l_(r);break;case"interrupt":Bc.interrupt();break;case"reset":Bc.reset();break}})})();