import{s as No,o as Fo,n as $e}from"../chunks/scheduler.9bc65507.js";import{S as Do,i as Xo,g as o,s as r,u as T,A as Ho,h as n,f as s,c as l,j as g,v as _,y as p,k as u,o as t,a as m,w as M,d as v,t as y,x as b}from"../chunks/index.78c82d43.js";import{T as Ps}from"../chunks/Tip.87d55b76.js";import{D as z}from"../chunks/Docstring.4e7352e2.js";import{C as At}from"../chunks/CodeBlock.73e038be.js";import{I as We}from"../chunks/IconCopyLink.bedaa44d.js";import{E as St}from"../chunks/ExampleCodeBlock.872b014d.js";function Ro(I){let i,x="Examples:",c,h,f;return h=new At({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)`,wrap:!1}}),{c(){i=o("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=n(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),_(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),M(h,a,j),f=!0},p:$e,i(a){f||(v(h.$$.fragment,a),f=!0)},o(a){y(h.$$.fragment,a),f=!1},d(a){a&&(s(i),s(c)),b(h,a)}}}function Po(I){let i,x=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=o("p"),i.innerHTML=x},l(c){i=n(c,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=x)},m(c,h){m(c,i,h)},p:$e,d(c){c&&s(i)}}}function Go(I){let i,x="Examples:",c,h,f;return h=new At({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVx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b2RlbC5zYXZlX3ByZXRyYWluZWQoJTIydml0LWJlcnQlMjIpJTBBbW9kZWwlMjAlM0QlMjBWaXNpb25UZXh0RHVhbEVuY29kZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydml0LWJlcnQlMjIpJTBBJTBBJTIzJTIwaW5mZXJlbmNlJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",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>`,wrap:!1}}),{c(){i=o("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=n(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),_(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),M(h,a,j),f=!0},p:$e,i(a){f||(v(h.$$.fragment,a),f=!0)},o(a){y(h.$$.fragment,a),f=!1},d(a){a&&(s(i),s(c)),b(h,a)}}}function Lo(I){let i,x=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=o("p"),i.innerHTML=x},l(c){i=n(c,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=x)},m(c,h){m(c,i,h)},p:$e,d(c){c&&s(i)}}}function Yo(I){let i,x="Examples:",c,h,f;return h=new At({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjBqYXglMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMEZsYXhW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SUyMyUyMGluZmVyZW5jZSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwamF4Lm5uLnNvZnRtYXgobG9naXRzX3Blcl9pbWFnZSUyQyUyMGF4aXMlM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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>`,wrap:!1}}),{c(){i=o("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=n(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),_(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),M(h,a,j),f=!0},p:$e,i(a){f||(v(h.$$.fragment,a),f=!0)},o(a){y(h.$$.fragment,a),f=!1},d(a){a&&(s(i),s(c)),b(h,a)}}}function Qo(I){let i,x=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=o("p"),i.innerHTML=x},l(c){i=n(c,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=x)},m(c,h){m(c,i,h)},p:$e,d(c){c&&s(i)}}}function So(I){let i,x="Examples:",c,h,f;return h=new At({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMFRGVmlzaW9uVGV4dER1YWxFbmNvZGVyTW9kZWwlMkMlMEElMjAlMjAlMjAlMjBWaXNpb25UZXh0RHVhbEVuY29kZXJQcm9jZXNzb3IlMkMlMEElMjAlMjAlMjAlMjBBdXRvSW1hZ2VQcm9jZXNzb3IlMkMlMEElMj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19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjB0Zi5ubi5zb2Z0bWF4KGxvZ2l0c19wZXJfaW1hZ2UlMkMlMjBheGlzJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",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>`,wrap:!1}}),{c(){i=o("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=n(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),_(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),M(h,a,j),f=!0},p:$e,i(a){f||(v(h.$$.fragment,a),f=!0)},o(a){y(h.$$.fragment,a),f=!1},d(a){a&&(s(i),s(c)),b(h,a)}}}function Ao(I){let i,x,c,h,f,a,j,pe,qt,Be,Gs="VisionTextDualEncoder",Vt,D,L,ft,me,Ot,ze,Ls="Overview",Ut,he,Ys=`The <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel">VisionTextDualEncoderModel</a> can be used to initialize a vision-text dual encoder model with
any pretrained vision autoencoding model as the vision encoder (<em>e.g.</em> <a href="vit">ViT</a>, <a href="beit">BEiT</a>, <a href="deit">DeiT</a>) and any pretrained text autoencoding model as the text encoder (<em>e.g.</em> <a href="roberta">RoBERTa</a>, <a href="bert">BERT</a>). 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.`,It,ue,Qs=`In <a href="https://arxiv.org/abs/2111.07991" rel="nofollow">LiT: Zero-Shot Transfer with Locked-image Text Tuning</a> 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.`,kt,X,Y,Tt,ge,Kt,Ne,Ss="VisionTextDualEncoderConfig",Et,k,fe,es,Fe,As=`<a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig">VisionTextDualEncoderConfig</a> is the configuration class to store the configuration of a
<a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel">VisionTextDualEncoderModel</a>. It is used to instantiate <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel">VisionTextDualEncoderModel</a> model according to the
specified arguments, defining the text model and vision model configs.`,ts,De,qs=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ss,Q,os,S,Te,ns,Xe,Os=`Instantiate a <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig">VisionTextDualEncoderConfig</a> (or a derived class) from text model configuration and vision
model configuration.`,Ct,H,A,_t,_e,as,He,Ks="VisionTextDualEncoderProcessor",Zt,E,Me,rs,Re,eo=`Constructs a VisionTextDualEncoder processor which wraps an image processor and a tokenizer into a single
processor.`,ls,Pe,to=`<a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor">VisionTextDualEncoderProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>.
See the <code>__call__()</code> and <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor.decode">decode()</a> for more
information.`,is,q,ve,ds,Ge,so=`This method forwards all its arguments to VisionTextDualEncoderTokenizer’s
<a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode">batch_decode()</a>. Please refer to the docstring of this method for more information.`,cs,O,ye,ps,Le,oo=`This method forwards all its arguments to VisionTextDualEncoderTokenizer’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode">decode()</a>.
Please refer to the docstring of this method for more information.`,Wt,R,K,Mt,be,ms,Ye,no="VisionTextDualEncoderModel",$t,J,xe,hs,Qe,ao=`This class can be used to initialize a vision-text dual encoder model with any pretrained vision autoencoding model
as the vision encoder and any pretrained text model as the text encoder. The vision and text encoders are loaded
via the <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained">from_pretrained()</a> 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,Se,ro=`In <a href="https://arxiv.org/abs/2111.07991" rel="nofollow">LiT: Zero-Shot Transfer with Locked-image Text Tuning</a> 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.`,gs,Ae,lo=`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).`,fs,qe,io=`This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ts,Oe,co=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,_s,W,we,Ms,Ke,po='The <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel">VisionTextDualEncoderModel</a> forward method, overrides the <code>__call__</code> special method.',vs,ee,ys,te,Bt,P,se,vt,je,bs,et,mo="FlaxVisionTextDualEncoderModel",zt,w,Je,xs,tt,ho=`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 <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained">from_pretrained()</a> method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`,ws,st,uo=`In <a href="https://arxiv.org/abs/2111.07991" rel="nofollow">LiT: Zero-Shot Transfer with Locked-image Text Tuning</a> 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.`,js,ot,go=`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).`,Js,nt,fo=`This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Vs,at,To=`This model is also a Flax Linen <a href="https://flax.readthedocs.io/en/latest/flax.linen.html#module" rel="nofollow">flax.linen.Module</a>
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`,Us,rt,_o="Finally, this model supports inherent JAX features such as:",Is,lt,Mo='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',ks,$,Ve,Es,it,vo='The <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.FlaxVisionTextDualEncoderModel">FlaxVisionTextDualEncoderModel</a> forward method, overrides the <code>__call__</code> special method.',Cs,oe,Zs,ne,Nt,G,ae,yt,Ue,Ws,dt,yo="TFVisionTextDualEncoderModel",Ft,V,Ie,$s,ct,bo=`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 <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.FlaxAutoModelForVision2Seq.from_pretrained">from_pretrained()</a> method. The projection layers are automatically added to the model and
should be fine-tuned on a downstream task, like contrastive image-text modeling.`,Bs,pt,xo=`In <a href="https://arxiv.org/abs/2111.07991" rel="nofollow">LiT: Zero-Shot Transfer with Locked-image Text Tuning</a> 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.`,zs,mt,wo=`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).`,Ns,ht,jo=`This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. 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.)`,Fs,ut,Jo=`This model is also a Keras <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">Model</a> subclass. Use it as a
regular Keras Model and refer to the TF documentation for all matter related to general usage and behavior.`,Ds,B,ke,Xs,gt,Vo='The <a href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.TFVisionTextDualEncoderModel">TFVisionTextDualEncoderModel</a> forward method, overrides the <code>__call__</code> special method.',Hs,re,Rs,le,Dt,bt,Xt;return pe=new We({}),me=new We({}),ge=new We({}),fe=new z({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.34.0/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L27"}}),Q=new St({props:{anchor:"transformers.VisionTextDualEncoderConfig.example",$$slots:{default:[Ro]},$$scope:{ctx:I}}}),Te=new z({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.34.0/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L104",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a></p>
`}}),_e=new We({}),Me=new z({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.34.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.34.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.34.0/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L25"}}),ve=new z({props:{name:"batch_decode",anchor:"transformers.VisionTextDualEncoderProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L116"}}),ye=new z({props:{name:"decode",anchor:"transformers.VisionTextDualEncoderProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/vision_text_dual_encoder/processing_vision_text_dual_encoder.py#L123"}}),be=new We({}),xe=new z({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.34.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.34.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.34.0/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L162"}}),we=new z({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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__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.34.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.34.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.34.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>) — 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>) — 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>) — 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>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.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>) — The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.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.34.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.34.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>
`}}),ee=new Ps({props:{$$slots:{default:[Po]},$$scope:{ctx:I}}}),te=new St({props:{anchor:"transformers.VisionTextDualEncoderModel.forward.example",$$slots:{default:[Go]},$$scope:{ctx:I}}}),je=new We({}),Je=new z({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.34.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.34.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.34.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/vision_text_dual_encoder/modeling_flax_vision_text_dual_encoder.py#L219"}}),Ve=new z({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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__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.34.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.34.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.34.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>) — 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>) — 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>) — The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.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>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.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.34.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.34.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>
`}}),oe=new Ps({props:{$$slots:{default:[Lo]},$$scope:{ctx:I}}}),ne=new St({props:{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.example",$$slots:{default:[Yo]},$$scope:{ctx:I}}}),Ue=new We({}),Ie=new z({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.34.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.34.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.34.0/src/transformers/models/vision_text_dual_encoder/modeling_tf_vision_text_dual_encoder.py#L176"}}),ke=new z({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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__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.34.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.34.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.34.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>) — 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>) — 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>) — 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>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.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>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.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.34.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.34.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>
`}}),re=new Ps({props:{$$slots:{default:[Qo]},$$scope:{ctx:I}}}),le=new St({props:{anchor:"transformers.TFVisionTextDualEncoderModel.call.example",$$slots:{default:[So]},$$scope:{ctx:I}}}),{c(){i=o("meta"),x=r(),c=o("p"),h=r(),f=o("h1"),a=o("a"),j=o("span"),T(pe.$$.fragment),qt=r(),Be=o("span"),Be.textContent=Gs,Vt=r(),D=o("h2"),L=o("a"),ft=o("span"),T(me.$$.fragment),Ot=r(),ze=o("span"),ze.textContent=Ls,Ut=r(),he=o("p"),he.innerHTML=Ys,It=r(),ue=o("p"),ue.innerHTML=Qs,kt=r(),X=o("h2"),Y=o("a"),Tt=o("span"),T(ge.$$.fragment),Kt=r(),Ne=o("span"),Ne.textContent=Ss,Et=r(),k=o("div"),T(fe.$$.fragment),es=r(),Fe=o("p"),Fe.innerHTML=As,ts=r(),De=o("p"),De.innerHTML=qs,ss=r(),T(Q.$$.fragment),os=r(),S=o("div"),T(Te.$$.fragment),ns=r(),Xe=o("p"),Xe.innerHTML=Os,Ct=r(),H=o("h2"),A=o("a"),_t=o("span"),T(_e.$$.fragment),as=r(),He=o("span"),He.textContent=Ks,Zt=r(),E=o("div"),T(Me.$$.fragment),rs=r(),Re=o("p"),Re.textContent=eo,ls=r(),Pe=o("p"),Pe.innerHTML=to,is=r(),q=o("div"),T(ve.$$.fragment),ds=r(),Ge=o("p"),Ge.innerHTML=so,cs=r(),O=o("div"),T(ye.$$.fragment),ps=r(),Le=o("p"),Le.innerHTML=oo,Wt=r(),R=o("h2"),K=o("a"),Mt=o("span"),T(be.$$.fragment),ms=r(),Ye=o("span"),Ye.textContent=no,$t=r(),J=o("div"),T(xe.$$.fragment),hs=r(),Qe=o("p"),Qe.innerHTML=ao,us=r(),Se=o("p"),Se.innerHTML=ro,gs=r(),Ae=o("p"),Ae.textContent=lo,fs=r(),qe=o("p"),qe.innerHTML=io,Ts=r(),Oe=o("p"),Oe.innerHTML=co,_s=r(),W=o("div"),T(we.$$.fragment),Ms=r(),Ke=o("p"),Ke.innerHTML=po,vs=r(),T(ee.$$.fragment),ys=r(),T(te.$$.fragment),Bt=r(),P=o("h2"),se=o("a"),vt=o("span"),T(je.$$.fragment),bs=r(),et=o("span"),et.textContent=mo,zt=r(),w=o("div"),T(Je.$$.fragment),xs=r(),tt=o("p"),tt.innerHTML=ho,ws=r(),st=o("p"),st.innerHTML=uo,js=r(),ot=o("p"),ot.textContent=go,Js=r(),nt=o("p"),nt.innerHTML=fo,Vs=r(),at=o("p"),at.innerHTML=To,Us=r(),rt=o("p"),rt.textContent=_o,Is=r(),lt=o("ul"),lt.innerHTML=Mo,ks=r(),$=o("div"),T(Ve.$$.fragment),Es=r(),it=o("p"),it.innerHTML=vo,Cs=r(),T(oe.$$.fragment),Zs=r(),T(ne.$$.fragment),Nt=r(),G=o("h2"),ae=o("a"),yt=o("span"),T(Ue.$$.fragment),Ws=r(),dt=o("span"),dt.textContent=yo,Ft=r(),V=o("div"),T(Ie.$$.fragment),$s=r(),ct=o("p"),ct.innerHTML=bo,Bs=r(),pt=o("p"),pt.innerHTML=xo,zs=r(),mt=o("p"),mt.textContent=wo,Ns=r(),ht=o("p"),ht.innerHTML=jo,Fs=r(),ut=o("p"),ut.innerHTML=Jo,Ds=r(),B=o("div"),T(ke.$$.fragment),Xs=r(),gt=o("p"),gt.innerHTML=Vo,Hs=r(),T(re.$$.fragment),Rs=r(),T(le.$$.fragment),Dt=r(),bt=o("p"),this.h()},l(e){const d=Ho("svelte-1phssyn",document.head);i=n(d,"META",{name:!0,content:!0}),d.forEach(s),x=l(e),c=n(e,"P",{}),g(c).forEach(s),h=l(e),f=n(e,"H1",{class:!0});var Ee=g(f);a=n(Ee,"A",{id:!0,class:!0,href:!0});var xt=g(a);j=n(xt,"SPAN",{});var wt=g(j);_(pe.$$.fragment,wt),wt.forEach(s),xt.forEach(s),qt=l(Ee),Be=n(Ee,"SPAN",{"data-svelte-h":!0}),p(Be)!=="svelte-z5ztu8"&&(Be.textContent=Gs),Ee.forEach(s),Vt=l(e),D=n(e,"H2",{class:!0});var Ce=g(D);L=n(Ce,"A",{id:!0,class:!0,href:!0});var jt=g(L);ft=n(jt,"SPAN",{});var Jt=g(ft);_(me.$$.fragment,Jt),Jt.forEach(s),jt.forEach(s),Ot=l(Ce),ze=n(Ce,"SPAN",{"data-svelte-h":!0}),p(ze)!=="svelte-1jsw1pg"&&(ze.textContent=Ls),Ce.forEach(s),Ut=l(e),he=n(e,"P",{"data-svelte-h":!0}),p(he)!=="svelte-11uh536"&&(he.innerHTML=Ys),It=l(e),ue=n(e,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-8axln3"&&(ue.innerHTML=Qs),kt=l(e),X=n(e,"H2",{class:!0});var Ze=g(X);Y=n(Ze,"A",{id:!0,class:!0,href:!0});var Uo=g(Y);Tt=n(Uo,"SPAN",{});var Io=g(Tt);_(ge.$$.fragment,Io),Io.forEach(s),Uo.forEach(s),Kt=l(Ze),Ne=n(Ze,"SPAN",{"data-svelte-h":!0}),p(Ne)!=="svelte-mk6ipu"&&(Ne.textContent=Ss),Ze.forEach(s),Et=l(e),k=n(e,"DIV",{class:!0});var N=g(k);_(fe.$$.fragment,N),es=l(N),Fe=n(N,"P",{"data-svelte-h":!0}),p(Fe)!=="svelte-1s73j4t"&&(Fe.innerHTML=As),ts=l(N),De=n(N,"P",{"data-svelte-h":!0}),p(De)!=="svelte-10kqkkl"&&(De.innerHTML=qs),ss=l(N),_(Q.$$.fragment,N),os=l(N),S=n(N,"DIV",{class:!0});var Ht=g(S);_(Te.$$.fragment,Ht),ns=l(Ht),Xe=n(Ht,"P",{"data-svelte-h":!0}),p(Xe)!=="svelte-o5h5nm"&&(Xe.innerHTML=Os),Ht.forEach(s),N.forEach(s),Ct=l(e),H=n(e,"H2",{class:!0});var Rt=g(H);A=n(Rt,"A",{id:!0,class:!0,href:!0});var ko=g(A);_t=n(ko,"SPAN",{});var Eo=g(_t);_(_e.$$.fragment,Eo),Eo.forEach(s),ko.forEach(s),as=l(Rt),He=n(Rt,"SPAN",{"data-svelte-h":!0}),p(He)!=="svelte-62ojb2"&&(He.textContent=Ks),Rt.forEach(s),Zt=l(e),E=n(e,"DIV",{class:!0});var F=g(E);_(Me.$$.fragment,F),rs=l(F),Re=n(F,"P",{"data-svelte-h":!0}),p(Re)!=="svelte-c5g5w0"&&(Re.textContent=eo),ls=l(F),Pe=n(F,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-1bmll1j"&&(Pe.innerHTML=to),is=l(F),q=n(F,"DIV",{class:!0});var Pt=g(q);_(ve.$$.fragment,Pt),ds=l(Pt),Ge=n(Pt,"P",{"data-svelte-h":!0}),p(Ge)!=="svelte-1gouhdd"&&(Ge.innerHTML=so),Pt.forEach(s),cs=l(F),O=n(F,"DIV",{class:!0});var Gt=g(O);_(ye.$$.fragment,Gt),ps=l(Gt),Le=n(Gt,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-1pzx093"&&(Le.innerHTML=oo),Gt.forEach(s),F.forEach(s),Wt=l(e),R=n(e,"H2",{class:!0});var Lt=g(R);K=n(Lt,"A",{id:!0,class:!0,href:!0});var Co=g(K);Mt=n(Co,"SPAN",{});var Zo=g(Mt);_(be.$$.fragment,Zo),Zo.forEach(s),Co.forEach(s),ms=l(Lt),Ye=n(Lt,"SPAN",{"data-svelte-h":!0}),p(Ye)!=="svelte-f0ye25"&&(Ye.textContent=no),Lt.forEach(s),$t=l(e),J=n(e,"DIV",{class:!0});var C=g(J);_(xe.$$.fragment,C),hs=l(C),Qe=n(C,"P",{"data-svelte-h":!0}),p(Qe)!=="svelte-1anl5k7"&&(Qe.innerHTML=ao),us=l(C),Se=n(C,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-98iof6"&&(Se.innerHTML=ro),gs=l(C),Ae=n(C,"P",{"data-svelte-h":!0}),p(Ae)!=="svelte-c2j1l6"&&(Ae.textContent=lo),fs=l(C),qe=n(C,"P",{"data-svelte-h":!0}),p(qe)!=="svelte-hmtw9k"&&(qe.innerHTML=io),Ts=l(C),Oe=n(C,"P",{"data-svelte-h":!0}),p(Oe)!=="svelte-hswkmf"&&(Oe.innerHTML=co),_s=l(C),W=n(C,"DIV",{class:!0});var ie=g(W);_(we.$$.fragment,ie),Ms=l(ie),Ke=n(ie,"P",{"data-svelte-h":!0}),p(Ke)!=="svelte-qtld5d"&&(Ke.innerHTML=po),vs=l(ie),_(ee.$$.fragment,ie),ys=l(ie),_(te.$$.fragment,ie),ie.forEach(s),C.forEach(s),Bt=l(e),P=n(e,"H2",{class:!0});var Yt=g(P);se=n(Yt,"A",{id:!0,class:!0,href:!0});var Wo=g(se);vt=n(Wo,"SPAN",{});var $o=g(vt);_(je.$$.fragment,$o),$o.forEach(s),Wo.forEach(s),bs=l(Yt),et=n(Yt,"SPAN",{"data-svelte-h":!0}),p(et)!=="svelte-136kz3k"&&(et.textContent=mo),Yt.forEach(s),zt=l(e),w=n(e,"DIV",{class:!0});var U=g(w);_(Je.$$.fragment,U),xs=l(U),tt=n(U,"P",{"data-svelte-h":!0}),p(tt)!=="svelte-1anl5k7"&&(tt.innerHTML=ho),ws=l(U),st=n(U,"P",{"data-svelte-h":!0}),p(st)!=="svelte-98iof6"&&(st.innerHTML=uo),js=l(U),ot=n(U,"P",{"data-svelte-h":!0}),p(ot)!=="svelte-c2j1l6"&&(ot.textContent=go),Js=l(U),nt=n(U,"P",{"data-svelte-h":!0}),p(nt)!=="svelte-hmtw9k"&&(nt.innerHTML=fo),Vs=l(U),at=n(U,"P",{"data-svelte-h":!0}),p(at)!=="svelte-9ybkh"&&(at.innerHTML=To),Us=l(U),rt=n(U,"P",{"data-svelte-h":!0}),p(rt)!=="svelte-1pplc4a"&&(rt.textContent=_o),Is=l(U),lt=n(U,"UL",{"data-svelte-h":!0}),p(lt)!=="svelte-1w7z84m"&&(lt.innerHTML=Mo),ks=l(U),$=n(U,"DIV",{class:!0});var de=g($);_(Ve.$$.fragment,de),Es=l(de),it=n(de,"P",{"data-svelte-h":!0}),p(it)!=="svelte-gepymz"&&(it.innerHTML=vo),Cs=l(de),_(oe.$$.fragment,de),Zs=l(de),_(ne.$$.fragment,de),de.forEach(s),U.forEach(s),Nt=l(e),G=n(e,"H2",{class:!0});var Qt=g(G);ae=n(Qt,"A",{id:!0,class:!0,href:!0});var Bo=g(ae);yt=n(Bo,"SPAN",{});var zo=g(yt);_(Ue.$$.fragment,zo),zo.forEach(s),Bo.forEach(s),Ws=l(Qt),dt=n(Qt,"SPAN",{"data-svelte-h":!0}),p(dt)!=="svelte-cbazn"&&(dt.textContent=yo),Qt.forEach(s),Ft=l(e),V=n(e,"DIV",{class:!0});var Z=g(V);_(Ie.$$.fragment,Z),$s=l(Z),ct=n(Z,"P",{"data-svelte-h":!0}),p(ct)!=="svelte-1anl5k7"&&(ct.innerHTML=bo),Bs=l(Z),pt=n(Z,"P",{"data-svelte-h":!0}),p(pt)!=="svelte-98iof6"&&(pt.innerHTML=xo),zs=l(Z),mt=n(Z,"P",{"data-svelte-h":!0}),p(mt)!=="svelte-c2j1l6"&&(mt.textContent=wo),Ns=l(Z),ht=n(Z,"P",{"data-svelte-h":!0}),p(ht)!=="svelte-1i0vt4o"&&(ht.innerHTML=jo),Fs=l(Z),ut=n(Z,"P",{"data-svelte-h":!0}),p(ut)!=="svelte-y4ylu0"&&(ut.innerHTML=Jo),Ds=l(Z),B=n(Z,"DIV",{class:!0});var ce=g(B);_(ke.$$.fragment,ce),Xs=l(ce),gt=n(ce,"P",{"data-svelte-h":!0}),p(gt)!=="svelte-riqsfx"&&(gt.innerHTML=Vo),Hs=l(ce),_(re.$$.fragment,ce),Rs=l(ce),_(le.$$.fragment,ce),ce.forEach(s),Z.forEach(s),Dt=l(e),bt=n(e,"P",{}),g(bt).forEach(s),this.h()},h(){u(i,"name","hf:doc:metadata"),u(i,"content",JSON.stringify(qo)),u(a,"id","visiontextdualencoder"),u(a,"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"),u(a,"href","#visiontextdualencoder"),u(f,"class","relative group"),u(L,"id","overview"),u(L,"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"),u(L,"href","#overview"),u(D,"class","relative group"),u(Y,"id","transformers.VisionTextDualEncoderConfig"),u(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Y,"href","#transformers.VisionTextDualEncoderConfig"),u(X,"class","relative group"),u(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(A,"id","transformers.VisionTextDualEncoderProcessor"),u(A,"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"),u(A,"href","#transformers.VisionTextDualEncoderProcessor"),u(H,"class","relative group"),u(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(K,"id","transformers.VisionTextDualEncoderModel"),u(K,"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"),u(K,"href","#transformers.VisionTextDualEncoderModel"),u(R,"class","relative group"),u(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(se,"id","transformers.FlaxVisionTextDualEncoderModel"),u(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"),u(se,"href","#transformers.FlaxVisionTextDualEncoderModel"),u(P,"class","relative group"),u($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ae,"id","transformers.TFVisionTextDualEncoderModel"),u(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ae,"href","#transformers.TFVisionTextDualEncoderModel"),u(G,"class","relative group"),u(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,d){t(document.head,i),m(e,x,d),m(e,c,d),m(e,h,d),m(e,f,d),t(f,a),t(a,j),M(pe,j,null),t(f,qt),t(f,Be),m(e,Vt,d),m(e,D,d),t(D,L),t(L,ft),M(me,ft,null),t(D,Ot),t(D,ze),m(e,Ut,d),m(e,he,d),m(e,It,d),m(e,ue,d),m(e,kt,d),m(e,X,d),t(X,Y),t(Y,Tt),M(ge,Tt,null),t(X,Kt),t(X,Ne),m(e,Et,d),m(e,k,d),M(fe,k,null),t(k,es),t(k,Fe),t(k,ts),t(k,De),t(k,ss),M(Q,k,null),t(k,os),t(k,S),M(Te,S,null),t(S,ns),t(S,Xe),m(e,Ct,d),m(e,H,d),t(H,A),t(A,_t),M(_e,_t,null),t(H,as),t(H,He),m(e,Zt,d),m(e,E,d),M(Me,E,null),t(E,rs),t(E,Re),t(E,ls),t(E,Pe),t(E,is),t(E,q),M(ve,q,null),t(q,ds),t(q,Ge),t(E,cs),t(E,O),M(ye,O,null),t(O,ps),t(O,Le),m(e,Wt,d),m(e,R,d),t(R,K),t(K,Mt),M(be,Mt,null),t(R,ms),t(R,Ye),m(e,$t,d),m(e,J,d),M(xe,J,null),t(J,hs),t(J,Qe),t(J,us),t(J,Se),t(J,gs),t(J,Ae),t(J,fs),t(J,qe),t(J,Ts),t(J,Oe),t(J,_s),t(J,W),M(we,W,null),t(W,Ms),t(W,Ke),t(W,vs),M(ee,W,null),t(W,ys),M(te,W,null),m(e,Bt,d),m(e,P,d),t(P,se),t(se,vt),M(je,vt,null),t(P,bs),t(P,et),m(e,zt,d),m(e,w,d),M(Je,w,null),t(w,xs),t(w,tt),t(w,ws),t(w,st),t(w,js),t(w,ot),t(w,Js),t(w,nt),t(w,Vs),t(w,at),t(w,Us),t(w,rt),t(w,Is),t(w,lt),t(w,ks),t(w,$),M(Ve,$,null),t($,Es),t($,it),t($,Cs),M(oe,$,null),t($,Zs),M(ne,$,null),m(e,Nt,d),m(e,G,d),t(G,ae),t(ae,yt),M(Ue,yt,null),t(G,Ws),t(G,dt),m(e,Ft,d),m(e,V,d),M(Ie,V,null),t(V,$s),t(V,ct),t(V,Bs),t(V,pt),t(V,zs),t(V,mt),t(V,Ns),t(V,ht),t(V,Fs),t(V,ut),t(V,Ds),t(V,B),M(ke,B,null),t(B,Xs),t(B,gt),t(B,Hs),M(re,B,null),t(B,Rs),M(le,B,null),m(e,Dt,d),m(e,bt,d),Xt=!0},p(e,[d]){const Ee={};d&2&&(Ee.$$scope={dirty:d,ctx:e}),Q.$set(Ee);const xt={};d&2&&(xt.$$scope={dirty:d,ctx:e}),ee.$set(xt);const wt={};d&2&&(wt.$$scope={dirty:d,ctx:e}),te.$set(wt);const Ce={};d&2&&(Ce.$$scope={dirty:d,ctx:e}),oe.$set(Ce);const jt={};d&2&&(jt.$$scope={dirty:d,ctx:e}),ne.$set(jt);const Jt={};d&2&&(Jt.$$scope={dirty:d,ctx:e}),re.$set(Jt);const Ze={};d&2&&(Ze.$$scope={dirty:d,ctx:e}),le.$set(Ze)},i(e){Xt||(v(pe.$$.fragment,e),v(me.$$.fragment,e),v(ge.$$.fragment,e),v(fe.$$.fragment,e),v(Q.$$.fragment,e),v(Te.$$.fragment,e),v(_e.$$.fragment,e),v(Me.$$.fragment,e),v(ve.$$.fragment,e),v(ye.$$.fragment,e),v(be.$$.fragment,e),v(xe.$$.fragment,e),v(we.$$.fragment,e),v(ee.$$.fragment,e),v(te.$$.fragment,e),v(je.$$.fragment,e),v(Je.$$.fragment,e),v(Ve.$$.fragment,e),v(oe.$$.fragment,e),v(ne.$$.fragment,e),v(Ue.$$.fragment,e),v(Ie.$$.fragment,e),v(ke.$$.fragment,e),v(re.$$.fragment,e),v(le.$$.fragment,e),Xt=!0)},o(e){y(pe.$$.fragment,e),y(me.$$.fragment,e),y(ge.$$.fragment,e),y(fe.$$.fragment,e),y(Q.$$.fragment,e),y(Te.$$.fragment,e),y(_e.$$.fragment,e),y(Me.$$.fragment,e),y(ve.$$.fragment,e),y(ye.$$.fragment,e),y(be.$$.fragment,e),y(xe.$$.fragment,e),y(we.$$.fragment,e),y(ee.$$.fragment,e),y(te.$$.fragment,e),y(je.$$.fragment,e),y(Je.$$.fragment,e),y(Ve.$$.fragment,e),y(oe.$$.fragment,e),y(ne.$$.fragment,e),y(Ue.$$.fragment,e),y(Ie.$$.fragment,e),y(ke.$$.fragment,e),y(re.$$.fragment,e),y(le.$$.fragment,e),Xt=!1},d(e){e&&(s(x),s(c),s(h),s(f),s(Vt),s(D),s(Ut),s(he),s(It),s(ue),s(kt),s(X),s(Et),s(k),s(Ct),s(H),s(Zt),s(E),s(Wt),s(R),s($t),s(J),s(Bt),s(P),s(zt),s(w),s(Nt),s(G),s(Ft),s(V),s(Dt),s(bt)),s(i),b(pe),b(me),b(ge),b(fe),b(Q),b(Te),b(_e),b(Me),b(ve),b(ye),b(be),b(xe),b(we),b(ee),b(te),b(je),b(Je),b(Ve),b(oe),b(ne),b(Ue),b(Ie),b(ke),b(re),b(le)}}}const qo={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 Oo(I){return Fo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rn extends Do{constructor(i){super(),Xo(this,i,Oo,Ao,No,{})}}export{rn as component};
