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