import{s as Fn,o as Nn,n as $e}from"../chunks/scheduler.9bc65507.js";import{S as Dn,i as Xn,g as n,s as r,u as T,A as Hn,h as o,f as s,c as l,j as g,v as M,y as p,k as u,o as t,a as m,w as _,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.f3d04bd2.js";import{C as At}from"../chunks/CodeBlock.48618ec2.js";import{I as We}from"../chunks/IconCopyLink.bedaa44d.js";import{E as St}from"../chunks/ExampleCodeBlock.872b014d.js";function Rn(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)`}}),{c(){i=n("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=o(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),M(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),_(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 Pn(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=n("p"),i.innerHTML=x},l(c){i=o(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 Gn(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>`}}),{c(){i=n("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=o(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),M(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),_(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 Ln(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=n("p"),i.innerHTML=x},l(c){i=o(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 Yn(I){let i,x="Examples:",c,h,f;return h=new At({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjBqYXglMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMEZsYXhWaXNpb25U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MGluZmVyZW5jZSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwamF4Lm5uLnNvZnRtYXgobG9naXRzX3Blcl9pbWFnZSUyQyUyMGF4aXMlM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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(){i=n("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=o(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),M(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),_(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 Qn(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=n("p"),i.innerHTML=x},l(c){i=o(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 Sn(I){let i,x="Examples:",c,h,f;return h=new At({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMFRGVmlzaW9uVGV4dER1YWxFbmNvZGVyTW9kZWwlMkMlMEElMjAlMjAlMjAlMjBWaXNpb25UZXh0RHVhbEVuY29kZXJQcm9jZXNzb3IlMkMlMEElMjAlMjAlMjAlMjBBdXRvSW1hZ2VQcm9jZXNzb3IlMkMlMEElMjAlMjAlMjAlMj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2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjB0Zi5ubi5zb2Z0bWF4KGxvZ2l0c19wZXJfaW1hZ2UlMkMlMjBheGlzJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",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(){i=n("p"),i.textContent=x,c=r(),T(h.$$.fragment)},l(a){i=o(a,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=x),c=l(a),M(h.$$.fragment,a)},m(a,j){m(a,i,j),m(a,c,j),_(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 An(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.33.3/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,Fe,Ss="VisionTextDualEncoderConfig",Et,k,fe,es,Ne,As=`<a href="/docs/transformers/v4.33.3/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.33.3/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderModel">VisionTextDualEncoderModel</a>. It is used to instantiate <a href="/docs/transformers/v4.33.3/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.33.3/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.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ss,Q,ns,S,Te,os,Xe,Os=`Instantiate a <a href="/docs/transformers/v4.33.3/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,Mt,Me,as,He,Ks="VisionTextDualEncoderProcessor",Zt,E,_e,rs,Re,en=`Constructs a VisionTextDualEncoder processor which wraps an image processor and a tokenizer into a single
processor.`,ls,Pe,tn=`<a href="/docs/transformers/v4.33.3/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor">VisionTextDualEncoderProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a> and <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>.
See the <code>__call__()</code> and <a href="/docs/transformers/v4.33.3/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderProcessor.decode">decode()</a> for more
information.`,is,q,ve,ds,Ge,sn=`This method forwards all its arguments to VisionTextDualEncoderTokenizer’s
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.batch_decode">batch_decode()</a>. Please refer to the docstring of this method for more information.`,cs,O,ye,ps,Le,nn=`This method forwards all its arguments to VisionTextDualEncoderTokenizer’s <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.decode">decode()</a>.
Please refer to the docstring of this method for more information.`,Wt,R,K,_t,be,ms,Ye,on="VisionTextDualEncoderModel",$t,J,xe,hs,Qe,an=`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.33.3/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,rn=`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,ln=`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,dn=`This model inherits from <a href="/docs/transformers/v4.33.3/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,cn=`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.`,Ms,W,we,_s,Ke,pn='The <a href="/docs/transformers/v4.33.3/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,mn="FlaxVisionTextDualEncoderModel",zt,w,Je,xs,tt,hn=`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.33.3/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,un=`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,nt,gn=`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,ot,fn=`This model inherits from <a href="/docs/transformers/v4.33.3/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,Tn=`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,Mn="Finally, this model supports inherent JAX features such as:",Is,lt,_n='<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,vn='The <a href="/docs/transformers/v4.33.3/en/model_doc/vision-text-dual-encoder#transformers.FlaxVisionTextDualEncoderModel">FlaxVisionTextDualEncoderModel</a> forward method, overrides the <code>__call__</code> special method.',Cs,ne,Zs,oe,Ft,G,ae,yt,Ue,Ws,dt,yn="TFVisionTextDualEncoderModel",Nt,V,Ie,$s,ct,bn=`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.33.3/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,xn=`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,wn=`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,ht,jn=`This model inherits from <a href="/docs/transformers/v4.33.3/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.)`,Ns,ut,Jn=`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,Vn='The <a href="/docs/transformers/v4.33.3/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.33.3/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L27"}}),Q=new St({props:{anchor:"transformers.VisionTextDualEncoderConfig.example",$$slots:{default:[Rn]},$$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.33.3/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py#L104",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig"
>VisionTextDualEncoderConfig</a></p>
`}}),Me=new We({}),_e=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.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.VisionTextDualEncoderProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/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.33.3/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.33.3/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.33.3/en/model_doc/vision-encoder-decoder#transformers.VisionEncoderDecoderConfig">VisionEncoderDecoderConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/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.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.VisionTextDualEncoderModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.VisionTextDualEncoderModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.VisionTextDualEncoderModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
an image processor (e.g. if you use ViT as the encoder, you should use <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.33.3/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VisionTextDualEncoderModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.VisionTextDualEncoderModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.VisionTextDualEncoderModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.VisionTextDualEncoderModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/vision_text_dual_encoder/modeling_vision_text_dual_encoder.py#L293",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.3/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.33.3/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.33.3/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.3/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.3/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:[Pn]},$$scope:{ctx:I}}}),te=new St({props:{anchor:"transformers.VisionTextDualEncoderModel.forward.example",$$slots:{default:[Gn]},$$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.33.3/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig">VisionTextDualEncoderConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/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.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
an image processor (e.g. if you use ViT as the encoder, you should use <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.33.3/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/vision_text_dual_encoder/modeling_flax_vision_text_dual_encoder.py#L269",returnDescription:`
<p>A <code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.3/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.33.3/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.33.3/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.3/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.3/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>
`}}),ne=new Ps({props:{$$slots:{default:[Ln]},$$scope:{ctx:I}}}),oe=new St({props:{anchor:"transformers.FlaxVisionTextDualEncoderModel.__call__.example",$$slots:{default:[Yn]},$$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.33.3/en/model_doc/vision-encoder-decoder#transformers.VisionEncoderDecoderConfig">VisionEncoderDecoderConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/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.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
an image processor (e.g. if you use ViT as the encoder, you should use <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>). See
<a href="/docs/transformers/v4.33.3/en/model_doc/mobilevit#transformers.MobileViTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFVisionTextDualEncoderModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/vision_text_dual_encoder/modeling_tf_vision_text_dual_encoder.py#L341",returnDescription:`
<p>A <code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.33.3/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.33.3/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.33.3/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.3/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.33.3/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:[Qn]},$$scope:{ctx:I}}}),le=new St({props:{anchor:"transformers.TFVisionTextDualEncoderModel.call.example",$$slots:{default:[Sn]},$$scope:{ctx:I}}}),{c(){i=n("meta"),x=r(),c=n("p"),h=r(),f=n("h1"),a=n("a"),j=n("span"),T(pe.$$.fragment),qt=r(),Be=n("span"),Be.textContent=Gs,Vt=r(),D=n("h2"),L=n("a"),ft=n("span"),T(me.$$.fragment),Ot=r(),ze=n("span"),ze.textContent=Ls,Ut=r(),he=n("p"),he.innerHTML=Ys,It=r(),ue=n("p"),ue.innerHTML=Qs,kt=r(),X=n("h2"),Y=n("a"),Tt=n("span"),T(ge.$$.fragment),Kt=r(),Fe=n("span"),Fe.textContent=Ss,Et=r(),k=n("div"),T(fe.$$.fragment),es=r(),Ne=n("p"),Ne.innerHTML=As,ts=r(),De=n("p"),De.innerHTML=qs,ss=r(),T(Q.$$.fragment),ns=r(),S=n("div"),T(Te.$$.fragment),os=r(),Xe=n("p"),Xe.innerHTML=Os,Ct=r(),H=n("h2"),A=n("a"),Mt=n("span"),T(Me.$$.fragment),as=r(),He=n("span"),He.textContent=Ks,Zt=r(),E=n("div"),T(_e.$$.fragment),rs=r(),Re=n("p"),Re.textContent=en,ls=r(),Pe=n("p"),Pe.innerHTML=tn,is=r(),q=n("div"),T(ve.$$.fragment),ds=r(),Ge=n("p"),Ge.innerHTML=sn,cs=r(),O=n("div"),T(ye.$$.fragment),ps=r(),Le=n("p"),Le.innerHTML=nn,Wt=r(),R=n("h2"),K=n("a"),_t=n("span"),T(be.$$.fragment),ms=r(),Ye=n("span"),Ye.textContent=on,$t=r(),J=n("div"),T(xe.$$.fragment),hs=r(),Qe=n("p"),Qe.innerHTML=an,us=r(),Se=n("p"),Se.innerHTML=rn,gs=r(),Ae=n("p"),Ae.textContent=ln,fs=r(),qe=n("p"),qe.innerHTML=dn,Ts=r(),Oe=n("p"),Oe.innerHTML=cn,Ms=r(),W=n("div"),T(we.$$.fragment),_s=r(),Ke=n("p"),Ke.innerHTML=pn,vs=r(),T(ee.$$.fragment),ys=r(),T(te.$$.fragment),Bt=r(),P=n("h2"),se=n("a"),vt=n("span"),T(je.$$.fragment),bs=r(),et=n("span"),et.textContent=mn,zt=r(),w=n("div"),T(Je.$$.fragment),xs=r(),tt=n("p"),tt.innerHTML=hn,ws=r(),st=n("p"),st.innerHTML=un,js=r(),nt=n("p"),nt.textContent=gn,Js=r(),ot=n("p"),ot.innerHTML=fn,Vs=r(),at=n("p"),at.innerHTML=Tn,Us=r(),rt=n("p"),rt.textContent=Mn,Is=r(),lt=n("ul"),lt.innerHTML=_n,ks=r(),$=n("div"),T(Ve.$$.fragment),Es=r(),it=n("p"),it.innerHTML=vn,Cs=r(),T(ne.$$.fragment),Zs=r(),T(oe.$$.fragment),Ft=r(),G=n("h2"),ae=n("a"),yt=n("span"),T(Ue.$$.fragment),Ws=r(),dt=n("span"),dt.textContent=yn,Nt=r(),V=n("div"),T(Ie.$$.fragment),$s=r(),ct=n("p"),ct.innerHTML=bn,Bs=r(),pt=n("p"),pt.innerHTML=xn,zs=r(),mt=n("p"),mt.textContent=wn,Fs=r(),ht=n("p"),ht.innerHTML=jn,Ns=r(),ut=n("p"),ut.innerHTML=Jn,Ds=r(),B=n("div"),T(ke.$$.fragment),Xs=r(),gt=n("p"),gt.innerHTML=Vn,Hs=r(),T(re.$$.fragment),Rs=r(),T(le.$$.fragment),Dt=r(),bt=n("p"),this.h()},l(e){const d=Hn("svelte-1phssyn",document.head);i=o(d,"META",{name:!0,content:!0}),d.forEach(s),x=l(e),c=o(e,"P",{}),g(c).forEach(s),h=l(e),f=o(e,"H1",{class:!0});var Ee=g(f);a=o(Ee,"A",{id:!0,class:!0,href:!0});var xt=g(a);j=o(xt,"SPAN",{});var wt=g(j);M(pe.$$.fragment,wt),wt.forEach(s),xt.forEach(s),qt=l(Ee),Be=o(Ee,"SPAN",{"data-svelte-h":!0}),p(Be)!=="svelte-z5ztu8"&&(Be.textContent=Gs),Ee.forEach(s),Vt=l(e),D=o(e,"H2",{class:!0});var Ce=g(D);L=o(Ce,"A",{id:!0,class:!0,href:!0});var jt=g(L);ft=o(jt,"SPAN",{});var Jt=g(ft);M(me.$$.fragment,Jt),Jt.forEach(s),jt.forEach(s),Ot=l(Ce),ze=o(Ce,"SPAN",{"data-svelte-h":!0}),p(ze)!=="svelte-1jsw1pg"&&(ze.textContent=Ls),Ce.forEach(s),Ut=l(e),he=o(e,"P",{"data-svelte-h":!0}),p(he)!=="svelte-1vkytj6"&&(he.innerHTML=Ys),It=l(e),ue=o(e,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-8axln3"&&(ue.innerHTML=Qs),kt=l(e),X=o(e,"H2",{class:!0});var Ze=g(X);Y=o(Ze,"A",{id:!0,class:!0,href:!0});var Un=g(Y);Tt=o(Un,"SPAN",{});var In=g(Tt);M(ge.$$.fragment,In),In.forEach(s),Un.forEach(s),Kt=l(Ze),Fe=o(Ze,"SPAN",{"data-svelte-h":!0}),p(Fe)!=="svelte-mk6ipu"&&(Fe.textContent=Ss),Ze.forEach(s),Et=l(e),k=o(e,"DIV",{class:!0});var F=g(k);M(fe.$$.fragment,F),es=l(F),Ne=o(F,"P",{"data-svelte-h":!0}),p(Ne)!=="svelte-14e7eud"&&(Ne.innerHTML=As),ts=l(F),De=o(F,"P",{"data-svelte-h":!0}),p(De)!=="svelte-cfh5wl"&&(De.innerHTML=qs),ss=l(F),M(Q.$$.fragment,F),ns=l(F),S=o(F,"DIV",{class:!0});var Ht=g(S);M(Te.$$.fragment,Ht),os=l(Ht),Xe=o(Ht,"P",{"data-svelte-h":!0}),p(Xe)!=="svelte-aqdri2"&&(Xe.innerHTML=Os),Ht.forEach(s),F.forEach(s),Ct=l(e),H=o(e,"H2",{class:!0});var Rt=g(H);A=o(Rt,"A",{id:!0,class:!0,href:!0});var kn=g(A);Mt=o(kn,"SPAN",{});var En=g(Mt);M(Me.$$.fragment,En),En.forEach(s),kn.forEach(s),as=l(Rt),He=o(Rt,"SPAN",{"data-svelte-h":!0}),p(He)!=="svelte-62ojb2"&&(He.textContent=Ks),Rt.forEach(s),Zt=l(e),E=o(e,"DIV",{class:!0});var N=g(E);M(_e.$$.fragment,N),rs=l(N),Re=o(N,"P",{"data-svelte-h":!0}),p(Re)!=="svelte-c5g5w0"&&(Re.textContent=en),ls=l(N),Pe=o(N,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-1c6p2cf"&&(Pe.innerHTML=tn),is=l(N),q=o(N,"DIV",{class:!0});var Pt=g(q);M(ve.$$.fragment,Pt),ds=l(Pt),Ge=o(Pt,"P",{"data-svelte-h":!0}),p(Ge)!=="svelte-1oac9oc"&&(Ge.innerHTML=sn),Pt.forEach(s),cs=l(N),O=o(N,"DIV",{class:!0});var Gt=g(O);M(ye.$$.fragment,Gt),ps=l(Gt),Le=o(Gt,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-956wjy"&&(Le.innerHTML=nn),Gt.forEach(s),N.forEach(s),Wt=l(e),R=o(e,"H2",{class:!0});var Lt=g(R);K=o(Lt,"A",{id:!0,class:!0,href:!0});var Cn=g(K);_t=o(Cn,"SPAN",{});var Zn=g(_t);M(be.$$.fragment,Zn),Zn.forEach(s),Cn.forEach(s),ms=l(Lt),Ye=o(Lt,"SPAN",{"data-svelte-h":!0}),p(Ye)!=="svelte-f0ye25"&&(Ye.textContent=on),Lt.forEach(s),$t=l(e),J=o(e,"DIV",{class:!0});var C=g(J);M(xe.$$.fragment,C),hs=l(C),Qe=o(C,"P",{"data-svelte-h":!0}),p(Qe)!=="svelte-1dp02jr"&&(Qe.innerHTML=an),us=l(C),Se=o(C,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-98iof6"&&(Se.innerHTML=rn),gs=l(C),Ae=o(C,"P",{"data-svelte-h":!0}),p(Ae)!=="svelte-c2j1l6"&&(Ae.textContent=ln),fs=l(C),qe=o(C,"P",{"data-svelte-h":!0}),p(qe)!=="svelte-ev63c"&&(qe.innerHTML=dn),Ts=l(C),Oe=o(C,"P",{"data-svelte-h":!0}),p(Oe)!=="svelte-hswkmf"&&(Oe.innerHTML=cn),Ms=l(C),W=o(C,"DIV",{class:!0});var ie=g(W);M(we.$$.fragment,ie),_s=l(ie),Ke=o(ie,"P",{"data-svelte-h":!0}),p(Ke)!=="svelte-1an4imp"&&(Ke.innerHTML=pn),vs=l(ie),M(ee.$$.fragment,ie),ys=l(ie),M(te.$$.fragment,ie),ie.forEach(s),C.forEach(s),Bt=l(e),P=o(e,"H2",{class:!0});var Yt=g(P);se=o(Yt,"A",{id:!0,class:!0,href:!0});var Wn=g(se);vt=o(Wn,"SPAN",{});var $n=g(vt);M(je.$$.fragment,$n),$n.forEach(s),Wn.forEach(s),bs=l(Yt),et=o(Yt,"SPAN",{"data-svelte-h":!0}),p(et)!=="svelte-136kz3k"&&(et.textContent=mn),Yt.forEach(s),zt=l(e),w=o(e,"DIV",{class:!0});var U=g(w);M(Je.$$.fragment,U),xs=l(U),tt=o(U,"P",{"data-svelte-h":!0}),p(tt)!=="svelte-1dp02jr"&&(tt.innerHTML=hn),ws=l(U),st=o(U,"P",{"data-svelte-h":!0}),p(st)!=="svelte-98iof6"&&(st.innerHTML=un),js=l(U),nt=o(U,"P",{"data-svelte-h":!0}),p(nt)!=="svelte-c2j1l6"&&(nt.textContent=gn),Js=l(U),ot=o(U,"P",{"data-svelte-h":!0}),p(ot)!=="svelte-ev63c"&&(ot.innerHTML=fn),Vs=l(U),at=o(U,"P",{"data-svelte-h":!0}),p(at)!=="svelte-9ybkh"&&(at.innerHTML=Tn),Us=l(U),rt=o(U,"P",{"data-svelte-h":!0}),p(rt)!=="svelte-1pplc4a"&&(rt.textContent=Mn),Is=l(U),lt=o(U,"UL",{"data-svelte-h":!0}),p(lt)!=="svelte-1w7z84m"&&(lt.innerHTML=_n),ks=l(U),$=o(U,"DIV",{class:!0});var de=g($);M(Ve.$$.fragment,de),Es=l(de),it=o(de,"P",{"data-svelte-h":!0}),p(it)!=="svelte-1lpcc63"&&(it.innerHTML=vn),Cs=l(de),M(ne.$$.fragment,de),Zs=l(de),M(oe.$$.fragment,de),de.forEach(s),U.forEach(s),Ft=l(e),G=o(e,"H2",{class:!0});var Qt=g(G);ae=o(Qt,"A",{id:!0,class:!0,href:!0});var Bn=g(ae);yt=o(Bn,"SPAN",{});var zn=g(yt);M(Ue.$$.fragment,zn),zn.forEach(s),Bn.forEach(s),Ws=l(Qt),dt=o(Qt,"SPAN",{"data-svelte-h":!0}),p(dt)!=="svelte-cbazn"&&(dt.textContent=yn),Qt.forEach(s),Nt=l(e),V=o(e,"DIV",{class:!0});var Z=g(V);M(Ie.$$.fragment,Z),$s=l(Z),ct=o(Z,"P",{"data-svelte-h":!0}),p(ct)!=="svelte-1dp02jr"&&(ct.innerHTML=bn),Bs=l(Z),pt=o(Z,"P",{"data-svelte-h":!0}),p(pt)!=="svelte-98iof6"&&(pt.innerHTML=xn),zs=l(Z),mt=o(Z,"P",{"data-svelte-h":!0}),p(mt)!=="svelte-c2j1l6"&&(mt.textContent=wn),Fs=l(Z),ht=o(Z,"P",{"data-svelte-h":!0}),p(ht)!=="svelte-1e9g3w8"&&(ht.innerHTML=jn),Ns=l(Z),ut=o(Z,"P",{"data-svelte-h":!0}),p(ut)!=="svelte-y4ylu0"&&(ut.innerHTML=Jn),Ds=l(Z),B=o(Z,"DIV",{class:!0});var ce=g(B);M(ke.$$.fragment,ce),Xs=l(ce),gt=o(ce,"P",{"data-svelte-h":!0}),p(gt)!=="svelte-1fm2jat"&&(gt.innerHTML=Vn),Hs=l(ce),M(re.$$.fragment,ce),Rs=l(ce),M(le.$$.fragment,ce),ce.forEach(s),Z.forEach(s),Dt=l(e),bt=o(e,"P",{}),g(bt).forEach(s),this.h()},h(){u(i,"name","hf:doc:metadata"),u(i,"content",JSON.stringify(qn)),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),_(pe,j,null),t(f,qt),t(f,Be),m(e,Vt,d),m(e,D,d),t(D,L),t(L,ft),_(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),_(ge,Tt,null),t(X,Kt),t(X,Fe),m(e,Et,d),m(e,k,d),_(fe,k,null),t(k,es),t(k,Ne),t(k,ts),t(k,De),t(k,ss),_(Q,k,null),t(k,ns),t(k,S),_(Te,S,null),t(S,os),t(S,Xe),m(e,Ct,d),m(e,H,d),t(H,A),t(A,Mt),_(Me,Mt,null),t(H,as),t(H,He),m(e,Zt,d),m(e,E,d),_(_e,E,null),t(E,rs),t(E,Re),t(E,ls),t(E,Pe),t(E,is),t(E,q),_(ve,q,null),t(q,ds),t(q,Ge),t(E,cs),t(E,O),_(ye,O,null),t(O,ps),t(O,Le),m(e,Wt,d),m(e,R,d),t(R,K),t(K,_t),_(be,_t,null),t(R,ms),t(R,Ye),m(e,$t,d),m(e,J,d),_(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,Ms),t(J,W),_(we,W,null),t(W,_s),t(W,Ke),t(W,vs),_(ee,W,null),t(W,ys),_(te,W,null),m(e,Bt,d),m(e,P,d),t(P,se),t(se,vt),_(je,vt,null),t(P,bs),t(P,et),m(e,zt,d),m(e,w,d),_(Je,w,null),t(w,xs),t(w,tt),t(w,ws),t(w,st),t(w,js),t(w,nt),t(w,Js),t(w,ot),t(w,Vs),t(w,at),t(w,Us),t(w,rt),t(w,Is),t(w,lt),t(w,ks),t(w,$),_(Ve,$,null),t($,Es),t($,it),t($,Cs),_(ne,$,null),t($,Zs),_(oe,$,null),m(e,Ft,d),m(e,G,d),t(G,ae),t(ae,yt),_(Ue,yt,null),t(G,Ws),t(G,dt),m(e,Nt,d),m(e,V,d),_(Ie,V,null),t(V,$s),t(V,ct),t(V,Bs),t(V,pt),t(V,zs),t(V,mt),t(V,Fs),t(V,ht),t(V,Ns),t(V,ut),t(V,Ds),t(V,B),_(ke,B,null),t(B,Xs),t(B,gt),t(B,Hs),_(re,B,null),t(B,Rs),_(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}),ne.$set(Ce);const jt={};d&2&&(jt.$$scope={dirty:d,ctx:e}),oe.$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(Me.$$.fragment,e),v(_e.$$.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(ne.$$.fragment,e),v(oe.$$.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(Me.$$.fragment,e),y(_e.$$.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(ne.$$.fragment,e),y(oe.$$.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(Ft),s(G),s(Nt),s(V),s(Dt),s(bt)),s(i),b(pe),b(me),b(ge),b(fe),b(Q),b(Te),b(Me),b(_e),b(ve),b(ye),b(be),b(xe),b(we),b(ee),b(te),b(je),b(Je),b(Ve),b(ne),b(oe),b(Ue),b(Ie),b(ke),b(re),b(le)}}}const qn={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 On(I){return Nn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ro extends Dn{constructor(i){super(),Xn(this,i,On,An,Fn,{})}}export{ro as component};
