import{S as Pr,i as Mr,s as zr,e as n,k as c,w as T,t as r,M as Ar,c as s,d as t,m,a,x as b,h as i,b as l,G as e,g as _,y as E,q as $,o as y,B as w,v as Cr,L as xa}from"../../chunks/vendor-hf-doc-builder.js";import{T as Vr}from"../../chunks/Tip-hf-doc-builder.js";import{D as R}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ta}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Pt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as va}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ir(I){let p,x,g,f,v;return f=new Ta({props:{code:`from transformers import ViTConfig, BertConfig, VisionTextDualEncoderConfig, VisionTextDualEncoderModel

# Initializing a BERT and ViT configuration
config_vision = ViTConfig()
config_text = BertConfig()

config = VisionTextDualEncoderConfig.from_vision_text_configs(config_vision, config_text, projection_dim=512)

# Initializing a BERT and ViT model (with random weights)
model = VisionTextDualEncoderModel(config=config)

# Accessing the model configuration
config_vision = model.config.vision_config
config_text = model.config.text_config

# Saving the model, including its configuration
model.save_pretrained("vit-bert")

# loading model and config from pretrained folder
vision_text_config = VisionTextDualEncoderConfig.from_pretrained("vit-bert")
model = VisionTextDualEncoderModel.from_pretrained("vit-bert", config=vision_text_config)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTConfig, BertConfig, VisionTextDualEncoderConfig, VisionTextDualEncoderModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BERT and ViT configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = ViTConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = BertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = VisionTextDualEncoderConfig.from_vision_text_configs(config_vision, config_text, projection_dim=<span class="hljs-number">512</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BERT and ViT model (with random weights)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VisionTextDualEncoderModel(config=config)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = model.config.vision_config
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = model.config.text_config

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Saving the model, including its configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># loading model and config from pretrained folder</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vision_text_config = VisionTextDualEncoderConfig.from_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VisionTextDualEncoderModel.from_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>, config=vision_text_config)`}}),{c(){p=n("p"),x=r("Examples:"),g=c(),T(f.$$.fragment)},l(d){p=s(d,"P",{});var h=a(p);x=i(h,"Examples:"),h.forEach(t),g=m(d),b(f.$$.fragment,d)},m(d,h){_(d,p,h),e(p,x),_(d,g,h),E(f,d,h),v=!0},p:xa,i(d){v||($(f.$$.fragment,d),v=!0)},o(d){y(f.$$.fragment,d),v=!1},d(d){d&&t(p),d&&t(g),w(f,d)}}}function Fr(I){let p,x,g,f,v;return{c(){p=n("p"),x=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),f=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=s(d,"P",{});var h=a(p);x=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(h,"CODE",{});var S=a(g);f=i(S,"Module"),S.forEach(t),v=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(d,h){_(d,p,h),e(p,x),e(p,g),e(g,f),e(p,v)},d(d){d&&t(p)}}}function qr(I){let p,x,g,f,v;return f=new Ta({props:{code:`from PIL import Image
import requests
from transformers import (
    VisionTextDualEncoderModel,
    VisionTextDualEncoderProcessor,
    AutoImageProcessor,
    Autookenizer,
)

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224")
processor = VisionTextDualEncoderProcessor(image_processor, tokenizer)
model = VisionTextDualEncoderModel.from_vision_text_pretrained(
    "google/vit-base-patch16-224", "bert-base-uncased"
)

# contrastive training
urls = [
    "http://images.cocodataset.org/val2017/000000039769.jpg",
    "https://farm3.staticflickr.com/2674/5850229113_4fe05d5265_z.jpg",
]
images = [Image.open(requests.get(url, stream=True).raw) for url in urls]
inputs = processor(
    text=["a photo of a cat", "a photo of a dog"], images=images, return_tensors="pt", padding=True
)
outputs = model(
    input_ids=inputs.input_ids,
    attention_mask=inputs.attention_mask,
    pixel_values=inputs.pixel_values,
    return_loss=True,
)
loss, logits_per_image = outputs.loss, outputs.logits_per_image  # this is the image-text similarity score

# save and load from pretrained
model.save_pretrained("vit-bert")
model = VisionTextDualEncoderModel.from_pretrained("vit-bert")

# inference
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    VisionTextDualEncoderModel,
<span class="hljs-meta">... </span>    VisionTextDualEncoderProcessor,
<span class="hljs-meta">... </span>    AutoImageProcessor,
<span class="hljs-meta">... </span>    Autookenizer,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = VisionTextDualEncoderProcessor(image_processor, tokenizer)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VisionTextDualEncoderModel.from_vision_text_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>, <span class="hljs-string">&quot;bert-base-uncased&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># contrastive training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>urls = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://farm3.staticflickr.com/2674/5850229113_4fe05d5265_z.jpg&quot;</span>,
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>images = [Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw) <span class="hljs-keyword">for</span> url <span class="hljs-keyword">in</span> urls]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=images, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(
<span class="hljs-meta">... </span>    input_ids=inputs.input_ids,
<span class="hljs-meta">... </span>    attention_mask=inputs.attention_mask,
<span class="hljs-meta">... </span>    pixel_values=inputs.pixel_values,
<span class="hljs-meta">... </span>    return_loss=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss, logits_per_image = outputs.loss, outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save and load from pretrained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VisionTextDualEncoderModel.from_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){p=n("p"),x=r("Examples:"),g=c(),T(f.$$.fragment)},l(d){p=s(d,"P",{});var h=a(p);x=i(h,"Examples:"),h.forEach(t),g=m(d),b(f.$$.fragment,d)},m(d,h){_(d,p,h),e(p,x),_(d,g,h),E(f,d,h),v=!0},p:xa,i(d){v||($(f.$$.fragment,d),v=!0)},o(d){y(f.$$.fragment,d),v=!1},d(d){d&&t(p),d&&t(g),w(f,d)}}}function Lr(I){let p,x,g,f,v;return{c(){p=n("p"),x=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),f=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=s(d,"P",{});var h=a(p);x=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(h,"CODE",{});var S=a(g);f=i(S,"Module"),S.forEach(t),v=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(d,h){_(d,p,h),e(p,x),e(p,g),e(g,f),e(p,v)},d(d){d&&t(p)}}}function Sr(I){let p,x,g,f,v;return f=new Ta({props:{code:`from PIL import Image
import requests
import jax
from transformers import (
    FlaxVisionTextDualEncoderModel,
    VisionTextDualEncoderProcessor,
    AutoImageProcessor,
    AutoTokenizer,
)

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
image_processor = AutoImageProcesor.from_pretrained("google/vit-base-patch16-224")
processor = VisionTextDualEncoderProcessor(image_processor, tokenizer)
model = FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(
    "google/vit-base-patch16-224", "bert-base-uncased"
)

# contrastive training
urls = [
    "http://images.cocodataset.org/val2017/000000039769.jpg",
    "https://farm3.staticflickr.com/2674/5850229113_4fe05d5265_z.jpg",
]
images = [Image.open(requests.get(url, stream=True).raw) for url in urls]
inputs = processor(
    text=["a photo of a cat", "a photo of a dog"], images=images, return_tensors="np", padding=True
)
outputs = model(
    input_ids=inputs.input_ids,
    attention_mask=inputs.attention_mask,
    pixel_values=inputs.pixel_values,
)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score

# save and load from pretrained
model.save_pretrained("vit-bert")
model = FlaxVisionTextDualEncoderModel.from_pretrained("vit-bert")

# inference
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = jax.nn.softmax(logits_per_image, axis=1)  # we can take the softmax to get the label probabilities`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    FlaxVisionTextDualEncoderModel,
<span class="hljs-meta">... </span>    VisionTextDualEncoderProcessor,
<span class="hljs-meta">... </span>    AutoImageProcessor,
<span class="hljs-meta">... </span>    AutoTokenizer,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcesor.from_pretrained(<span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = VisionTextDualEncoderProcessor(image_processor, tokenizer)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxVisionTextDualEncoderModel.from_vision_text_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>, <span class="hljs-string">&quot;bert-base-uncased&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># contrastive training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>urls = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://farm3.staticflickr.com/2674/5850229113_4fe05d5265_z.jpg&quot;</span>,
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>images = [Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw) <span class="hljs-keyword">for</span> url <span class="hljs-keyword">in</span> urls]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=images, return_tensors=<span class="hljs-string">&quot;np&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(
<span class="hljs-meta">... </span>    input_ids=inputs.input_ids,
<span class="hljs-meta">... </span>    attention_mask=inputs.attention_mask,
<span class="hljs-meta">... </span>    pixel_values=inputs.pixel_values,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save and load from pretrained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxVisionTextDualEncoderModel.from_pretrained(<span class="hljs-string">&quot;vit-bert&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = jax.nn.softmax(logits_per_image, axis=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){p=n("p"),x=r("Examples:"),g=c(),T(f.$$.fragment)},l(d){p=s(d,"P",{});var h=a(p);x=i(h,"Examples:"),h.forEach(t),g=m(d),b(f.$$.fragment,d)},m(d,h){_(d,p,h),e(p,x),_(d,g,h),E(f,d,h),v=!0},p:xa,i(d){v||($(f.$$.fragment,d),v=!0)},o(d){y(f.$$.fragment,d),v=!1},d(d){d&&t(p),d&&t(g),w(f,d)}}}function Or(I){let p,x,g,f,v,d,h,S,qo,no,U,Y,Mt,_e,Lo,zt,So,so,k,Oo,ot,No,Bo,At,Wo,Ro,nt,Uo,Jo,st,Ho,Zo,at,Go,Xo,Ct,Ko,Qo,rt,Yo,en,it,tn,on,ao,ee,nn,ve,sn,an,ro,J,te,It,xe,rn,Ft,ln,io,M,Te,dn,B,lt,cn,mn,dt,pn,fn,ct,hn,un,gn,H,_n,mt,vn,xn,pt,Tn,bn,En,oe,$n,ne,be,yn,Ee,wn,ft,jn,kn,Dn,se,$e,Vn,ye,Pn,ht,Mn,zn,lo,Z,ae,qt,we,An,Lt,Cn,co,z,je,In,St,Fn,qn,A,ut,Ln,Sn,gt,On,Nn,_t,Bn,Wn,Ot,Rn,Un,vt,Jn,Hn,Zn,re,ke,Gn,De,Xn,xt,Kn,Qn,Yn,ie,Ve,es,Pe,ts,Tt,os,ns,mo,G,le,Nt,Me,ss,Bt,as,po,D,ze,rs,Ae,is,bt,ls,ds,cs,Ce,ms,Ie,ps,fs,hs,Wt,us,gs,Fe,_s,Et,vs,xs,Ts,qe,bs,Le,Es,$s,ys,F,Se,ws,X,js,$t,ks,Ds,Rt,Vs,Ps,Ms,de,zs,ce,fo,K,me,Ut,Oe,As,Jt,Cs,ho,j,Ne,Is,Be,Fs,yt,qs,Ls,Ss,We,Os,Re,Ns,Bs,Ws,Ht,Rs,Us,Ue,Js,wt,Hs,Zs,Gs,Je,Xs,He,Ks,Qs,Ys,Zt,ea,ta,O,Gt,Ze,oa,na,Xt,Ge,sa,aa,Kt,Xe,ra,ia,Qt,Ke,la,da,q,Qe,ca,Q,ma,jt,pa,fa,Yt,ha,ua,ga,pe,_a,fe,uo;return d=new Pt({}),_e=new Pt({}),xe=new Pt({}),Te=new R({props:{name:"class transformers.VisionTextDualEncoderConfig",anchor:"transformers.VisionTextDualEncoderConfig",parameters:[{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VisionTextDualEncoderConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>) &#x2014;
Dictionary of configuration options that defines text model config.`,name:"text_config"},{anchor:"transformers.VisionTextDualEncoderConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>) &#x2014;
Dictionary of configuration options that defines vison model config.`,name:"vision_config"},{anchor:"transformers.VisionTextDualEncoderConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.VisionTextDualEncoderConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original CLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.VisionTextDualEncoderConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L28"}}),oe=new va({props:{anchor:"transformers.VisionTextDualEncoderConfig.example",$$slots:{default:[Ir]},$$scope:{ctx:I}}}),be=new R({props:{name:"from_vision_text_configs",anchor:"transformers.VisionTextDualEncoderConfig.from_vision_text_configs",parameters:[{name:"vision_config",val:": PretrainedConfig"},{name:"text_config",val:": PretrainedConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L105",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a></p>
`}}),$e=new R({props:{name:"to_dict",anchor:"transformers.VisionTextDualEncoderConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L117",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),we=new Pt({}),je=new R({props:{name:"class transformers.VisionTextDualEncoderProcessor",anchor:"transformers.VisionTextDualEncoderProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VisionTextDualEncoderProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.VisionTextDualEncoderProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L25"}}),ke=new R({props:{name:"batch_decode",anchor:"transformers.VisionTextDualEncoderProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L115"}}),Ve=new R({props:{name:"decode",anchor:"transformers.VisionTextDualEncoderProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L122"}}),Me=new Pt({}),ze=new R({props:{name:"class transformers.VisionTextDualEncoderModel",anchor:"transformers.VisionTextDualEncoderModel",parameters:[{name:"config",val:": typing.Optional[transformers.models.vision_text_dual_encoder.configuration_vision_text_dual_encoder.VisionTextDualEncoderConfig] = None"},{name:"vision_model",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"},{name:"text_model",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"}],parametersDescription:[{anchor:"transformers.VisionTextDualEncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/vision-encoder-decoder#transformers.VisionEncoderDecoderConfig">VisionEncoderDecoderConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L162"}}),Se=new R({props:{name:"forward",anchor:"transformers.VisionTextDualEncoderModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VisionTextDualEncoderModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.VisionTextDualEncoderModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.VisionTextDualEncoderModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.VisionTextDualEncoderModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
an image processor (e.g. if you use ViT as the encoder, you should use <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VisionTextDualEncoderModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.VisionTextDualEncoderModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.VisionTextDualEncoderModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VisionTextDualEncoderModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L294",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_clip.CLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new Vr({props:{$$slots:{default:[Fr]},$$scope:{ctx:I}}}),ce=new va({props:{anchor:"transformers.VisionTextDualEncoderModel.forward.example",$$slots:{default:[qr]},$$scope:{ctx:I}}}),Oe=new Pt({}),Ne=new R({props:{name:"class transformers.FlaxVisionTextDualEncoderModel",anchor:"transformers.FlaxVisionTextDualEncoderModel",parameters:[{name:"config",val:": VisionTextDualEncoderConfig"},{name:"input_shape",val:": typing.Optional[typing.Tuple] = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxVisionTextDualEncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig">VisionTextDualEncoderConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/modeling_flax_vision_text_dual_encoder.py#L219"}}),Qe=new R({props:{name:"__call__",anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__",parameters:[{name:"input_ids",val:""},{name:"pixel_values",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"token_type_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
an image processor (e.g. if you use ViT as the encoder, you should use <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/vision_text_dual_encoder/modeling_flax_vision_text_dual_encoder.py#L270",returnDescription:`
<p>A <code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a>) and inputs.</p>
<ul>
<li><strong>logits_per_image:(<code>jnp.ndarray</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>jnp.ndarray</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>jnp.ndarray</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>jnp.ndarray</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new Vr({props:{$$slots:{default:[Lr]},$$scope:{ctx:I}}}),fe=new va({props:{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.example",$$slots:{default:[Sr]},$$scope:{ctx:I}}}),{c(){p=n("meta"),x=c(),g=n("h1"),f=n("a"),v=n("span"),T(d.$$.fragment),h=c(),S=n("span"),qo=r("VisionTextDualEncoder"),no=c(),U=n("h2"),Y=n("a"),Mt=n("span"),T(_e.$$.fragment),Lo=c(),zt=n("span"),So=r("Overview"),so=c(),k=n("p"),Oo=r("The "),ot=n("a"),No=r("VisionTextDualEncoderModel"),Bo=r(` can be used to initialize a vision-text dual encoder model with
any pretrained vision autoencoding model as the vision encoder (`),At=n("em"),Wo=r("e.g."),Ro=c(),nt=n("a"),Uo=r("ViT"),Jo=r(", "),st=n("a"),Ho=r("BEiT"),Zo=r(", "),at=n("a"),Go=r("DeiT"),Xo=r(") and any pretrained text autoencoding model as the text encoder ("),Ct=n("em"),Ko=r("e.g."),Qo=c(),rt=n("a"),Yo=r("RoBERTa"),en=r(", "),it=n("a"),tn=r("BERT"),on=r(`). Two projection layers are added on top of both the vision and text encoder to project the output embeddings
to a shared latent space. The projection layers are randomly initialized so the model should be fine-tuned on a
downstream task. This model can be used to align the vision-text embeddings using CLIP like contrastive image-text
training and then can be used for zero-shot vision tasks such image-classification or retrieval.`),ao=c(),ee=n("p"),nn=r("In "),ve=n("a"),sn=r("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),an=r(` it is shown how
leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvement on
new zero-shot vision tasks such as image classification or retrieval.`),ro=c(),J=n("h2"),te=n("a"),It=n("span"),T(xe.$$.fragment),rn=c(),Ft=n("span"),ln=r("VisionTextDualEncoderConfig"),io=c(),M=n("div"),T(Te.$$.fragment),dn=c(),B=n("p"),lt=n("a"),cn=r("VisionTextDualEncoderConfig"),mn=r(` is the configuration class to store the configuration of a
`),dt=n("a"),pn=r("VisionTextDualEncoderModel"),fn=r(". It is used to instantiate "),ct=n("a"),hn=r("VisionTextDualEncoderModel"),un=r(` model according to the
specified arguments, defining the text model and vision model configs.`),gn=c(),H=n("p"),_n=r("Configuration objects inherit from "),mt=n("a"),vn=r("PretrainedConfig"),xn=r(` and can be used to control the model outputs. Read the
documentation from `),pt=n("a"),Tn=r("PretrainedConfig"),bn=r(" for more information."),En=c(),T(oe.$$.fragment),$n=c(),ne=n("div"),T(be.$$.fragment),yn=c(),Ee=n("p"),wn=r("Instantiate a "),ft=n("a"),jn=r("VisionTextDualEncoderConfig"),kn=r(` (or a derived class) from text model configuration and vision
model configuration.`),Dn=c(),se=n("div"),T($e.$$.fragment),Vn=c(),ye=n("p"),Pn=r("Serializes this instance to a Python dictionary. Override the default "),ht=n("a"),Mn=r("to_dict()"),zn=r("."),lo=c(),Z=n("h2"),ae=n("a"),qt=n("span"),T(we.$$.fragment),An=c(),Lt=n("span"),Cn=r("VisionTextDualEncoderProcessor"),co=c(),z=n("div"),T(je.$$.fragment),In=c(),St=n("p"),Fn=r(`Constructs a VisionTextDualEncoder processor which wraps an image processor and a tokenizer into a single
processor.`),qn=c(),A=n("p"),ut=n("a"),Ln=r("VisionTextDualEncoderProcessor"),Sn=r(" offers all the functionalities of "),gt=n("a"),On=r("AutoImageProcessor"),Nn=r(" and "),_t=n("a"),Bn=r("AutoTokenizer"),Wn=r(`.
See the `),Ot=n("code"),Rn=r("__call__()"),Un=r(" and "),vt=n("a"),Jn=r("decode()"),Hn=r(` for more
information.`),Zn=c(),re=n("div"),T(ke.$$.fragment),Gn=c(),De=n("p"),Xn=r(`This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s
`),xt=n("a"),Kn=r("batch_decode()"),Qn=r(". Please refer to the docstring of this method for more information."),Yn=c(),ie=n("div"),T(Ve.$$.fragment),es=c(),Pe=n("p"),ts=r("This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s "),Tt=n("a"),os=r("decode()"),ns=r(`.
Please refer to the docstring of this method for more information.`),mo=c(),G=n("h2"),le=n("a"),Nt=n("span"),T(Me.$$.fragment),ss=c(),Bt=n("span"),as=r("VisionTextDualEncoderModel"),po=c(),D=n("div"),T(ze.$$.fragment),rs=c(),Ae=n("p"),is=r(`This class can be used to initialize a vision-text dual encoder model with any pretrained vision autoencoding model
as the vision encoder and any pretrained text model as the text encoder. The vision and text encoders are loaded
via the `),bt=n("a"),ls=r("from_pretrained()"),ds=r(` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),cs=c(),Ce=n("p"),ms=r("In "),Ie=n("a"),ps=r("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),fs=r(` it is shown how
leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvment
on new zero-shot vision tasks such as image classification or retrieval.`),hs=c(),Wt=n("p"),us=r(`After such a Vision-Text-Dual-Encoder model has been trained/fine-tuned, it can be saved/loaded just like any other
models (see the examples for more information).`),gs=c(),Fe=n("p"),_s=r("This model inherits from "),Et=n("a"),vs=r("PreTrainedModel"),xs=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ts=c(),qe=n("p"),bs=r("This model is also a PyTorch "),Le=n("a"),Es=r("torch.nn.Module"),$s=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ys=c(),F=n("div"),T(Se.$$.fragment),ws=c(),X=n("p"),js=r("The "),$t=n("a"),ks=r("VisionTextDualEncoderModel"),Ds=r(" forward method, overrides the "),Rt=n("code"),Vs=r("__call__"),Ps=r(" special method."),Ms=c(),T(de.$$.fragment),zs=c(),T(ce.$$.fragment),fo=c(),K=n("h2"),me=n("a"),Ut=n("span"),T(Oe.$$.fragment),As=c(),Jt=n("span"),Cs=r("FlaxVisionTextDualEncoderModel"),ho=c(),j=n("div"),T(Ne.$$.fragment),Is=c(),Be=n("p"),Fs=r(`This class can be used to initialize a vision-text dual encoder model with any pretrained vision autoencoding model
as the vision encoder and any pretrained text model as the text encoder. The vision and text encoders are loaded
via the `),yt=n("a"),qs=r("from_pretrained()"),Ls=r(` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),Ss=c(),We=n("p"),Os=r("In "),Re=n("a"),Ns=r("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),Bs=r(` it is shown how
leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvment
on new zero-shot vision tasks such as image classification or retrieval.`),Ws=c(),Ht=n("p"),Rs=r(`After such a Vision-Text-Dual-Encoder model has been trained/fine-tuned, it can be saved/loaded just like any other
models (see the examples for more information).`),Us=c(),Ue=n("p"),Js=r("This model inherits from "),wt=n("a"),Hs=r("PreTrainedModel"),Zs=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gs=c(),Je=n("p"),Xs=r("This model is also a Flax Linen "),He=n("a"),Ks=r("flax.linen.Module"),Qs=r(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Ys=c(),Zt=n("p"),ea=r("Finally, this model supports inherent JAX features such as:"),ta=c(),O=n("ul"),Gt=n("li"),Ze=n("a"),oa=r("Just-In-Time (JIT) compilation"),na=c(),Xt=n("li"),Ge=n("a"),sa=r("Automatic Differentiation"),aa=c(),Kt=n("li"),Xe=n("a"),ra=r("Vectorization"),ia=c(),Qt=n("li"),Ke=n("a"),la=r("Parallelization"),da=c(),q=n("div"),T(Qe.$$.fragment),ca=c(),Q=n("p"),ma=r("The "),jt=n("a"),pa=r("FlaxVisionTextDualEncoderModel"),fa=r(" forward method, overrides the "),Yt=n("code"),ha=r("__call__"),ua=r(" special method."),ga=c(),T(pe.$$.fragment),_a=c(),T(fe.$$.fragment),this.h()},l(o){const u=Ar('[data-svelte="svelte-1phssyn"]',document.head);p=s(u,"META",{name:!0,content:!0}),u.forEach(t),x=m(o),g=s(o,"H1",{class:!0});var Ye=a(g);f=s(Ye,"A",{id:!0,class:!0,href:!0});var eo=a(f);v=s(eo,"SPAN",{});var to=a(v);b(d.$$.fragment,to),to.forEach(t),eo.forEach(t),h=m(Ye),S=s(Ye,"SPAN",{});var oo=a(S);qo=i(oo,"VisionTextDualEncoder"),oo.forEach(t),Ye.forEach(t),no=m(o),U=s(o,"H2",{class:!0});var et=a(U);Y=s(et,"A",{id:!0,class:!0,href:!0});var ba=a(Y);Mt=s(ba,"SPAN",{});var Ea=a(Mt);b(_e.$$.fragment,Ea),Ea.forEach(t),ba.forEach(t),Lo=m(et),zt=s(et,"SPAN",{});var $a=a(zt);So=i($a,"Overview"),$a.forEach(t),et.forEach(t),so=m(o),k=s(o,"P",{});var V=a(k);Oo=i(V,"The "),ot=s(V,"A",{href:!0});var ya=a(ot);No=i(ya,"VisionTextDualEncoderModel"),ya.forEach(t),Bo=i(V,` can be used to initialize a vision-text dual encoder model with
any pretrained vision autoencoding model as the vision encoder (`),At=s(V,"EM",{});var wa=a(At);Wo=i(wa,"e.g."),wa.forEach(t),Ro=m(V),nt=s(V,"A",{href:!0});var ja=a(nt);Uo=i(ja,"ViT"),ja.forEach(t),Jo=i(V,", "),st=s(V,"A",{href:!0});var ka=a(st);Ho=i(ka,"BEiT"),ka.forEach(t),Zo=i(V,", "),at=s(V,"A",{href:!0});var Da=a(at);Go=i(Da,"DeiT"),Da.forEach(t),Xo=i(V,") and any pretrained text autoencoding model as the text encoder ("),Ct=s(V,"EM",{});var Va=a(Ct);Ko=i(Va,"e.g."),Va.forEach(t),Qo=m(V),rt=s(V,"A",{href:!0});var Pa=a(rt);Yo=i(Pa,"RoBERTa"),Pa.forEach(t),en=i(V,", "),it=s(V,"A",{href:!0});var Ma=a(it);tn=i(Ma,"BERT"),Ma.forEach(t),on=i(V,`). Two projection layers are added on top of both the vision and text encoder to project the output embeddings
to a shared latent space. The projection layers are randomly initialized so the model should be fine-tuned on a
downstream task. This model can be used to align the vision-text embeddings using CLIP like contrastive image-text
training and then can be used for zero-shot vision tasks such image-classification or retrieval.`),V.forEach(t),ao=m(o),ee=s(o,"P",{});var go=a(ee);nn=i(go,"In "),ve=s(go,"A",{href:!0,rel:!0});var za=a(ve);sn=i(za,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),za.forEach(t),an=i(go,` it is shown how
leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvement on
new zero-shot vision tasks such as image classification or retrieval.`),go.forEach(t),ro=m(o),J=s(o,"H2",{class:!0});var _o=a(J);te=s(_o,"A",{id:!0,class:!0,href:!0});var Aa=a(te);It=s(Aa,"SPAN",{});var Ca=a(It);b(xe.$$.fragment,Ca),Ca.forEach(t),Aa.forEach(t),rn=m(_o),Ft=s(_o,"SPAN",{});var Ia=a(Ft);ln=i(Ia,"VisionTextDualEncoderConfig"),Ia.forEach(t),_o.forEach(t),io=m(o),M=s(o,"DIV",{class:!0});var L=a(M);b(Te.$$.fragment,L),dn=m(L),B=s(L,"P",{});var tt=a(B);lt=s(tt,"A",{href:!0});var Fa=a(lt);cn=i(Fa,"VisionTextDualEncoderConfig"),Fa.forEach(t),mn=i(tt,` is the configuration class to store the configuration of a
`),dt=s(tt,"A",{href:!0});var qa=a(dt);pn=i(qa,"VisionTextDualEncoderModel"),qa.forEach(t),fn=i(tt,". It is used to instantiate "),ct=s(tt,"A",{href:!0});var La=a(ct);hn=i(La,"VisionTextDualEncoderModel"),La.forEach(t),un=i(tt,` model according to the
specified arguments, defining the text model and vision model configs.`),tt.forEach(t),gn=m(L),H=s(L,"P",{});var kt=a(H);_n=i(kt,"Configuration objects inherit from "),mt=s(kt,"A",{href:!0});var Sa=a(mt);vn=i(Sa,"PretrainedConfig"),Sa.forEach(t),xn=i(kt,` and can be used to control the model outputs. Read the
documentation from `),pt=s(kt,"A",{href:!0});var Oa=a(pt);Tn=i(Oa,"PretrainedConfig"),Oa.forEach(t),bn=i(kt," for more information."),kt.forEach(t),En=m(L),b(oe.$$.fragment,L),$n=m(L),ne=s(L,"DIV",{class:!0});var vo=a(ne);b(be.$$.fragment,vo),yn=m(vo),Ee=s(vo,"P",{});var xo=a(Ee);wn=i(xo,"Instantiate a "),ft=s(xo,"A",{href:!0});var Na=a(ft);jn=i(Na,"VisionTextDualEncoderConfig"),Na.forEach(t),kn=i(xo,` (or a derived class) from text model configuration and vision
model configuration.`),xo.forEach(t),vo.forEach(t),Dn=m(L),se=s(L,"DIV",{class:!0});var To=a(se);b($e.$$.fragment,To),Vn=m(To),ye=s(To,"P",{});var bo=a(ye);Pn=i(bo,"Serializes this instance to a Python dictionary. Override the default "),ht=s(bo,"A",{href:!0});var Ba=a(ht);Mn=i(Ba,"to_dict()"),Ba.forEach(t),zn=i(bo,"."),bo.forEach(t),To.forEach(t),L.forEach(t),lo=m(o),Z=s(o,"H2",{class:!0});var Eo=a(Z);ae=s(Eo,"A",{id:!0,class:!0,href:!0});var Wa=a(ae);qt=s(Wa,"SPAN",{});var Ra=a(qt);b(we.$$.fragment,Ra),Ra.forEach(t),Wa.forEach(t),An=m(Eo),Lt=s(Eo,"SPAN",{});var Ua=a(Lt);Cn=i(Ua,"VisionTextDualEncoderProcessor"),Ua.forEach(t),Eo.forEach(t),co=m(o),z=s(o,"DIV",{class:!0});var W=a(z);b(je.$$.fragment,W),In=m(W),St=s(W,"P",{});var Ja=a(St);Fn=i(Ja,`Constructs a VisionTextDualEncoder processor which wraps an image processor and a tokenizer into a single
processor.`),Ja.forEach(t),qn=m(W),A=s(W,"P",{});var N=a(A);ut=s(N,"A",{href:!0});var Ha=a(ut);Ln=i(Ha,"VisionTextDualEncoderProcessor"),Ha.forEach(t),Sn=i(N," offers all the functionalities of "),gt=s(N,"A",{href:!0});var Za=a(gt);On=i(Za,"AutoImageProcessor"),Za.forEach(t),Nn=i(N," and "),_t=s(N,"A",{href:!0});var Ga=a(_t);Bn=i(Ga,"AutoTokenizer"),Ga.forEach(t),Wn=i(N,`.
See the `),Ot=s(N,"CODE",{});var Xa=a(Ot);Rn=i(Xa,"__call__()"),Xa.forEach(t),Un=i(N," and "),vt=s(N,"A",{href:!0});var Ka=a(vt);Jn=i(Ka,"decode()"),Ka.forEach(t),Hn=i(N,` for more
information.`),N.forEach(t),Zn=m(W),re=s(W,"DIV",{class:!0});var $o=a(re);b(ke.$$.fragment,$o),Gn=m($o),De=s($o,"P",{});var yo=a(De);Xn=i(yo,`This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s
`),xt=s(yo,"A",{href:!0});var Qa=a(xt);Kn=i(Qa,"batch_decode()"),Qa.forEach(t),Qn=i(yo,". Please refer to the docstring of this method for more information."),yo.forEach(t),$o.forEach(t),Yn=m(W),ie=s(W,"DIV",{class:!0});var wo=a(ie);b(Ve.$$.fragment,wo),es=m(wo),Pe=s(wo,"P",{});var jo=a(Pe);ts=i(jo,"This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s "),Tt=s(jo,"A",{href:!0});var Ya=a(Tt);os=i(Ya,"decode()"),Ya.forEach(t),ns=i(jo,`.
Please refer to the docstring of this method for more information.`),jo.forEach(t),wo.forEach(t),W.forEach(t),mo=m(o),G=s(o,"H2",{class:!0});var ko=a(G);le=s(ko,"A",{id:!0,class:!0,href:!0});var er=a(le);Nt=s(er,"SPAN",{});var tr=a(Nt);b(Me.$$.fragment,tr),tr.forEach(t),er.forEach(t),ss=m(ko),Bt=s(ko,"SPAN",{});var or=a(Bt);as=i(or,"VisionTextDualEncoderModel"),or.forEach(t),ko.forEach(t),po=m(o),D=s(o,"DIV",{class:!0});var C=a(D);b(ze.$$.fragment,C),rs=m(C),Ae=s(C,"P",{});var Do=a(Ae);is=i(Do,`This class can be used to initialize a vision-text dual encoder model with any pretrained vision autoencoding model
as the vision encoder and any pretrained text model as the text encoder. The vision and text encoders are loaded
via the `),bt=s(Do,"A",{href:!0});var nr=a(bt);ls=i(nr,"from_pretrained()"),nr.forEach(t),ds=i(Do,` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),Do.forEach(t),cs=m(C),Ce=s(C,"P",{});var Vo=a(Ce);ms=i(Vo,"In "),Ie=s(Vo,"A",{href:!0,rel:!0});var sr=a(Ie);ps=i(sr,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),sr.forEach(t),fs=i(Vo,` it is shown how
leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvment
on new zero-shot vision tasks such as image classification or retrieval.`),Vo.forEach(t),hs=m(C),Wt=s(C,"P",{});var ar=a(Wt);us=i(ar,`After such a Vision-Text-Dual-Encoder model has been trained/fine-tuned, it can be saved/loaded just like any other
models (see the examples for more information).`),ar.forEach(t),gs=m(C),Fe=s(C,"P",{});var Po=a(Fe);_s=i(Po,"This model inherits from "),Et=s(Po,"A",{href:!0});var rr=a(Et);vs=i(rr,"PreTrainedModel"),rr.forEach(t),xs=i(Po,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Po.forEach(t),Ts=m(C),qe=s(C,"P",{});var Mo=a(qe);bs=i(Mo,"This model is also a PyTorch "),Le=s(Mo,"A",{href:!0,rel:!0});var ir=a(Le);Es=i(ir,"torch.nn.Module"),ir.forEach(t),$s=i(Mo,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mo.forEach(t),ys=m(C),F=s(C,"DIV",{class:!0});var he=a(F);b(Se.$$.fragment,he),ws=m(he),X=s(he,"P",{});var Dt=a(X);js=i(Dt,"The "),$t=s(Dt,"A",{href:!0});var lr=a($t);ks=i(lr,"VisionTextDualEncoderModel"),lr.forEach(t),Ds=i(Dt," forward method, overrides the "),Rt=s(Dt,"CODE",{});var dr=a(Rt);Vs=i(dr,"__call__"),dr.forEach(t),Ps=i(Dt," special method."),Dt.forEach(t),Ms=m(he),b(de.$$.fragment,he),zs=m(he),b(ce.$$.fragment,he),he.forEach(t),C.forEach(t),fo=m(o),K=s(o,"H2",{class:!0});var zo=a(K);me=s(zo,"A",{id:!0,class:!0,href:!0});var cr=a(me);Ut=s(cr,"SPAN",{});var mr=a(Ut);b(Oe.$$.fragment,mr),mr.forEach(t),cr.forEach(t),As=m(zo),Jt=s(zo,"SPAN",{});var pr=a(Jt);Cs=i(pr,"FlaxVisionTextDualEncoderModel"),pr.forEach(t),zo.forEach(t),ho=m(o),j=s(o,"DIV",{class:!0});var P=a(j);b(Ne.$$.fragment,P),Is=m(P),Be=s(P,"P",{});var Ao=a(Be);Fs=i(Ao,`This class can be used to initialize a vision-text dual encoder model with any pretrained vision autoencoding model
as the vision encoder and any pretrained text model as the text encoder. The vision and text encoders are loaded
via the `),yt=s(Ao,"A",{href:!0});var fr=a(yt);qs=i(fr,"from_pretrained()"),fr.forEach(t),Ls=i(Ao,` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),Ao.forEach(t),Ss=m(P),We=s(P,"P",{});var Co=a(We);Os=i(Co,"In "),Re=s(Co,"A",{href:!0,rel:!0});var hr=a(Re);Ns=i(hr,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),hr.forEach(t),Bs=i(Co,` it is shown how
leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvment
on new zero-shot vision tasks such as image classification or retrieval.`),Co.forEach(t),Ws=m(P),Ht=s(P,"P",{});var ur=a(Ht);Rs=i(ur,`After such a Vision-Text-Dual-Encoder model has been trained/fine-tuned, it can be saved/loaded just like any other
models (see the examples for more information).`),ur.forEach(t),Us=m(P),Ue=s(P,"P",{});var Io=a(Ue);Js=i(Io,"This model inherits from "),wt=s(Io,"A",{href:!0});var gr=a(wt);Hs=i(gr,"PreTrainedModel"),gr.forEach(t),Zs=i(Io,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Io.forEach(t),Gs=m(P),Je=s(P,"P",{});var Fo=a(Je);Xs=i(Fo,"This model is also a Flax Linen "),He=s(Fo,"A",{href:!0,rel:!0});var _r=a(He);Ks=i(_r,"flax.linen.Module"),_r.forEach(t),Qs=i(Fo,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Fo.forEach(t),Ys=m(P),Zt=s(P,"P",{});var vr=a(Zt);ea=i(vr,"Finally, this model supports inherent JAX features such as:"),vr.forEach(t),ta=m(P),O=s(P,"UL",{});var ue=a(O);Gt=s(ue,"LI",{});var xr=a(Gt);Ze=s(xr,"A",{href:!0,rel:!0});var Tr=a(Ze);oa=i(Tr,"Just-In-Time (JIT) compilation"),Tr.forEach(t),xr.forEach(t),na=m(ue),Xt=s(ue,"LI",{});var br=a(Xt);Ge=s(br,"A",{href:!0,rel:!0});var Er=a(Ge);sa=i(Er,"Automatic Differentiation"),Er.forEach(t),br.forEach(t),aa=m(ue),Kt=s(ue,"LI",{});var $r=a(Kt);Xe=s($r,"A",{href:!0,rel:!0});var yr=a(Xe);ra=i(yr,"Vectorization"),yr.forEach(t),$r.forEach(t),ia=m(ue),Qt=s(ue,"LI",{});var wr=a(Qt);Ke=s(wr,"A",{href:!0,rel:!0});var jr=a(Ke);la=i(jr,"Parallelization"),jr.forEach(t),wr.forEach(t),ue.forEach(t),da=m(P),q=s(P,"DIV",{class:!0});var ge=a(q);b(Qe.$$.fragment,ge),ca=m(ge),Q=s(ge,"P",{});var Vt=a(Q);ma=i(Vt,"The "),jt=s(Vt,"A",{href:!0});var kr=a(jt);pa=i(kr,"FlaxVisionTextDualEncoderModel"),kr.forEach(t),fa=i(Vt," forward method, overrides the "),Yt=s(Vt,"CODE",{});var Dr=a(Yt);ha=i(Dr,"__call__"),Dr.forEach(t),ua=i(Vt," special method."),Vt.forEach(t),ga=m(ge),b(pe.$$.fragment,ge),_a=m(ge),b(fe.$$.fragment,ge),ge.forEach(t),P.forEach(t),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Nr)),l(f,"id","visiontextdualencoder"),l(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(f,"href","#visiontextdualencoder"),l(g,"class","relative group"),l(Y,"id","overview"),l(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Y,"href","#overview"),l(U,"class","relative group"),l(ot,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),l(nt,"href","vit"),l(st,"href","beit"),l(at,"href","deit"),l(rt,"href","roberta"),l(it,"href","bert"),l(ve,"href","https://arxiv.org/abs/2111.07991"),l(ve,"rel","nofollow"),l(te,"id","transformers.VisionTextDualEncoderConfig"),l(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(te,"href","#transformers.VisionTextDualEncoderConfig"),l(J,"class","relative group"),l(lt,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"),l(dt,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),l(ct,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),l(mt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(pt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(ft,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"),l(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ht,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),l(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ae,"id","transformers.VisionTextDualEncoderProcessor"),l(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ae,"href","#transformers.VisionTextDualEncoderProcessor"),l(Z,"class","relative group"),l(ut,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor"),l(gt,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor"),l(_t,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer"),l(vt,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor.decode"),l(xt,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),l(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Tt,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),l(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(le,"id","transformers.VisionTextDualEncoderModel"),l(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(le,"href","#transformers.VisionTextDualEncoderModel"),l(G,"class","relative group"),l(bt,"href","/docs/transformers/main/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained"),l(Ie,"href","https://arxiv.org/abs/2111.07991"),l(Ie,"rel","nofollow"),l(Et,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(Le,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Le,"rel","nofollow"),l($t,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"id","transformers.FlaxVisionTextDualEncoderModel"),l(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(me,"href","#transformers.FlaxVisionTextDualEncoderModel"),l(K,"class","relative group"),l(yt,"href","/docs/transformers/main/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained"),l(Re,"href","https://arxiv.org/abs/2111.07991"),l(Re,"rel","nofollow"),l(wt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(He,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),l(He,"rel","nofollow"),l(Ze,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),l(Ze,"rel","nofollow"),l(Ge,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),l(Ge,"rel","nofollow"),l(Xe,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),l(Xe,"rel","nofollow"),l(Ke,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),l(Ke,"rel","nofollow"),l(jt,"href","/docs/transformers/main/en/model_doc/vision-text-dual-encoder#transformers.FlaxVisionTextDualEncoderModel"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,u){e(document.head,p),_(o,x,u),_(o,g,u),e(g,f),e(f,v),E(d,v,null),e(g,h),e(g,S),e(S,qo),_(o,no,u),_(o,U,u),e(U,Y),e(Y,Mt),E(_e,Mt,null),e(U,Lo),e(U,zt),e(zt,So),_(o,so,u),_(o,k,u),e(k,Oo),e(k,ot),e(ot,No),e(k,Bo),e(k,At),e(At,Wo),e(k,Ro),e(k,nt),e(nt,Uo),e(k,Jo),e(k,st),e(st,Ho),e(k,Zo),e(k,at),e(at,Go),e(k,Xo),e(k,Ct),e(Ct,Ko),e(k,Qo),e(k,rt),e(rt,Yo),e(k,en),e(k,it),e(it,tn),e(k,on),_(o,ao,u),_(o,ee,u),e(ee,nn),e(ee,ve),e(ve,sn),e(ee,an),_(o,ro,u),_(o,J,u),e(J,te),e(te,It),E(xe,It,null),e(J,rn),e(J,Ft),e(Ft,ln),_(o,io,u),_(o,M,u),E(Te,M,null),e(M,dn),e(M,B),e(B,lt),e(lt,cn),e(B,mn),e(B,dt),e(dt,pn),e(B,fn),e(B,ct),e(ct,hn),e(B,un),e(M,gn),e(M,H),e(H,_n),e(H,mt),e(mt,vn),e(H,xn),e(H,pt),e(pt,Tn),e(H,bn),e(M,En),E(oe,M,null),e(M,$n),e(M,ne),E(be,ne,null),e(ne,yn),e(ne,Ee),e(Ee,wn),e(Ee,ft),e(ft,jn),e(Ee,kn),e(M,Dn),e(M,se),E($e,se,null),e(se,Vn),e(se,ye),e(ye,Pn),e(ye,ht),e(ht,Mn),e(ye,zn),_(o,lo,u),_(o,Z,u),e(Z,ae),e(ae,qt),E(we,qt,null),e(Z,An),e(Z,Lt),e(Lt,Cn),_(o,co,u),_(o,z,u),E(je,z,null),e(z,In),e(z,St),e(St,Fn),e(z,qn),e(z,A),e(A,ut),e(ut,Ln),e(A,Sn),e(A,gt),e(gt,On),e(A,Nn),e(A,_t),e(_t,Bn),e(A,Wn),e(A,Ot),e(Ot,Rn),e(A,Un),e(A,vt),e(vt,Jn),e(A,Hn),e(z,Zn),e(z,re),E(ke,re,null),e(re,Gn),e(re,De),e(De,Xn),e(De,xt),e(xt,Kn),e(De,Qn),e(z,Yn),e(z,ie),E(Ve,ie,null),e(ie,es),e(ie,Pe),e(Pe,ts),e(Pe,Tt),e(Tt,os),e(Pe,ns),_(o,mo,u),_(o,G,u),e(G,le),e(le,Nt),E(Me,Nt,null),e(G,ss),e(G,Bt),e(Bt,as),_(o,po,u),_(o,D,u),E(ze,D,null),e(D,rs),e(D,Ae),e(Ae,is),e(Ae,bt),e(bt,ls),e(Ae,ds),e(D,cs),e(D,Ce),e(Ce,ms),e(Ce,Ie),e(Ie,ps),e(Ce,fs),e(D,hs),e(D,Wt),e(Wt,us),e(D,gs),e(D,Fe),e(Fe,_s),e(Fe,Et),e(Et,vs),e(Fe,xs),e(D,Ts),e(D,qe),e(qe,bs),e(qe,Le),e(Le,Es),e(qe,$s),e(D,ys),e(D,F),E(Se,F,null),e(F,ws),e(F,X),e(X,js),e(X,$t),e($t,ks),e(X,Ds),e(X,Rt),e(Rt,Vs),e(X,Ps),e(F,Ms),E(de,F,null),e(F,zs),E(ce,F,null),_(o,fo,u),_(o,K,u),e(K,me),e(me,Ut),E(Oe,Ut,null),e(K,As),e(K,Jt),e(Jt,Cs),_(o,ho,u),_(o,j,u),E(Ne,j,null),e(j,Is),e(j,Be),e(Be,Fs),e(Be,yt),e(yt,qs),e(Be,Ls),e(j,Ss),e(j,We),e(We,Os),e(We,Re),e(Re,Ns),e(We,Bs),e(j,Ws),e(j,Ht),e(Ht,Rs),e(j,Us),e(j,Ue),e(Ue,Js),e(Ue,wt),e(wt,Hs),e(Ue,Zs),e(j,Gs),e(j,Je),e(Je,Xs),e(Je,He),e(He,Ks),e(Je,Qs),e(j,Ys),e(j,Zt),e(Zt,ea),e(j,ta),e(j,O),e(O,Gt),e(Gt,Ze),e(Ze,oa),e(O,na),e(O,Xt),e(Xt,Ge),e(Ge,sa),e(O,aa),e(O,Kt),e(Kt,Xe),e(Xe,ra),e(O,ia),e(O,Qt),e(Qt,Ke),e(Ke,la),e(j,da),e(j,q),E(Qe,q,null),e(q,ca),e(q,Q),e(Q,ma),e(Q,jt),e(jt,pa),e(Q,fa),e(Q,Yt),e(Yt,ha),e(Q,ua),e(q,ga),E(pe,q,null),e(q,_a),E(fe,q,null),uo=!0},p(o,[u]){const Ye={};u&2&&(Ye.$$scope={dirty:u,ctx:o}),oe.$set(Ye);const eo={};u&2&&(eo.$$scope={dirty:u,ctx:o}),de.$set(eo);const to={};u&2&&(to.$$scope={dirty:u,ctx:o}),ce.$set(to);const oo={};u&2&&(oo.$$scope={dirty:u,ctx:o}),pe.$set(oo);const et={};u&2&&(et.$$scope={dirty:u,ctx:o}),fe.$set(et)},i(o){uo||($(d.$$.fragment,o),$(_e.$$.fragment,o),$(xe.$$.fragment,o),$(Te.$$.fragment,o),$(oe.$$.fragment,o),$(be.$$.fragment,o),$($e.$$.fragment,o),$(we.$$.fragment,o),$(je.$$.fragment,o),$(ke.$$.fragment,o),$(Ve.$$.fragment,o),$(Me.$$.fragment,o),$(ze.$$.fragment,o),$(Se.$$.fragment,o),$(de.$$.fragment,o),$(ce.$$.fragment,o),$(Oe.$$.fragment,o),$(Ne.$$.fragment,o),$(Qe.$$.fragment,o),$(pe.$$.fragment,o),$(fe.$$.fragment,o),uo=!0)},o(o){y(d.$$.fragment,o),y(_e.$$.fragment,o),y(xe.$$.fragment,o),y(Te.$$.fragment,o),y(oe.$$.fragment,o),y(be.$$.fragment,o),y($e.$$.fragment,o),y(we.$$.fragment,o),y(je.$$.fragment,o),y(ke.$$.fragment,o),y(Ve.$$.fragment,o),y(Me.$$.fragment,o),y(ze.$$.fragment,o),y(Se.$$.fragment,o),y(de.$$.fragment,o),y(ce.$$.fragment,o),y(Oe.$$.fragment,o),y(Ne.$$.fragment,o),y(Qe.$$.fragment,o),y(pe.$$.fragment,o),y(fe.$$.fragment,o),uo=!1},d(o){t(p),o&&t(x),o&&t(g),w(d),o&&t(no),o&&t(U),w(_e),o&&t(so),o&&t(k),o&&t(ao),o&&t(ee),o&&t(ro),o&&t(J),w(xe),o&&t(io),o&&t(M),w(Te),w(oe),w(be),w($e),o&&t(lo),o&&t(Z),w(we),o&&t(co),o&&t(z),w(je),w(ke),w(Ve),o&&t(mo),o&&t(G),w(Me),o&&t(po),o&&t(D),w(ze),w(Se),w(de),w(ce),o&&t(fo),o&&t(K),w(Oe),o&&t(ho),o&&t(j),w(Ne),w(Qe),w(pe),w(fe)}}}const Nr={local:"visiontextdualencoder",sections:[{local:"overview",title:"Overview"},{local:"transformers.VisionTextDualEncoderConfig",title:"VisionTextDualEncoderConfig"},{local:"transformers.VisionTextDualEncoderProcessor",title:"VisionTextDualEncoderProcessor"},{local:"transformers.VisionTextDualEncoderModel",title:"VisionTextDualEncoderModel"},{local:"transformers.FlaxVisionTextDualEncoderModel",title:"FlaxVisionTextDualEncoderModel"}],title:"VisionTextDualEncoder"};function Br(I){return Cr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gr extends Pr{constructor(p){super();Mr(this,p,Br,Or,zr,{})}}export{Gr as default,Nr as metadata};
