import{S as Cl,i as zl,s as Dl,e as a,k as c,w as M,t as s,M as Fl,c as r,d as t,m,a as l,x as y,h as n,b as i,G as e,g as _,y as b,q as w,o as x,B as j,v as Nl,L as hs}from"../../chunks/vendor-hf-doc-builder.js";import{T as Mr}from"../../chunks/Tip-hf-doc-builder.js";import{D as A}from"../../chunks/Docstring-hf-doc-builder.js";import{C as us}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as _t}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ps}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Xl(Z){let p,v,f,h,T;return h=new us({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVENvbmZpZyUyQyUyMEJlcnRDb25maWclMkMlMjBWaXNpb25UZXh0RHVhbEVuY29kZXJDb25maWclMkMlMjBWaXNpb25UZXh0RHVhbEVuY29kZXJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCRVJUJTIwYW5kJTIwVmlUJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ192aXNpb24lMjAlM0QlMjBWaVRDb25maWcoKSUwQWNvbmZpZ190ZXh0JTIwJTNEJTIwQmVydENvbmZpZygpJTBBJTBBY29uZmlnJTIwJTNEJTIwVmlzaW9uVGV4dER1YWxFbmNvZGVyQ29uZmlnLmZyb21fdmlzaW9uX3RleHRfY29uZmlncyhjb25maWdfdmlzaW9uJTJDJTIwY29uZmlnX3RleHQlMkMlMjBwcm9qZWN0aW9uX2RpbSUzRDUxMiklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQkVSVCUyMGFuZCUyMFZpVCUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUwQW1vZGVsJTIwJTNEJTIwVmlzaW9uVGV4dER1YWxFbmNvZGVyTW9kZWwoY29uZmlnJTNEY29uZmlnKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ192aXNpb24lMjAlM0QlMjBtb2RlbC5jb25maWcudmlzaW9uX2NvbmZpZyUwQWNvbmZpZ190ZXh0JTIwJTNEJTIwbW9kZWwuY29uZmlnLnRleHRfY29uZmlnJTBBJTBBJTIzJTIwU2F2aW5nJTIwdGhlJTIwbW9kZWwlMkMlMjBpbmNsdWRpbmclMjBpdHMlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMnZpdC1iZXJ0JTIyKSUwQSUwQSUyMyUyMGxvYWRpbmclMjBtb2RlbCUyMGFuZCUyMGNvbmZpZyUyMGZyb20lMjBwcmV0cmFpbmVkJTIwZm9sZGVyJTBBdmlzaW9uX3RleHRfY29uZmlnJTIwJTNEJTIwVmlzaW9uVGV4dER1YWxFbmNvZGVyQ29uZmlnLmZyb21fcHJldHJhaW5lZCglMjJ2aXQtYmVydCUyMiklMEFtb2RlbCUyMCUzRCUyMFZpc2lvblRleHREdWFsRW5jb2Rlck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ2aXQtYmVydCUyMiUyQyUyMGNvbmZpZyUzRHZpc2lvbl90ZXh0X2NvbmZpZyk=",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=a("p"),v=s("Examples:"),f=c(),M(h.$$.fragment)},l(d){p=r(d,"P",{});var u=l(p);v=n(u,"Examples:"),u.forEach(t),f=m(d),y(h.$$.fragment,d)},m(d,u){_(d,p,u),e(p,v),_(d,f,u),b(h,d,u),T=!0},p:hs,i(d){T||(w(h.$$.fragment,d),T=!0)},o(d){x(h.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(f),j(h,d)}}}function Pl(Z){let p,v,f,h,T;return{c(){p=a("p"),v=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=s("Module"),T=s(`
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=r(d,"P",{});var u=l(p);v=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(u,"CODE",{});var B=l(f);h=n(B,"Module"),B.forEach(t),T=n(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){_(d,p,u),e(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lzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQSUwQSUyMyUyMHNhdmUlMjBhbmQlMjBsb2FkJTIwZnJvbSUyMHByZXRyYWluZWQlMEFtb2RlbC5zYXZlX3ByZXRyYWluZWQoJTIydml0LWJlcnQlMjIpJTBBbW9kZWwlMjAlM0QlMjBWaXNpb25UZXh0RHVhbEVuY29kZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydml0LWJlcnQlMjIpJTBBJTBBJTIzJTIwaW5mZXJlbmNlJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",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>    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 = 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=a("p"),v=s("Examples:"),f=c(),M(h.$$.fragment)},l(d){p=r(d,"P",{});var u=l(p);v=n(u,"Examples:"),u.forEach(t),f=m(d),y(h.$$.fragment,d)},m(d,u){_(d,p,u),e(p,v),_(d,f,u),b(h,d,u),T=!0},p:hs,i(d){T||(w(h.$$.fragment,d),T=!0)},o(d){x(h.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(f),j(h,d)}}}function Al(Z){let p,v,f,h,T;return{c(){p=a("p"),v=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=s("Module"),T=s(`
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=r(d,"P",{});var u=l(p);v=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(u,"CODE",{});var B=l(f);h=n(B,"Module"),B.forEach(t),T=n(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m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HklMjBzY29yZSUwQSUwQSUyMyUyMHNhdmUlMjBhbmQlMjBsb2FkJTIwZnJvbSUyMHByZXRyYWluZWQlMEFtb2RlbC5zYXZlX3ByZXRyYWluZWQoJTIydml0LWJlcnQlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4VmlzaW9uVGV4dER1YWxFbmNvZGVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnZpdC1iZXJ0JTIyKSUwQSUwQSUyMyUyMGluZmVyZW5jZSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwamF4Lm5uLnNvZnRtYXgobG9naXRzX3Blcl9pbWFnZSUyQyUyMGF4aXMlM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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=a("p"),v=s("Examples:"),f=c(),M(h.$$.fragment)},l(d){p=r(d,"P",{});var u=l(p);v=n(u,"Examples:"),u.forEach(t),f=m(d),y(h.$$.fragment,d)},m(d,u){_(d,p,u),e(p,v),_(d,f,u),b(h,d,u),T=!0},p:hs,i(d){T||(w(h.$$.fragment,d),T=!0)},o(d){x(h.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(f),j(h,d)}}}function Yl(Z){let p,v,f,h,T;return{c(){p=a("p"),v=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),h=s("Module"),T=s(`
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=r(d,"P",{});var u=l(p);v=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(u,"CODE",{});var B=l(f);h=n(B,"Module"),B.forEach(t),T=n(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){_(d,p,u),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cyUyMHRoZSUyMGltYWdlLXRleHQlMjBzaW1pbGFyaXR5JTIwc2NvcmUlMEElMEElMjMlMjBzYXZlJTIwYW5kJTIwbG9hZCUyMGZyb20lMjBwcmV0cmFpbmVkJTBBbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMnZpdC1iZXJ0JTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZWaXNpb25UZXh0RHVhbEVuY29kZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydml0LWJlcnQlMjIpJTBBJTBBJTIzJTIwaW5mZXJlbmNlJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjB0Zi5ubi5zb2Z0bWF4KGxvZ2l0c19wZXJfaW1hZ2UlMkMlMjBheGlzJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",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>    TFVisionTextDualEncoderModel,
<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 = 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 = TFVisionTextDualEncoderModel.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>    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 = TFVisionTextDualEncoderModel.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 = tf.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=a("p"),v=s("Examples:"),f=c(),M(h.$$.fragment)},l(d){p=r(d,"P",{});var u=l(p);v=n(u,"Examples:"),u.forEach(t),f=m(d),y(h.$$.fragment,d)},m(d,u){_(d,p,u),e(p,v),_(d,f,u),b(h,d,u),T=!0},p:hs,i(d){T||(w(h.$$.fragment,d),T=!0)},o(d){x(h.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(f),j(h,d)}}}function Sl(Z){let p,v,f,h,T,d,u,B,fs,Vo,S,ne,Ht,je,gs,Lt,_s,Uo,E,Ts,Tt,vs,Ms,qt,ys,bs,vt,ws,xs,Mt,js,Js,yt,Es,Vs,Ot,Us,ks,bt,Is,Zs,wt,Ws,$s,ko,ae,Bs,Je,Cs,zs,Io,H,re,Kt,Ee,Ds,eo,Fs,Zo,W,Ve,Ns,G,xt,Xs,Ps,jt,Rs,As,Jt,Gs,Ys,Qs,L,Ss,Et,Hs,Ls,Vt,qs,Os,Ks,le,en,ie,Ue,tn,ke,on,Ut,sn,nn,Wo,q,de,to,Ie,an,oo,rn,$o,$,Ze,ln,so,dn,cn,C,kt,mn,pn,It,hn,un,Zt,fn,gn,no,_n,Tn,Wt,vn,Mn,yn,ce,We,bn,$e,wn,$t,xn,jn,Jn,me,Be,En,Ce,Vn,Bt,Un,kn,Bo,O,pe,ao,ze,In,ro,Zn,Co,V,De,Wn,Fe,$n,Ct,Bn,Cn,zn,Ne,Dn,Xe,Fn,Nn,Xn,lo,Pn,Rn,Pe,An,zt,Gn,Yn,Qn,Re,Sn,Ae,Hn,Ln,qn,F,Ge,On,K,Kn,Dt,ea,ta,io,oa,sa,na,he,aa,ue,zo,ee,fe,co,Ye,ra,mo,la,Do,J,Qe,ia,Se,da,Ft,ca,ma,pa,He,ha,Le,ua,fa,ga,po,_a,Ta,qe,va,Nt,Ma,ya,ba,Oe,wa,Ke,xa,ja,Ja,ho,Ea,Va,P,uo,et,Ua,ka,fo,tt,Ia,Za,go,ot,Wa,$a,_o,st,Ba,Ca,N,nt,za,te,Da,Xt,Fa,Na,To,Xa,Pa,Ra,ge,Aa,_e,Fo,oe,Te,vo,at,Ga,Mo,Ya,No,U,rt,Qa,lt,Sa,Pt,Ha,La,qa,it,Oa,dt,Ka,er,tr,yo,or,sr,ct,nr,Rt,ar,rr,lr,mt,ir,pt,dr,cr,mr,X,ht,pr,se,hr,At,ur,fr,bo,gr,_r,Tr,ve,vr,Me,Xo;return d=new _t({}),je=new _t({}),Ee=new _t({}),Ve=new A({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/v4.33.0/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L27"}}),le=new ps({props:{anchor:"transformers.VisionTextDualEncoderConfig.example",$$slots:{default:[Xl]},$$scope:{ctx:Z}}}),Ue=new A({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/v4.33.0/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L104",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a></p>
`}}),Ie=new _t({}),Ze=new A({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/v4.33.0/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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L25"}}),We=new A({props:{name:"batch_decode",anchor:"transformers.VisionTextDualEncoderProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L116"}}),Be=new A({props:{name:"decode",anchor:"transformers.VisionTextDualEncoderProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L123"}}),ze=new _t({}),De=new A({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/v4.33.0/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/v4.33.0/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/v4.33.0/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L162"}}),Ge=new A({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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/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/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L293",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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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>
`}}),he=new Mr({props:{$$slots:{default:[Pl]},$$scope:{ctx:Z}}}),ue=new ps({props:{anchor:"transformers.VisionTextDualEncoderModel.forward.example",$$slots:{default:[Rl]},$$scope:{ctx:Z}}}),Ye=new _t({}),Qe=new A({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/v4.33.0/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/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/modeling_flax_vision_text_dual_encoder.py#L219"}}),nt=new A({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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/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/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__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/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/modeling_flax_vision_text_dual_encoder.py#L269",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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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>
`}}),ge=new Mr({props:{$$slots:{default:[Al]},$$scope:{ctx:Z}}}),_e=new ps({props:{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.example",$$slots:{default:[Gl]},$$scope:{ctx:Z}}}),at=new _t({}),rt=new A({props:{name:"class transformers.TFVisionTextDualEncoderModel",anchor:"transformers.TFVisionTextDualEncoderModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFVisionTextDualEncoderModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/modeling_tf_vision_text_dual_encoder.py#L176"}}),ht=new A({props:{name:"call",anchor:"transformers.TFVisionTextDualEncoderModel.call",parameters:[{name:"input_ids",val:": tf.Tensor | None = None"},{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"return_loss",val:": Optional[bool] = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFVisionTextDualEncoderModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/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.TFVisionTextDualEncoderModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.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.TFVisionTextDualEncoderModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</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.TFVisionTextDualEncoderModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</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/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.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.TFVisionTextDualEncoderModel.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.TFVisionTextDualEncoderModel.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.TFVisionTextDualEncoderModel.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/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/vision_text_dual_encoder/modeling_tf_vision_text_dual_encoder.py#L341",returnDescription:`
<p>A <code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or a tuple of <code>tf.Tensor</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/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</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>tf.Tensor</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>tf.Tensor</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/v4.33.0/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>tf.Tensor</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/v4.33.0/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.0/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.0/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),ve=new Mr({props:{$$slots:{default:[Yl]},$$scope:{ctx:Z}}}),Me=new ps({props:{anchor:"transformers.TFVisionTextDualEncoderModel.call.example",$$slots:{default:[Ql]},$$scope:{ctx:Z}}}),{c(){p=a("meta"),v=c(),f=a("h1"),h=a("a"),T=a("span"),M(d.$$.fragment),u=c(),B=a("span"),fs=s("VisionTextDualEncoder"),Vo=c(),S=a("h2"),ne=a("a"),Ht=a("span"),M(je.$$.fragment),gs=c(),Lt=a("span"),_s=s("Overview"),Uo=c(),E=a("p"),Ts=s("The "),Tt=a("a"),vs=s("VisionTextDualEncoderModel"),Ms=s(` can be used to initialize a vision-text dual encoder model with
any pretrained vision autoencoding model as the vision encoder (`),qt=a("em"),ys=s("e.g."),bs=c(),vt=a("a"),ws=s("ViT"),xs=s(", "),Mt=a("a"),js=s("BEiT"),Js=s(", "),yt=a("a"),Es=s("DeiT"),Vs=s(") and any pretrained text autoencoding model as the text encoder ("),Ot=a("em"),Us=s("e.g."),ks=c(),bt=a("a"),Is=s("RoBERTa"),Zs=s(", "),wt=a("a"),Ws=s("BERT"),$s=s(`). 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.`),ko=c(),ae=a("p"),Bs=s("In "),Je=a("a"),Cs=s("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),zs=s(` 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.`),Io=c(),H=a("h2"),re=a("a"),Kt=a("span"),M(Ee.$$.fragment),Ds=c(),eo=a("span"),Fs=s("VisionTextDualEncoderConfig"),Zo=c(),W=a("div"),M(Ve.$$.fragment),Ns=c(),G=a("p"),xt=a("a"),Xs=s("VisionTextDualEncoderConfig"),Ps=s(` is the configuration class to store the configuration of a
`),jt=a("a"),Rs=s("VisionTextDualEncoderModel"),As=s(". It is used to instantiate "),Jt=a("a"),Gs=s("VisionTextDualEncoderModel"),Ys=s(` model according to the
specified arguments, defining the text model and vision model configs.`),Qs=c(),L=a("p"),Ss=s("Configuration objects inherit from "),Et=a("a"),Hs=s("PretrainedConfig"),Ls=s(` and can be used to control the model outputs. Read the
documentation from `),Vt=a("a"),qs=s("PretrainedConfig"),Os=s(" for more information."),Ks=c(),M(le.$$.fragment),en=c(),ie=a("div"),M(Ue.$$.fragment),tn=c(),ke=a("p"),on=s("Instantiate a "),Ut=a("a"),sn=s("VisionTextDualEncoderConfig"),nn=s(` (or a derived class) from text model configuration and vision
model configuration.`),Wo=c(),q=a("h2"),de=a("a"),to=a("span"),M(Ie.$$.fragment),an=c(),oo=a("span"),rn=s("VisionTextDualEncoderProcessor"),$o=c(),$=a("div"),M(Ze.$$.fragment),ln=c(),so=a("p"),dn=s(`Constructs a VisionTextDualEncoder processor which wraps an image processor and a tokenizer into a single
processor.`),cn=c(),C=a("p"),kt=a("a"),mn=s("VisionTextDualEncoderProcessor"),pn=s(" offers all the functionalities of "),It=a("a"),hn=s("AutoImageProcessor"),un=s(" and "),Zt=a("a"),fn=s("AutoTokenizer"),gn=s(`.
See the `),no=a("code"),_n=s("__call__()"),Tn=s(" and "),Wt=a("a"),vn=s("decode()"),Mn=s(` for more
information.`),yn=c(),ce=a("div"),M(We.$$.fragment),bn=c(),$e=a("p"),wn=s(`This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s
`),$t=a("a"),xn=s("batch_decode()"),jn=s(". Please refer to the docstring of this method for more information."),Jn=c(),me=a("div"),M(Be.$$.fragment),En=c(),Ce=a("p"),Vn=s("This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s "),Bt=a("a"),Un=s("decode()"),kn=s(`.
Please refer to the docstring of this method for more information.`),Bo=c(),O=a("h2"),pe=a("a"),ao=a("span"),M(ze.$$.fragment),In=c(),ro=a("span"),Zn=s("VisionTextDualEncoderModel"),Co=c(),V=a("div"),M(De.$$.fragment),Wn=c(),Fe=a("p"),$n=s(`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 `),Ct=a("a"),Bn=s("from_pretrained()"),Cn=s(` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),zn=c(),Ne=a("p"),Dn=s("In "),Xe=a("a"),Fn=s("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),Nn=s(` 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.`),Xn=c(),lo=a("p"),Pn=s(`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).`),Rn=c(),Pe=a("p"),An=s("This model inherits from "),zt=a("a"),Gn=s("PreTrainedModel"),Yn=s(`. 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.)`),Qn=c(),Re=a("p"),Sn=s("This model is also a PyTorch "),Ae=a("a"),Hn=s("torch.nn.Module"),Ln=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qn=c(),F=a("div"),M(Ge.$$.fragment),On=c(),K=a("p"),Kn=s("The "),Dt=a("a"),ea=s("VisionTextDualEncoderModel"),ta=s(" forward method, overrides the "),io=a("code"),oa=s("__call__"),sa=s(" special method."),na=c(),M(he.$$.fragment),aa=c(),M(ue.$$.fragment),zo=c(),ee=a("h2"),fe=a("a"),co=a("span"),M(Ye.$$.fragment),ra=c(),mo=a("span"),la=s("FlaxVisionTextDualEncoderModel"),Do=c(),J=a("div"),M(Qe.$$.fragment),ia=c(),Se=a("p"),da=s(`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 `),Ft=a("a"),ca=s("from_pretrained()"),ma=s(` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),pa=c(),He=a("p"),ha=s("In "),Le=a("a"),ua=s("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),fa=s(` 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.`),ga=c(),po=a("p"),_a=s(`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).`),Ta=c(),qe=a("p"),va=s("This model inherits from "),Nt=a("a"),Ma=s("PreTrainedModel"),ya=s(`. 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.)`),ba=c(),Oe=a("p"),wa=s("This model is also a Flax Linen "),Ke=a("a"),xa=s("flax.linen.Module"),ja=s(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Ja=c(),ho=a("p"),Ea=s("Finally, this model supports inherent JAX features such as:"),Va=c(),P=a("ul"),uo=a("li"),et=a("a"),Ua=s("Just-In-Time (JIT) compilation"),ka=c(),fo=a("li"),tt=a("a"),Ia=s("Automatic Differentiation"),Za=c(),go=a("li"),ot=a("a"),Wa=s("Vectorization"),$a=c(),_o=a("li"),st=a("a"),Ba=s("Parallelization"),Ca=c(),N=a("div"),M(nt.$$.fragment),za=c(),te=a("p"),Da=s("The "),Xt=a("a"),Fa=s("FlaxVisionTextDualEncoderModel"),Na=s(" forward method, overrides the "),To=a("code"),Xa=s("__call__"),Pa=s(" special method."),Ra=c(),M(ge.$$.fragment),Aa=c(),M(_e.$$.fragment),Fo=c(),oe=a("h2"),Te=a("a"),vo=a("span"),M(at.$$.fragment),Ga=c(),Mo=a("span"),Ya=s("TFVisionTextDualEncoderModel"),No=c(),U=a("div"),M(rt.$$.fragment),Qa=c(),lt=a("p"),Sa=s(`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 `),Pt=a("a"),Ha=s("from_pretrained()"),La=s(` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),qa=c(),it=a("p"),Oa=s("In "),dt=a("a"),Ka=s("LiT: Zero-Shot Transfer with Locked-image Text Tuning"),er=s(` 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.`),tr=c(),yo=a("p"),or=s(`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).`),sr=c(),ct=a("p"),nr=s("This model inherits from "),Rt=a("a"),ar=s("TFPreTrainedModel"),rr=s(`. 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.)`),lr=c(),mt=a("p"),ir=s("This model is also a Keras "),pt=a("a"),dr=s("Model"),cr=s(` subclass. Use it as a
regular Keras Model and refer to the TF documentation for all matter related to general usage and behavior.`),mr=c(),X=a("div"),M(ht.$$.fragment),pr=c(),se=a("p"),hr=s("The "),At=a("a"),ur=s("TFVisionTextDualEncoderModel"),fr=s(" forward method, overrides the "),bo=a("code"),gr=s("__call__"),_r=s(" special method."),Tr=c(),M(ve.$$.fragment),vr=c(),M(Me.$$.fragment),this.h()},l(o){const g=Fl('[data-svelte="svelte-1phssyn"]',document.head);p=r(g,"META",{name:!0,content:!0}),g.forEach(t),v=m(o),f=r(o,"H1",{class:!0});var ut=l(f);h=r(ut,"A",{id:!0,class:!0,href:!0});var wo=l(h);T=r(wo,"SPAN",{});var xo=l(T);y(d.$$.fragment,xo),xo.forEach(t),wo.forEach(t),u=m(ut),B=r(ut,"SPAN",{});var jo=l(B);fs=n(jo,"VisionTextDualEncoder"),jo.forEach(t),ut.forEach(t),Vo=m(o),S=r(o,"H2",{class:!0});var ft=l(S);ne=r(ft,"A",{id:!0,class:!0,href:!0});var Jo=l(ne);Ht=r(Jo,"SPAN",{});var Eo=l(Ht);y(je.$$.fragment,Eo),Eo.forEach(t),Jo.forEach(t),gs=m(ft),Lt=r(ft,"SPAN",{});var yr=l(Lt);_s=n(yr,"Overview"),yr.forEach(t),ft.forEach(t),Uo=m(o),E=r(o,"P",{});var k=l(E);Ts=n(k,"The "),Tt=r(k,"A",{href:!0});var br=l(Tt);vs=n(br,"VisionTextDualEncoderModel"),br.forEach(t),Ms=n(k,` can be used to initialize a vision-text dual encoder model with
any pretrained vision autoencoding model as the vision encoder (`),qt=r(k,"EM",{});var wr=l(qt);ys=n(wr,"e.g."),wr.forEach(t),bs=m(k),vt=r(k,"A",{href:!0});var xr=l(vt);ws=n(xr,"ViT"),xr.forEach(t),xs=n(k,", "),Mt=r(k,"A",{href:!0});var jr=l(Mt);js=n(jr,"BEiT"),jr.forEach(t),Js=n(k,", "),yt=r(k,"A",{href:!0});var Jr=l(yt);Es=n(Jr,"DeiT"),Jr.forEach(t),Vs=n(k,") and any pretrained text autoencoding model as the text encoder ("),Ot=r(k,"EM",{});var Er=l(Ot);Us=n(Er,"e.g."),Er.forEach(t),ks=m(k),bt=r(k,"A",{href:!0});var Vr=l(bt);Is=n(Vr,"RoBERTa"),Vr.forEach(t),Zs=n(k,", "),wt=r(k,"A",{href:!0});var Ur=l(wt);Ws=n(Ur,"BERT"),Ur.forEach(t),$s=n(k,`). 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.`),k.forEach(t),ko=m(o),ae=r(o,"P",{});var Po=l(ae);Bs=n(Po,"In "),Je=r(Po,"A",{href:!0,rel:!0});var kr=l(Je);Cs=n(kr,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),kr.forEach(t),zs=n(Po,` 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.`),Po.forEach(t),Io=m(o),H=r(o,"H2",{class:!0});var Ro=l(H);re=r(Ro,"A",{id:!0,class:!0,href:!0});var Ir=l(re);Kt=r(Ir,"SPAN",{});var Zr=l(Kt);y(Ee.$$.fragment,Zr),Zr.forEach(t),Ir.forEach(t),Ds=m(Ro),eo=r(Ro,"SPAN",{});var Wr=l(eo);Fs=n(Wr,"VisionTextDualEncoderConfig"),Wr.forEach(t),Ro.forEach(t),Zo=m(o),W=r(o,"DIV",{class:!0});var Y=l(W);y(Ve.$$.fragment,Y),Ns=m(Y),G=r(Y,"P",{});var gt=l(G);xt=r(gt,"A",{href:!0});var $r=l(xt);Xs=n($r,"VisionTextDualEncoderConfig"),$r.forEach(t),Ps=n(gt,` is the configuration class to store the configuration of a
`),jt=r(gt,"A",{href:!0});var Br=l(jt);Rs=n(Br,"VisionTextDualEncoderModel"),Br.forEach(t),As=n(gt,". It is used to instantiate "),Jt=r(gt,"A",{href:!0});var Cr=l(Jt);Gs=n(Cr,"VisionTextDualEncoderModel"),Cr.forEach(t),Ys=n(gt,` model according to the
specified arguments, defining the text model and vision model configs.`),gt.forEach(t),Qs=m(Y),L=r(Y,"P",{});var Gt=l(L);Ss=n(Gt,"Configuration objects inherit from "),Et=r(Gt,"A",{href:!0});var zr=l(Et);Hs=n(zr,"PretrainedConfig"),zr.forEach(t),Ls=n(Gt,` and can be used to control the model outputs. Read the
documentation from `),Vt=r(Gt,"A",{href:!0});var Dr=l(Vt);qs=n(Dr,"PretrainedConfig"),Dr.forEach(t),Os=n(Gt," for more information."),Gt.forEach(t),Ks=m(Y),y(le.$$.fragment,Y),en=m(Y),ie=r(Y,"DIV",{class:!0});var Ao=l(ie);y(Ue.$$.fragment,Ao),tn=m(Ao),ke=r(Ao,"P",{});var Go=l(ke);on=n(Go,"Instantiate a "),Ut=r(Go,"A",{href:!0});var Fr=l(Ut);sn=n(Fr,"VisionTextDualEncoderConfig"),Fr.forEach(t),nn=n(Go,` (or a derived class) from text model configuration and vision
model configuration.`),Go.forEach(t),Ao.forEach(t),Y.forEach(t),Wo=m(o),q=r(o,"H2",{class:!0});var Yo=l(q);de=r(Yo,"A",{id:!0,class:!0,href:!0});var Nr=l(de);to=r(Nr,"SPAN",{});var Xr=l(to);y(Ie.$$.fragment,Xr),Xr.forEach(t),Nr.forEach(t),an=m(Yo),oo=r(Yo,"SPAN",{});var Pr=l(oo);rn=n(Pr,"VisionTextDualEncoderProcessor"),Pr.forEach(t),Yo.forEach(t),$o=m(o),$=r(o,"DIV",{class:!0});var Q=l($);y(Ze.$$.fragment,Q),ln=m(Q),so=r(Q,"P",{});var Rr=l(so);dn=n(Rr,`Constructs a VisionTextDualEncoder processor which wraps an image processor and a tokenizer into a single
processor.`),Rr.forEach(t),cn=m(Q),C=r(Q,"P",{});var R=l(C);kt=r(R,"A",{href:!0});var Ar=l(kt);mn=n(Ar,"VisionTextDualEncoderProcessor"),Ar.forEach(t),pn=n(R," offers all the functionalities of "),It=r(R,"A",{href:!0});var Gr=l(It);hn=n(Gr,"AutoImageProcessor"),Gr.forEach(t),un=n(R," and "),Zt=r(R,"A",{href:!0});var Yr=l(Zt);fn=n(Yr,"AutoTokenizer"),Yr.forEach(t),gn=n(R,`.
See the `),no=r(R,"CODE",{});var Qr=l(no);_n=n(Qr,"__call__()"),Qr.forEach(t),Tn=n(R," and "),Wt=r(R,"A",{href:!0});var Sr=l(Wt);vn=n(Sr,"decode()"),Sr.forEach(t),Mn=n(R,` for more
information.`),R.forEach(t),yn=m(Q),ce=r(Q,"DIV",{class:!0});var Qo=l(ce);y(We.$$.fragment,Qo),bn=m(Qo),$e=r(Qo,"P",{});var So=l($e);wn=n(So,`This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s
`),$t=r(So,"A",{href:!0});var Hr=l($t);xn=n(Hr,"batch_decode()"),Hr.forEach(t),jn=n(So,". Please refer to the docstring of this method for more information."),So.forEach(t),Qo.forEach(t),Jn=m(Q),me=r(Q,"DIV",{class:!0});var Ho=l(me);y(Be.$$.fragment,Ho),En=m(Ho),Ce=r(Ho,"P",{});var Lo=l(Ce);Vn=n(Lo,"This method forwards all its arguments to VisionTextDualEncoderTokenizer\u2019s "),Bt=r(Lo,"A",{href:!0});var Lr=l(Bt);Un=n(Lr,"decode()"),Lr.forEach(t),kn=n(Lo,`.
Please refer to the docstring of this method for more information.`),Lo.forEach(t),Ho.forEach(t),Q.forEach(t),Bo=m(o),O=r(o,"H2",{class:!0});var qo=l(O);pe=r(qo,"A",{id:!0,class:!0,href:!0});var qr=l(pe);ao=r(qr,"SPAN",{});var Or=l(ao);y(ze.$$.fragment,Or),Or.forEach(t),qr.forEach(t),In=m(qo),ro=r(qo,"SPAN",{});var Kr=l(ro);Zn=n(Kr,"VisionTextDualEncoderModel"),Kr.forEach(t),qo.forEach(t),Co=m(o),V=r(o,"DIV",{class:!0});var z=l(V);y(De.$$.fragment,z),Wn=m(z),Fe=r(z,"P",{});var Oo=l(Fe);$n=n(Oo,`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 `),Ct=r(Oo,"A",{href:!0});var el=l(Ct);Bn=n(el,"from_pretrained()"),el.forEach(t),Cn=n(Oo,` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),Oo.forEach(t),zn=m(z),Ne=r(z,"P",{});var Ko=l(Ne);Dn=n(Ko,"In "),Xe=r(Ko,"A",{href:!0,rel:!0});var tl=l(Xe);Fn=n(tl,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),tl.forEach(t),Nn=n(Ko,` 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.`),Ko.forEach(t),Xn=m(z),lo=r(z,"P",{});var ol=l(lo);Pn=n(ol,`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).`),ol.forEach(t),Rn=m(z),Pe=r(z,"P",{});var es=l(Pe);An=n(es,"This model inherits from "),zt=r(es,"A",{href:!0});var sl=l(zt);Gn=n(sl,"PreTrainedModel"),sl.forEach(t),Yn=n(es,`. 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.)`),es.forEach(t),Qn=m(z),Re=r(z,"P",{});var ts=l(Re);Sn=n(ts,"This model is also a PyTorch "),Ae=r(ts,"A",{href:!0,rel:!0});var nl=l(Ae);Hn=n(nl,"torch.nn.Module"),nl.forEach(t),Ln=n(ts,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ts.forEach(t),qn=m(z),F=r(z,"DIV",{class:!0});var ye=l(F);y(Ge.$$.fragment,ye),On=m(ye),K=r(ye,"P",{});var Yt=l(K);Kn=n(Yt,"The "),Dt=r(Yt,"A",{href:!0});var al=l(Dt);ea=n(al,"VisionTextDualEncoderModel"),al.forEach(t),ta=n(Yt," forward method, overrides the "),io=r(Yt,"CODE",{});var rl=l(io);oa=n(rl,"__call__"),rl.forEach(t),sa=n(Yt," special method."),Yt.forEach(t),na=m(ye),y(he.$$.fragment,ye),aa=m(ye),y(ue.$$.fragment,ye),ye.forEach(t),z.forEach(t),zo=m(o),ee=r(o,"H2",{class:!0});var os=l(ee);fe=r(os,"A",{id:!0,class:!0,href:!0});var ll=l(fe);co=r(ll,"SPAN",{});var il=l(co);y(Ye.$$.fragment,il),il.forEach(t),ll.forEach(t),ra=m(os),mo=r(os,"SPAN",{});var dl=l(mo);la=n(dl,"FlaxVisionTextDualEncoderModel"),dl.forEach(t),os.forEach(t),Do=m(o),J=r(o,"DIV",{class:!0});var I=l(J);y(Qe.$$.fragment,I),ia=m(I),Se=r(I,"P",{});var ss=l(Se);da=n(ss,`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 `),Ft=r(ss,"A",{href:!0});var cl=l(Ft);ca=n(cl,"from_pretrained()"),cl.forEach(t),ma=n(ss,` 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.forEach(t),pa=m(I),He=r(I,"P",{});var ns=l(He);ha=n(ns,"In "),Le=r(ns,"A",{href:!0,rel:!0});var ml=l(Le);ua=n(ml,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),ml.forEach(t),fa=n(ns,` 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.`),ns.forEach(t),ga=m(I),po=r(I,"P",{});var pl=l(po);_a=n(pl,`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).`),pl.forEach(t),Ta=m(I),qe=r(I,"P",{});var as=l(qe);va=n(as,"This model inherits from "),Nt=r(as,"A",{href:!0});var hl=l(Nt);Ma=n(hl,"PreTrainedModel"),hl.forEach(t),ya=n(as,`. 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.)`),as.forEach(t),ba=m(I),Oe=r(I,"P",{});var rs=l(Oe);wa=n(rs,"This model is also a Flax Linen "),Ke=r(rs,"A",{href:!0,rel:!0});var ul=l(Ke);xa=n(ul,"flax.linen.Module"),ul.forEach(t),ja=n(rs,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),rs.forEach(t),Ja=m(I),ho=r(I,"P",{});var fl=l(ho);Ea=n(fl,"Finally, this model supports inherent JAX features such as:"),fl.forEach(t),Va=m(I),P=r(I,"UL",{});var be=l(P);uo=r(be,"LI",{});var gl=l(uo);et=r(gl,"A",{href:!0,rel:!0});var _l=l(et);Ua=n(_l,"Just-In-Time (JIT) compilation"),_l.forEach(t),gl.forEach(t),ka=m(be),fo=r(be,"LI",{});var Tl=l(fo);tt=r(Tl,"A",{href:!0,rel:!0});var vl=l(tt);Ia=n(vl,"Automatic Differentiation"),vl.forEach(t),Tl.forEach(t),Za=m(be),go=r(be,"LI",{});var Ml=l(go);ot=r(Ml,"A",{href:!0,rel:!0});var yl=l(ot);Wa=n(yl,"Vectorization"),yl.forEach(t),Ml.forEach(t),$a=m(be),_o=r(be,"LI",{});var bl=l(_o);st=r(bl,"A",{href:!0,rel:!0});var wl=l(st);Ba=n(wl,"Parallelization"),wl.forEach(t),bl.forEach(t),be.forEach(t),Ca=m(I),N=r(I,"DIV",{class:!0});var we=l(N);y(nt.$$.fragment,we),za=m(we),te=r(we,"P",{});var Qt=l(te);Da=n(Qt,"The "),Xt=r(Qt,"A",{href:!0});var xl=l(Xt);Fa=n(xl,"FlaxVisionTextDualEncoderModel"),xl.forEach(t),Na=n(Qt," forward method, overrides the "),To=r(Qt,"CODE",{});var jl=l(To);Xa=n(jl,"__call__"),jl.forEach(t),Pa=n(Qt," special method."),Qt.forEach(t),Ra=m(we),y(ge.$$.fragment,we),Aa=m(we),y(_e.$$.fragment,we),we.forEach(t),I.forEach(t),Fo=m(o),oe=r(o,"H2",{class:!0});var ls=l(oe);Te=r(ls,"A",{id:!0,class:!0,href:!0});var Jl=l(Te);vo=r(Jl,"SPAN",{});var El=l(vo);y(at.$$.fragment,El),El.forEach(t),Jl.forEach(t),Ga=m(ls),Mo=r(ls,"SPAN",{});var Vl=l(Mo);Ya=n(Vl,"TFVisionTextDualEncoderModel"),Vl.forEach(t),ls.forEach(t),No=m(o),U=r(o,"DIV",{class:!0});var D=l(U);y(rt.$$.fragment,D),Qa=m(D),lt=r(D,"P",{});var is=l(lt);Sa=n(is,`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 `),Pt=r(is,"A",{href:!0});var Ul=l(Pt);Ha=n(Ul,"from_pretrained()"),Ul.forEach(t),La=n(is,` method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`),is.forEach(t),qa=m(D),it=r(D,"P",{});var ds=l(it);Oa=n(ds,"In "),dt=r(ds,"A",{href:!0,rel:!0});var kl=l(dt);Ka=n(kl,"LiT: Zero-Shot Transfer with Locked-image Text Tuning"),kl.forEach(t),er=n(ds,` 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.`),ds.forEach(t),tr=m(D),yo=r(D,"P",{});var Il=l(yo);or=n(Il,`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).`),Il.forEach(t),sr=m(D),ct=r(D,"P",{});var cs=l(ct);nr=n(cs,"This model inherits from "),Rt=r(cs,"A",{href:!0});var Zl=l(Rt);ar=n(Zl,"TFPreTrainedModel"),Zl.forEach(t),rr=n(cs,`. 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.)`),cs.forEach(t),lr=m(D),mt=r(D,"P",{});var ms=l(mt);ir=n(ms,"This model is also a Keras "),pt=r(ms,"A",{href:!0,rel:!0});var Wl=l(pt);dr=n(Wl,"Model"),Wl.forEach(t),cr=n(ms,` subclass. Use it as a
regular Keras Model and refer to the TF documentation for all matter related to general usage and behavior.`),ms.forEach(t),mr=m(D),X=r(D,"DIV",{class:!0});var xe=l(X);y(ht.$$.fragment,xe),pr=m(xe),se=r(xe,"P",{});var St=l(se);hr=n(St,"The "),At=r(St,"A",{href:!0});var $l=l(At);ur=n($l,"TFVisionTextDualEncoderModel"),$l.forEach(t),fr=n(St," forward method, overrides the "),bo=r(St,"CODE",{});var Bl=l(bo);gr=n(Bl,"__call__"),Bl.forEach(t),_r=n(St," special method."),St.forEach(t),Tr=m(xe),y(ve.$$.fragment,xe),vr=m(xe),y(Me.$$.fragment,xe),xe.forEach(t),D.forEach(t),this.h()},h(){i(p,"name","hf:doc:metadata"),i(p,"content",JSON.stringify(Hl)),i(h,"id","visiontextdualencoder"),i(h,"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"),i(h,"href","#visiontextdualencoder"),i(f,"class","relative group"),i(ne,"id","overview"),i(ne,"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"),i(ne,"href","#overview"),i(S,"class","relative group"),i(Tt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),i(vt,"href","vit"),i(Mt,"href","beit"),i(yt,"href","deit"),i(bt,"href","roberta"),i(wt,"href","bert"),i(Je,"href","https://arxiv.org/abs/2111.07991"),i(Je,"rel","nofollow"),i(re,"id","transformers.VisionTextDualEncoderConfig"),i(re,"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"),i(re,"href","#transformers.VisionTextDualEncoderConfig"),i(H,"class","relative group"),i(xt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"),i(jt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),i(Jt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),i(Et,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),i(Vt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),i(Ut,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"),i(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(de,"id","transformers.VisionTextDualEncoderProcessor"),i(de,"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"),i(de,"href","#transformers.VisionTextDualEncoderProcessor"),i(q,"class","relative group"),i(kt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor"),i(It,"href","/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor"),i(Zt,"href","/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer"),i(Wt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor.decode"),i($t,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),i(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Bt,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),i(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(pe,"id","transformers.VisionTextDualEncoderModel"),i(pe,"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"),i(pe,"href","#transformers.VisionTextDualEncoderModel"),i(O,"class","relative group"),i(Ct,"href","/docs/transformers/v4.33.0/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained"),i(Xe,"href","https://arxiv.org/abs/2111.07991"),i(Xe,"rel","nofollow"),i(zt,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),i(Ae,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(Ae,"rel","nofollow"),i(Dt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel"),i(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(fe,"id","transformers.FlaxVisionTextDualEncoderModel"),i(fe,"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"),i(fe,"href","#transformers.FlaxVisionTextDualEncoderModel"),i(ee,"class","relative group"),i(Ft,"href","/docs/transformers/v4.33.0/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained"),i(Le,"href","https://arxiv.org/abs/2111.07991"),i(Le,"rel","nofollow"),i(Nt,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),i(Ke,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),i(Ke,"rel","nofollow"),i(et,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),i(et,"rel","nofollow"),i(tt,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),i(tt,"rel","nofollow"),i(ot,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),i(ot,"rel","nofollow"),i(st,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),i(st,"rel","nofollow"),i(Xt,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.FlaxVisionTextDualEncoderModel"),i(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Te,"id","transformers.TFVisionTextDualEncoderModel"),i(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"),i(Te,"href","#transformers.TFVisionTextDualEncoderModel"),i(oe,"class","relative group"),i(Pt,"href","/docs/transformers/v4.33.0/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained"),i(dt,"href","https://arxiv.org/abs/2111.07991"),i(dt,"rel","nofollow"),i(Rt,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),i(pt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),i(pt,"rel","nofollow"),i(At,"href","/docs/transformers/v4.33.0/en/model_doc/vision-text-dual-encoder#transformers.TFVisionTextDualEncoderModel"),i(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(U,"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,g){e(document.head,p),_(o,v,g),_(o,f,g),e(f,h),e(h,T),b(d,T,null),e(f,u),e(f,B),e(B,fs),_(o,Vo,g),_(o,S,g),e(S,ne),e(ne,Ht),b(je,Ht,null),e(S,gs),e(S,Lt),e(Lt,_s),_(o,Uo,g),_(o,E,g),e(E,Ts),e(E,Tt),e(Tt,vs),e(E,Ms),e(E,qt),e(qt,ys),e(E,bs),e(E,vt),e(vt,ws),e(E,xs),e(E,Mt),e(Mt,js),e(E,Js),e(E,yt),e(yt,Es),e(E,Vs),e(E,Ot),e(Ot,Us),e(E,ks),e(E,bt),e(bt,Is),e(E,Zs),e(E,wt),e(wt,Ws),e(E,$s),_(o,ko,g),_(o,ae,g),e(ae,Bs),e(ae,Je),e(Je,Cs),e(ae,zs),_(o,Io,g),_(o,H,g),e(H,re),e(re,Kt),b(Ee,Kt,null),e(H,Ds),e(H,eo),e(eo,Fs),_(o,Zo,g),_(o,W,g),b(Ve,W,null),e(W,Ns),e(W,G),e(G,xt),e(xt,Xs),e(G,Ps),e(G,jt),e(jt,Rs),e(G,As),e(G,Jt),e(Jt,Gs),e(G,Ys),e(W,Qs),e(W,L),e(L,Ss),e(L,Et),e(Et,Hs),e(L,Ls),e(L,Vt),e(Vt,qs),e(L,Os),e(W,Ks),b(le,W,null),e(W,en),e(W,ie),b(Ue,ie,null),e(ie,tn),e(ie,ke),e(ke,on),e(ke,Ut),e(Ut,sn),e(ke,nn),_(o,Wo,g),_(o,q,g),e(q,de),e(de,to),b(Ie,to,null),e(q,an),e(q,oo),e(oo,rn),_(o,$o,g),_(o,$,g),b(Ze,$,null),e($,ln),e($,so),e(so,dn),e($,cn),e($,C),e(C,kt),e(kt,mn),e(C,pn),e(C,It),e(It,hn),e(C,un),e(C,Zt),e(Zt,fn),e(C,gn),e(C,no),e(no,_n),e(C,Tn),e(C,Wt),e(Wt,vn),e(C,Mn),e($,yn),e($,ce),b(We,ce,null),e(ce,bn),e(ce,$e),e($e,wn),e($e,$t),e($t,xn),e($e,jn),e($,Jn),e($,me),b(Be,me,null),e(me,En),e(me,Ce),e(Ce,Vn),e(Ce,Bt),e(Bt,Un),e(Ce,kn),_(o,Bo,g),_(o,O,g),e(O,pe),e(pe,ao),b(ze,ao,null),e(O,In),e(O,ro),e(ro,Zn),_(o,Co,g),_(o,V,g),b(De,V,null),e(V,Wn),e(V,Fe),e(Fe,$n),e(Fe,Ct),e(Ct,Bn),e(Fe,Cn),e(V,zn),e(V,Ne),e(Ne,Dn),e(Ne,Xe),e(Xe,Fn),e(Ne,Nn),e(V,Xn),e(V,lo),e(lo,Pn),e(V,Rn),e(V,Pe),e(Pe,An),e(Pe,zt),e(zt,Gn),e(Pe,Yn),e(V,Qn),e(V,Re),e(Re,Sn),e(Re,Ae),e(Ae,Hn),e(Re,Ln),e(V,qn),e(V,F),b(Ge,F,null),e(F,On),e(F,K),e(K,Kn),e(K,Dt),e(Dt,ea),e(K,ta),e(K,io),e(io,oa),e(K,sa),e(F,na),b(he,F,null),e(F,aa),b(ue,F,null),_(o,zo,g),_(o,ee,g),e(ee,fe),e(fe,co),b(Ye,co,null),e(ee,ra),e(ee,mo),e(mo,la),_(o,Do,g),_(o,J,g),b(Qe,J,null),e(J,ia),e(J,Se),e(Se,da),e(Se,Ft),e(Ft,ca),e(Se,ma),e(J,pa),e(J,He),e(He,ha),e(He,Le),e(Le,ua),e(He,fa),e(J,ga),e(J,po),e(po,_a),e(J,Ta),e(J,qe),e(qe,va),e(qe,Nt),e(Nt,Ma),e(qe,ya),e(J,ba),e(J,Oe),e(Oe,wa),e(Oe,Ke),e(Ke,xa),e(Oe,ja),e(J,Ja),e(J,ho),e(ho,Ea),e(J,Va),e(J,P),e(P,uo),e(uo,et),e(et,Ua),e(P,ka),e(P,fo),e(fo,tt),e(tt,Ia),e(P,Za),e(P,go),e(go,ot),e(ot,Wa),e(P,$a),e(P,_o),e(_o,st),e(st,Ba),e(J,Ca),e(J,N),b(nt,N,null),e(N,za),e(N,te),e(te,Da),e(te,Xt),e(Xt,Fa),e(te,Na),e(te,To),e(To,Xa),e(te,Pa),e(N,Ra),b(ge,N,null),e(N,Aa),b(_e,N,null),_(o,Fo,g),_(o,oe,g),e(oe,Te),e(Te,vo),b(at,vo,null),e(oe,Ga),e(oe,Mo),e(Mo,Ya),_(o,No,g),_(o,U,g),b(rt,U,null),e(U,Qa),e(U,lt),e(lt,Sa),e(lt,Pt),e(Pt,Ha),e(lt,La),e(U,qa),e(U,it),e(it,Oa),e(it,dt),e(dt,Ka),e(it,er),e(U,tr),e(U,yo),e(yo,or),e(U,sr),e(U,ct),e(ct,nr),e(ct,Rt),e(Rt,ar),e(ct,rr),e(U,lr),e(U,mt),e(mt,ir),e(mt,pt),e(pt,dr),e(mt,cr),e(U,mr),e(U,X),b(ht,X,null),e(X,pr),e(X,se),e(se,hr),e(se,At),e(At,ur),e(se,fr),e(se,bo),e(bo,gr),e(se,_r),e(X,Tr),b(ve,X,null),e(X,vr),b(Me,X,null),Xo=!0},p(o,[g]){const ut={};g&2&&(ut.$$scope={dirty:g,ctx:o}),le.$set(ut);const wo={};g&2&&(wo.$$scope={dirty:g,ctx:o}),he.$set(wo);const xo={};g&2&&(xo.$$scope={dirty:g,ctx:o}),ue.$set(xo);const jo={};g&2&&(jo.$$scope={dirty:g,ctx:o}),ge.$set(jo);const ft={};g&2&&(ft.$$scope={dirty:g,ctx:o}),_e.$set(ft);const Jo={};g&2&&(Jo.$$scope={dirty:g,ctx:o}),ve.$set(Jo);const Eo={};g&2&&(Eo.$$scope={dirty:g,ctx:o}),Me.$set(Eo)},i(o){Xo||(w(d.$$.fragment,o),w(je.$$.fragment,o),w(Ee.$$.fragment,o),w(Ve.$$.fragment,o),w(le.$$.fragment,o),w(Ue.$$.fragment,o),w(Ie.$$.fragment,o),w(Ze.$$.fragment,o),w(We.$$.fragment,o),w(Be.$$.fragment,o),w(ze.$$.fragment,o),w(De.$$.fragment,o),w(Ge.$$.fragment,o),w(he.$$.fragment,o),w(ue.$$.fragment,o),w(Ye.$$.fragment,o),w(Qe.$$.fragment,o),w(nt.$$.fragment,o),w(ge.$$.fragment,o),w(_e.$$.fragment,o),w(at.$$.fragment,o),w(rt.$$.fragment,o),w(ht.$$.fragment,o),w(ve.$$.fragment,o),w(Me.$$.fragment,o),Xo=!0)},o(o){x(d.$$.fragment,o),x(je.$$.fragment,o),x(Ee.$$.fragment,o),x(Ve.$$.fragment,o),x(le.$$.fragment,o),x(Ue.$$.fragment,o),x(Ie.$$.fragment,o),x(Ze.$$.fragment,o),x(We.$$.fragment,o),x(Be.$$.fragment,o),x(ze.$$.fragment,o),x(De.$$.fragment,o),x(Ge.$$.fragment,o),x(he.$$.fragment,o),x(ue.$$.fragment,o),x(Ye.$$.fragment,o),x(Qe.$$.fragment,o),x(nt.$$.fragment,o),x(ge.$$.fragment,o),x(_e.$$.fragment,o),x(at.$$.fragment,o),x(rt.$$.fragment,o),x(ht.$$.fragment,o),x(ve.$$.fragment,o),x(Me.$$.fragment,o),Xo=!1},d(o){t(p),o&&t(v),o&&t(f),j(d),o&&t(Vo),o&&t(S),j(je),o&&t(Uo),o&&t(E),o&&t(ko),o&&t(ae),o&&t(Io),o&&t(H),j(Ee),o&&t(Zo),o&&t(W),j(Ve),j(le),j(Ue),o&&t(Wo),o&&t(q),j(Ie),o&&t($o),o&&t($),j(Ze),j(We),j(Be),o&&t(Bo),o&&t(O),j(ze),o&&t(Co),o&&t(V),j(De),j(Ge),j(he),j(ue),o&&t(zo),o&&t(ee),j(Ye),o&&t(Do),o&&t(J),j(Qe),j(nt),j(ge),j(_e),o&&t(Fo),o&&t(oe),j(at),o&&t(No),o&&t(U),j(rt),j(ht),j(ve),j(Me)}}}const Hl={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"},{local:"transformers.TFVisionTextDualEncoderModel",title:"TFVisionTextDualEncoderModel"}],title:"VisionTextDualEncoder"};function Ll(Z){return Nl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class si extends Cl{constructor(p){super();zl(this,p,Ll,Sl,Dl,{})}}export{si as default,Hl as metadata};
