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