import{s as eo,o as to,n as L}from"../chunks/scheduler.25b97de1.js";import{S as no,i as oo,g as m,s as l,r as g,A as so,h as p,f as s,c as i,j as $,u as f,x as y,k as v,y as c,a as d,v as u,d as h,t as _,w as M}from"../chunks/index.d9030fc9.js";import{T as ht}from"../chunks/Tip.baa67368.js";import{D as P}from"../chunks/Docstring.ffac8efa.js";import{C as Y}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ue}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as q,E as ao}from"../chunks/EditOnGithub.91d95064.js";function ro(I){let n,C='This model is based on <code>CLIPModel</code>, use it like you would use the original <a href="clip">CLIP</a>.';return{c(){n=m("p"),n.innerHTML=C},l(a){n=p(a,"P",{"data-svelte-h":!0}),y(n)!=="svelte-r1r37q"&&(n.innerHTML=C)},m(a,r){d(a,n,r)},p:L,d(a){a&&s(n)}}}function lo(I){let n,C="Example:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsdENMSVBDb25maWclMkMlMjBBbHRDTElQTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQWx0Q0xJUENvbmZpZyUyMHdpdGglMjBCQUFJJTJGQWx0Q0xJUCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBBbHRDTElQQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQWx0Q0xJUE1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBCQUFJJTJGQWx0Q0xJUCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQWx0Q0xJUE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZyUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGluaXRpYWxpemUlMjBhJTIwQWx0Q0xJUENvbmZpZyUyMGZyb20lMjBhJTIwQWx0Q0xJUFRleHRDb25maWclMjBhbmQlMjBhJTIwQWx0Q0xJUFZpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBBbHRDTElQVGV4dCUyMGFuZCUyMEFsdENMSVBWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBBbHRDTElQVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMEFsdENMSVBWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMEFsdENMSVBDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AltCLIPConfig, AltCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPConfig with BAAI/AltCLIP style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = AltCLIPConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPModel (with random weights) from the BAAI/AltCLIP style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPModel(configuration)

<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>configuration = model.config

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also initialize a AltCLIPConfig from a AltCLIPTextConfig and a AltCLIPVisionConfig</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPText and AltCLIPVision configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = AltCLIPTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = AltCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = AltCLIPConfig.from_text_vision_configs(config_text, config_vision)`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-11lpom8"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function io(I){let n,C="Examples:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsdENMSVBUZXh0TW9kZWwlMkMlMjBBbHRDTElQVGV4dENvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBBbHRDTElQVGV4dENvbmZpZyUyMHdpdGglMjBCQUFJJTJGQWx0Q0xJUCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBBbHRDTElQVGV4dENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEFsdENMSVBUZXh0TW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMEJBQUklMkZBbHRDTElQJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBBbHRDTElQVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AltCLIPTextModel, AltCLIPTextConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPTextConfig with BAAI/AltCLIP style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = AltCLIPTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPTextModel (with random weights) from the BAAI/AltCLIP style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPTextModel(configuration)

<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>configuration = model.config`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-kvfsh7"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function co(I){let n,C="Example:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsdENMSVBWaXNpb25Db25maWclMkMlMjBBbHRDTElQVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQWx0Q0xJUFZpc2lvbkNvbmZpZyUyMHdpdGglMjBCQUFJJTJGQWx0Q0xJUCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBBbHRDTElQVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQWx0Q0xJUFZpc2lvbk1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBCQUFJJTJGQWx0Q0xJUCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQWx0Q0xJUFZpc2lvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AltCLIPVisionConfig, AltCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPVisionConfig with BAAI/AltCLIP style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = AltCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AltCLIPVisionModel (with random weights) from the BAAI/AltCLIP style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPVisionModel(configuration)

<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>configuration = model.config`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-11lpom8"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function mo(I){let n,C=`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(){n=m("p"),n.innerHTML=C},l(a){n=p(a,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=C)},m(a,r){d(a,n,r)},p:L,d(a){a&&s(n)}}}function po(I){let n,C="Examples:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEFsdENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQWx0Q0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMHRleHQlM0QlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUwQSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzX3Blcl9pbWFnZSUyMCUzRCUyMG91dHB1dHMubG9naXRzX3Blcl9pbWFnZSUyMCUyMCUyMyUyMHRoaXMlMjBpcyUyMHRoZSUyMGltYWdlLXRleHQlMjBzaW1pbGFyaXR5JTIwc2NvcmUlMEFwcm9icyUyMCUzRCUyMGxvZ2l0c19wZXJfaW1hZ2Uuc29mdG1heChkaW0lM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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> AutoProcessor, AltCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPModel.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<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=image, 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(**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(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-kvfsh7"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function go(I){let n,C=`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(){n=m("p"),n.innerHTML=C},l(a){n=p(a,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=C)},m(a,r){d(a,n,r)},p:L,d(a){a&&s(n)}}}function fo(I){let n,C="Examples:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBbHRDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEFsdENMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyQkFBSSUyRkFsdENMSVAlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyQkFBSSUyRkFsdENMSVAlMjIpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0QlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AltCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPModel.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(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>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-kvfsh7"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function uo(I){let n,C=`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(){n=m("p"),n.innerHTML=C},l(a){n=p(a,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=C)},m(a,r){d(a,n,r)},p:L,d(a){a&&s(n)}}}function ho(I){let n,C="Examples:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEFsdENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQWx0Q0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyk=",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> AutoProcessor, AltCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPModel.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-kvfsh7"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function _o(I){let n,C=`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(){n=m("p"),n.innerHTML=C},l(a){n=p(a,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=C)},m(a,r){d(a,n,r)},p:L,d(a){a&&s(n)}}}function Mo(I){let n,C="Examples:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBbHRDTElQVGV4dE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBBbHRDTElQVGV4dE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEElMEF0ZXh0cyUyMCUzRCUyMCU1QiUyMml0J3MlMjBhJTIwY2F0JTIyJTJDJTIwJTIyaXQncyUyMGElMjBkb2clMjIlNUQlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRHRleHRzJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AltCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>texts = [<span class="hljs-string">&quot;it&#x27;s a cat&quot;</span>, <span class="hljs-string">&quot;it&#x27;s a dog&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-kvfsh7"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function bo(I){let n,C=`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(){n=m("p"),n.innerHTML=C},l(a){n=p(a,"P",{"data-svelte-h":!0}),y(n)!=="svelte-fincs2"&&(n.innerHTML=C)},m(a,r){d(a,n,r)},p:L,d(a){a&&s(n)}}}function Co(I){let n,C="Examples:",a,r,b;return r=new Y({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEFsdENMSVBWaXNpb25Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQWx0Q0xJUFZpc2lvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMENMUyUyMHN0YXRlcw==",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> AutoProcessor, AltCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`,wrap:!1}}),{c(){n=m("p"),n.textContent=C,a=l(),g(r.$$.fragment)},l(t){n=p(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-kvfsh7"&&(n.textContent=C),a=i(t),f(r.$$.fragment,t)},m(t,T){d(t,n,T),d(t,a,T),u(r,t,T),b=!0},p:L,i(t){b||(h(r.$$.fragment,t),b=!0)},o(t){_(r.$$.fragment,t),b=!1},d(t){t&&(s(n),s(a)),M(r,t)}}}function To(I){let n,C,a,r,b,t,T,Mt,he,Jn=`The AltCLIP model was proposed in <a href="https://arxiv.org/abs/2211.06679v2" rel="nofollow">AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities</a> by Zhongzhi Chen, Guang Liu, Bo-Wen Zhang, Fulong Ye, Qinghong Yang, Ledell Wu. AltCLIP
(Altering the Language Encoder in CLIP) is a neural network trained on a variety of image-text and text-text pairs. By switching CLIP’s
text encoder with a pretrained multilingual text encoder XLM-R, we could obtain very close performances with CLIP on almost all tasks, and extended original CLIP’s capabilities such as multilingual understanding.`,bt,_e,An="The abstract from the paper is the following:",Ct,Me,jn=`<em>In this work, we present a conceptually simple and effective method to train a strong bilingual multimodal representation model.
Starting from the pretrained multimodal representation model CLIP released by OpenAI, we switched its text encoder with a pretrained
multilingual text encoder XLM-R, and aligned both languages and image representations by a two-stage training schema consisting of
teacher learning and contrastive learning. We validate our method through evaluations of a wide range of tasks. We set new state-of-the-art
performances on a bunch of tasks including ImageNet-CN, Flicker30k- CN, and COCO-CN. Further, we obtain very close performances with
CLIP on almost all tasks, suggesting that one can simply alter the text encoder in CLIP for extended capabilities such as multilingual understanding.</em>`,Tt,be,kn='This model was contributed by <a href="https://huggingface.co/jongjyh" rel="nofollow">jongjyh</a>.',yt,Ce,It,Te,Un=`The usage of AltCLIP is very similar to the CLIP. the difference between CLIP is the text encoder. Note that we use bidirectional attention instead of casual attention
and we take the [CLS] token in XLM-R to represent text embedding.`,$t,ye,Bn=`AltCLIP is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image
classification. AltCLIP uses a ViT like transformer to get visual features and a bidirectional language model to get the text
features. Both the text and visual features are then projected to a latent space with identical dimension. The dot
product between the projected image and text features is then used as a similar score.`,vt,Ie,zn=`To feed images to the Transformer encoder, each image is split into a sequence of fixed-size non-overlapping patches,
which are then linearly embedded. A [CLS] token is added to serve as representation of an entire image. The authors
also add absolute position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder.
The <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> can be used to resize (or rescale) and normalize images for the model.`,wt,$e,Wn=`The <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPProcessor">AltCLIPProcessor</a> wraps a <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and a <a href="/docs/transformers/main/en/model_doc/xlm-roberta#transformers.XLMRobertaTokenizer">XLMRobertaTokenizer</a> into a single instance to both
encode the text and prepare the images. The following example shows how to get the image-text similarity scores using
<a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPProcessor">AltCLIPProcessor</a> and <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPModel">AltCLIPModel</a>.`,xt,ve,Pt,D,Lt,we,Jt,w,xe,Rt,et,Zn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPModel">AltCLIPModel</a>. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the AltCLIP
<a href="https://huggingface.co/BAAI/AltCLIP" rel="nofollow">BAAI/AltCLIP</a> architecture.`,qt,tt,Vn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Xt,O,St,K,Pe,Yt,nt,Hn=`Instantiate a <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPConfig">AltCLIPConfig</a> (or a derived class) from altclip text model configuration and altclip vision
model configuration.`,At,Le,jt,J,Je,Dt,ot,En=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextModel">AltCLIPTextModel</a>. It is used to instantiate a
AltCLIP text model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the AltCLIP
<a href="https://huggingface.co/BAAI/AltCLIP" rel="nofollow">BAAI/AltCLIP</a> architecture.`,Ot,st,Qn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Kt,ee,kt,Ae,Ut,A,je,en,at,Gn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPModel">AltCLIPModel</a>. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the AltCLIP
<a href="https://huggingface.co/BAAI/AltCLIP" rel="nofollow">BAAI/AltCLIP</a> architecture.`,tn,rt,Fn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,nn,te,Bt,ke,zt,x,Ue,on,lt,Nn=`Constructs a AltCLIP processor which wraps a CLIP image processor and a XLM-Roberta tokenizer into a single
processor.`,sn,it,Rn=`<a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPProcessor">AltCLIPProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/xlm-roberta#transformers.XLMRobertaTokenizerFast">XLMRobertaTokenizerFast</a>. See
the <code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPProcessor.decode">decode()</a> for more information.`,an,ne,Be,rn,dt,qn=`This method forwards all its arguments to XLMRobertaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>.
Please refer to the docstring of this method for more information.`,ln,oe,ze,dn,ct,Xn=`This method forwards all its arguments to XLMRobertaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please
refer to the docstring of this method for more information.`,Wt,We,Zt,j,Ze,cn,B,Ve,mn,mt,Sn='The <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPModel">AltCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',pn,se,gn,ae,fn,z,He,un,pt,Yn='The <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPModel">AltCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',hn,re,_n,le,Mn,W,Ee,bn,gt,Dn='The <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPModel">AltCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',Cn,ie,Tn,de,Vt,Qe,Ht,X,Ge,yn,Z,Fe,In,ft,On='The <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextModel">AltCLIPTextModel</a> forward method, overrides the <code>__call__</code> special method.',$n,ce,vn,me,Et,Ne,Qt,S,Re,wn,V,qe,xn,ut,Kn='The <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPVisionModel">AltCLIPVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Pn,pe,Ln,ge,Gt,Xe,Ft,_t,Nt;return b=new q({props:{title:"AltCLIP",local:"altclip",headingTag:"h1"}}),T=new q({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Ce=new q({props:{title:"Usage tips and example",local:"usage-tips-and-example",headingTag:"h2"}}),ve=new Y({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQWx0Q0xJUE1vZGVsJTJDJTIwQWx0Q0xJUFByb2Nlc3NvciUwQSUwQW1vZGVsJTIwJTNEJTIwQWx0Q0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBbHRDTElQUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJCQUFJJTJGQWx0Q0xJUCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0QlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzX3Blcl9pbWFnZSUyMCUzRCUyMG91dHB1dHMubG9naXRzX3Blcl9pbWFnZSUyMCUyMCUyMyUyMHRoaXMlMjBpcyUyMHRoZSUyMGltYWdlLXRleHQlMjBzaW1pbGFyaXR5JTIwc2NvcmUlMEFwcm9icyUyMCUzRCUyMGxvZ2l0c19wZXJfaW1hZ2Uuc29mdG1heChkaW0lM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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> AltCLIPModel, AltCLIPProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AltCLIPModel.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AltCLIPProcessor.from_pretrained(<span class="hljs-string">&quot;BAAI/AltCLIP&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(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=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</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}}),D=new ht({props:{$$slots:{default:[ro]},$$scope:{ctx:I}}}),we=new q({props:{title:"AltCLIPConfig",local:"transformers.AltCLIPConfig",headingTag:"h2"}}),xe=new P({props:{name:"class transformers.AltCLIPConfig",anchor:"transformers.AltCLIPConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 768"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AltCLIPConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextConfig">AltCLIPTextConfig</a>.`,name:"text_config"},{anchor:"transformers.AltCLIPConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPVisionConfig">AltCLIPVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.AltCLIPConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.AltCLIPConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The initial value of the <em>logit_scale</em> parameter. Default is used as per the original CLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.AltCLIPConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/configuration_altclip.py#L235"}}),O=new ue({props:{anchor:"transformers.AltCLIPConfig.example",$$slots:{default:[lo]},$$scope:{ctx:I}}}),Pe=new P({props:{name:"from_text_vision_configs",anchor:"transformers.AltCLIPConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": AltCLIPTextConfig"},{name:"vision_config",val:": AltCLIPVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/configuration_altclip.py#L371",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>An instance of a configuration object</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPConfig"
>AltCLIPConfig</a></p>
`}}),Le=new q({props:{title:"AltCLIPTextConfig",local:"transformers.AltCLIPTextConfig",headingTag:"h2"}}),Je=new P({props:{name:"class transformers.AltCLIPTextConfig",anchor:"transformers.AltCLIPTextConfig",parameters:[{name:"vocab_size",val:" = 250002"},{name:"hidden_size",val:" = 1024"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"intermediate_size",val:" = 4096"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 514"},{name:"type_vocab_size",val:" = 1"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"project_dim",val:" = 768"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AltCLIPTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 250002) &#x2014;
Vocabulary size of the AltCLIP model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextModel">AltCLIPTextModel</a>.`,name:"vocab_size"},{anchor:"transformers.AltCLIPTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.AltCLIPTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.AltCLIPTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.AltCLIPTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.AltCLIPTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.AltCLIPTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.AltCLIPTextConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.AltCLIPTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 514) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.AltCLIPTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextModel">AltCLIPTextModel</a>`,name:"type_vocab_size"},{anchor:"transformers.AltCLIPTextConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.AltCLIPTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.AltCLIPTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.AltCLIPTextConfig.pad_token_id",description:"<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014; The id of the <em>padding</em> token.",name:"pad_token_id"},{anchor:"transformers.AltCLIPTextConfig.bos_token_id",description:"<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The id of the <em>beginning-of-sequence</em> token.",name:"bos_token_id"},{anchor:"transformers.AltCLIPTextConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.AltCLIPTextConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.AltCLIPTextConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.AltCLIPTextConfig.project_dim",description:`<strong>project_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The dimensions of the teacher model before the mapping layer.`,name:"project_dim"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/configuration_altclip.py#L24"}}),ee=new ue({props:{anchor:"transformers.AltCLIPTextConfig.example",$$slots:{default:[io]},$$scope:{ctx:I}}}),Ae=new q({props:{title:"AltCLIPVisionConfig",local:"transformers.AltCLIPVisionConfig",headingTag:"h2"}}),je=new P({props:{name:"class transformers.AltCLIPVisionConfig",anchor:"transformers.AltCLIPVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AltCLIPVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.AltCLIPVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.AltCLIPVisionConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.AltCLIPVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.AltCLIPVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.AltCLIPVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.AltCLIPVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.AltCLIPVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.AltCLIPVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.AltCLIPVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.AltCLIPVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.AltCLIPVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.AltCLIPVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/configuration_altclip.py#L142"}}),te=new ue({props:{anchor:"transformers.AltCLIPVisionConfig.example",$$slots:{default:[co]},$$scope:{ctx:I}}}),ke=new q({props:{title:"AltCLIPProcessor",local:"transformers.AltCLIPProcessor",headingTag:"h2"}}),Ue=new P({props:{name:"class transformers.AltCLIPProcessor",anchor:"transformers.AltCLIPProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"}],parametersDescription:[{anchor:"transformers.AltCLIPProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.AltCLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/xlm-roberta#transformers.XLMRobertaTokenizerFast">XLMRobertaTokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/processing_altclip.py#L31"}}),Be=new P({props:{name:"batch_decode",anchor:"transformers.AltCLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/processing_altclip.py#L127"}}),ze=new P({props:{name:"decode",anchor:"transformers.AltCLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/processing_altclip.py#L134"}}),We=new q({props:{title:"AltCLIPModel",local:"transformers.AltCLIPModel",headingTag:"h2"}}),Ze=new P({props:{name:"class transformers.AltCLIPModel",anchor:"transformers.AltCLIPModel",parameters:[{name:"config",val:": AltCLIPConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1517"}}),Ve=new P({props:{name:"forward",anchor:"transformers.AltCLIPModel.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:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": bool = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.AltCLIPModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.AltCLIPModel.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.AltCLIPModel.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.AltCLIPModel.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
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.AltCLIPModel.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.AltCLIPModel.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.AltCLIPModel.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.AltCLIPModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.AltCLIPModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1646",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.altclip.modeling_altclip.AltCLIPOutput</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 (<code>&lt;class 'transformers.models.altclip.configuration_altclip.AltCLIPConfig'&gt;</code>) 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</strong> (<code>torch.FloatTensor</code> 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</strong> (<code>torch.FloatTensor</code> 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</strong> (<code>torch.FloatTensor</code> 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/main/en/model_doc/altclip#transformers.AltCLIPTextModel"
>AltCLIPTextModel</a>.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> 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/main/en/model_doc/altclip#transformers.AltCLIPVisionModel"
>AltCLIPVisionModel</a>.</li>
<li><strong>text_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextModel"
>AltCLIPTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPVisionModel"
>AltCLIPVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.altclip.modeling_altclip.AltCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),se=new ht({props:{$$slots:{default:[mo]},$$scope:{ctx:I}}}),ae=new ue({props:{anchor:"transformers.AltCLIPModel.forward.example",$$slots:{default:[po]},$$scope:{ctx:I}}}),He=new P({props:{name:"get_text_features",anchor:"transformers.AltCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:" = 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.AltCLIPModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.AltCLIPModel.get_text_features.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.AltCLIPModel.get_text_features.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.AltCLIPModel.get_text_features.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.AltCLIPModel.get_text_features.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.AltCLIPModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1551",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPTextModel"
>AltCLIPTextModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),re=new ht({props:{$$slots:{default:[go]},$$scope:{ctx:I}}}),le=new ue({props:{anchor:"transformers.AltCLIPModel.get_text_features.example",$$slots:{default:[fo]},$$scope:{ctx:I}}}),Ee=new P({props:{name:"get_image_features",anchor:"transformers.AltCLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": bool = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.AltCLIPModel.get_image_features.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
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.AltCLIPModel.get_image_features.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.AltCLIPModel.get_image_features.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.AltCLIPModel.get_image_features.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.AltCLIPModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1598",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/altclip#transformers.AltCLIPVisionModel"
>AltCLIPVisionModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),ie=new ht({props:{$$slots:{default:[uo]},$$scope:{ctx:I}}}),de=new ue({props:{anchor:"transformers.AltCLIPModel.get_image_features.example",$$slots:{default:[ho]},$$scope:{ctx:I}}}),Qe=new q({props:{title:"AltCLIPTextModel",local:"transformers.AltCLIPTextModel",headingTag:"h2"}}),Ge=new P({props:{name:"class transformers.AltCLIPTextModel",anchor:"transformers.AltCLIPTextModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1425"}}),Fe=new P({props:{name:"forward",anchor:"transformers.AltCLIPTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.AltCLIPTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.AltCLIPTextModel.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.AltCLIPTextModel.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.AltCLIPTextModel.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.AltCLIPTextModel.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.AltCLIPTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1444",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndProjection</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 (<code>&lt;class 'transformers.models.altclip.configuration_altclip.AltCLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>projection_state</strong> (<code>tuple(torch.FloatTensor)</code>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> of shape <code>(batch_size,config.project_dim)</code>.</p>
<p>Text embeddings before the projection layer, used to mimic the last hidden state of the teacher encoder.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndProjection</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new ht({props:{$$slots:{default:[_o]},$$scope:{ctx:I}}}),me=new ue({props:{anchor:"transformers.AltCLIPTextModel.forward.example",$$slots:{default:[Mo]},$$scope:{ctx:I}}}),Ne=new q({props:{title:"AltCLIPVisionModel",local:"transformers.AltCLIPVisionModel",headingTag:"h2"}}),Re=new P({props:{name:"class transformers.AltCLIPVisionModel",anchor:"transformers.AltCLIPVisionModel",parameters:[{name:"config",val:": AltCLIPVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1192"}}),qe=new P({props:{name:"forward",anchor:"transformers.AltCLIPVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"interpolate_pos_encoding",val:": bool = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.AltCLIPVisionModel.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
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.AltCLIPVisionModel.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.AltCLIPVisionModel.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.AltCLIPVisionModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.AltCLIPVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py#L1205",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> 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 (<code>&lt;class 'transformers.models.altclip.configuration_altclip.AltCLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new ht({props:{$$slots:{default:[bo]},$$scope:{ctx:I}}}),ge=new ue({props:{anchor:"transformers.AltCLIPVisionModel.forward.example",$$slots:{default:[Co]},$$scope:{ctx:I}}}),Xe=new ao({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/altclip.md"}}),{c(){n=m("meta"),C=l(),a=m("p"),r=l(),g(b.$$.fragment),t=l(),g(T.$$.fragment),Mt=l(),he=m("p"),he.innerHTML=Jn,bt=l(),_e=m("p"),_e.textContent=An,Ct=l(),Me=m("p"),Me.innerHTML=jn,Tt=l(),be=m("p"),be.innerHTML=kn,yt=l(),g(Ce.$$.fragment),It=l(),Te=m("p"),Te.textContent=Un,$t=l(),ye=m("p"),ye.textContent=Bn,vt=l(),Ie=m("p"),Ie.innerHTML=zn,wt=l(),$e=m("p"),$e.innerHTML=Wn,xt=l(),g(ve.$$.fragment),Pt=l(),g(D.$$.fragment),Lt=l(),g(we.$$.fragment),Jt=l(),w=m("div"),g(xe.$$.fragment),Rt=l(),et=m("p"),et.innerHTML=Zn,qt=l(),tt=m("p"),tt.innerHTML=Vn,Xt=l(),g(O.$$.fragment),St=l(),K=m("div"),g(Pe.$$.fragment),Yt=l(),nt=m("p"),nt.innerHTML=Hn,At=l(),g(Le.$$.fragment),jt=l(),J=m("div"),g(Je.$$.fragment),Dt=l(),ot=m("p"),ot.innerHTML=En,Ot=l(),st=m("p"),st.innerHTML=Qn,Kt=l(),g(ee.$$.fragment),kt=l(),g(Ae.$$.fragment),Ut=l(),A=m("div"),g(je.$$.fragment),en=l(),at=m("p"),at.innerHTML=Gn,tn=l(),rt=m("p"),rt.innerHTML=Fn,nn=l(),g(te.$$.fragment),Bt=l(),g(ke.$$.fragment),zt=l(),x=m("div"),g(Ue.$$.fragment),on=l(),lt=m("p"),lt.textContent=Nn,sn=l(),it=m("p"),it.innerHTML=Rn,an=l(),ne=m("div"),g(Be.$$.fragment),rn=l(),dt=m("p"),dt.innerHTML=qn,ln=l(),oe=m("div"),g(ze.$$.fragment),dn=l(),ct=m("p"),ct.innerHTML=Xn,Wt=l(),g(We.$$.fragment),Zt=l(),j=m("div"),g(Ze.$$.fragment),cn=l(),B=m("div"),g(Ve.$$.fragment),mn=l(),mt=m("p"),mt.innerHTML=Sn,pn=l(),g(se.$$.fragment),gn=l(),g(ae.$$.fragment),fn=l(),z=m("div"),g(He.$$.fragment),un=l(),pt=m("p"),pt.innerHTML=Yn,hn=l(),g(re.$$.fragment),_n=l(),g(le.$$.fragment),Mn=l(),W=m("div"),g(Ee.$$.fragment),bn=l(),gt=m("p"),gt.innerHTML=Dn,Cn=l(),g(ie.$$.fragment),Tn=l(),g(de.$$.fragment),Vt=l(),g(Qe.$$.fragment),Ht=l(),X=m("div"),g(Ge.$$.fragment),yn=l(),Z=m("div"),g(Fe.$$.fragment),In=l(),ft=m("p"),ft.innerHTML=On,$n=l(),g(ce.$$.fragment),vn=l(),g(me.$$.fragment),Et=l(),g(Ne.$$.fragment),Qt=l(),S=m("div"),g(Re.$$.fragment),wn=l(),V=m("div"),g(qe.$$.fragment),xn=l(),ut=m("p"),ut.innerHTML=Kn,Pn=l(),g(pe.$$.fragment),Ln=l(),g(ge.$$.fragment),Gt=l(),g(Xe.$$.fragment),Ft=l(),_t=m("p"),this.h()},l(e){const o=so("svelte-u9bgzb",document.head);n=p(o,"META",{name:!0,content:!0}),o.forEach(s),C=i(e),a=p(e,"P",{}),$(a).forEach(s),r=i(e),f(b.$$.fragment,e),t=i(e),f(T.$$.fragment,e),Mt=i(e),he=p(e,"P",{"data-svelte-h":!0}),y(he)!=="svelte-u3ci1i"&&(he.innerHTML=Jn),bt=i(e),_e=p(e,"P",{"data-svelte-h":!0}),y(_e)!=="svelte-vfdo9a"&&(_e.textContent=An),Ct=i(e),Me=p(e,"P",{"data-svelte-h":!0}),y(Me)!=="svelte-fr1ot4"&&(Me.innerHTML=jn),Tt=i(e),be=p(e,"P",{"data-svelte-h":!0}),y(be)!=="svelte-zmfqz"&&(be.innerHTML=kn),yt=i(e),f(Ce.$$.fragment,e),It=i(e),Te=p(e,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-1kvq7kq"&&(Te.textContent=Un),$t=i(e),ye=p(e,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-zjm5tb"&&(ye.textContent=Bn),vt=i(e),Ie=p(e,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-wgflzu"&&(Ie.innerHTML=zn),wt=i(e),$e=p(e,"P",{"data-svelte-h":!0}),y($e)!=="svelte-1cghrkz"&&($e.innerHTML=Wn),xt=i(e),f(ve.$$.fragment,e),Pt=i(e),f(D.$$.fragment,e),Lt=i(e),f(we.$$.fragment,e),Jt=i(e),w=p(e,"DIV",{class:!0});var k=$(w);f(xe.$$.fragment,k),Rt=i(k),et=p(k,"P",{"data-svelte-h":!0}),y(et)!=="svelte-1lpoiwa"&&(et.innerHTML=Zn),qt=i(k),tt=p(k,"P",{"data-svelte-h":!0}),y(tt)!=="svelte-o55m63"&&(tt.innerHTML=Vn),Xt=i(k),f(O.$$.fragment,k),St=i(k),K=p(k,"DIV",{class:!0});var Se=$(K);f(Pe.$$.fragment,Se),Yt=i(Se),nt=p(Se,"P",{"data-svelte-h":!0}),y(nt)!=="svelte-1gyav3f"&&(nt.innerHTML=Hn),Se.forEach(s),k.forEach(s),At=i(e),f(Le.$$.fragment,e),jt=i(e),J=p(e,"DIV",{class:!0});var H=$(J);f(Je.$$.fragment,H),Dt=i(H),ot=p(H,"P",{"data-svelte-h":!0}),y(ot)!=="svelte-11sydxx"&&(ot.innerHTML=En),Ot=i(H),st=p(H,"P",{"data-svelte-h":!0}),y(st)!=="svelte-o55m63"&&(st.innerHTML=Qn),Kt=i(H),f(ee.$$.fragment,H),H.forEach(s),kt=i(e),f(Ae.$$.fragment,e),Ut=i(e),A=p(e,"DIV",{class:!0});var E=$(A);f(je.$$.fragment,E),en=i(E),at=p(E,"P",{"data-svelte-h":!0}),y(at)!=="svelte-1lpoiwa"&&(at.innerHTML=Gn),tn=i(E),rt=p(E,"P",{"data-svelte-h":!0}),y(rt)!=="svelte-o55m63"&&(rt.innerHTML=Fn),nn=i(E),f(te.$$.fragment,E),E.forEach(s),Bt=i(e),f(ke.$$.fragment,e),zt=i(e),x=p(e,"DIV",{class:!0});var U=$(x);f(Ue.$$.fragment,U),on=i(U),lt=p(U,"P",{"data-svelte-h":!0}),y(lt)!=="svelte-1rdismf"&&(lt.textContent=Nn),sn=i(U),it=p(U,"P",{"data-svelte-h":!0}),y(it)!=="svelte-mhrrv6"&&(it.innerHTML=Rn),an=i(U),ne=p(U,"DIV",{class:!0});var Ye=$(ne);f(Be.$$.fragment,Ye),rn=i(Ye),dt=p(Ye,"P",{"data-svelte-h":!0}),y(dt)!=="svelte-el43ed"&&(dt.innerHTML=qn),Ye.forEach(s),ln=i(U),oe=p(U,"DIV",{class:!0});var De=$(oe);f(ze.$$.fragment,De),dn=i(De),ct=p(De,"P",{"data-svelte-h":!0}),y(ct)!=="svelte-rhkg9r"&&(ct.innerHTML=Xn),De.forEach(s),U.forEach(s),Wt=i(e),f(We.$$.fragment,e),Zt=i(e),j=p(e,"DIV",{class:!0});var Q=$(j);f(Ze.$$.fragment,Q),cn=i(Q),B=p(Q,"DIV",{class:!0});var G=$(B);f(Ve.$$.fragment,G),mn=i(G),mt=p(G,"P",{"data-svelte-h":!0}),y(mt)!=="svelte-ohsxii"&&(mt.innerHTML=Sn),pn=i(G),f(se.$$.fragment,G),gn=i(G),f(ae.$$.fragment,G),G.forEach(s),fn=i(Q),z=p(Q,"DIV",{class:!0});var F=$(z);f(He.$$.fragment,F),un=i(F),pt=p(F,"P",{"data-svelte-h":!0}),y(pt)!=="svelte-ohsxii"&&(pt.innerHTML=Yn),hn=i(F),f(re.$$.fragment,F),_n=i(F),f(le.$$.fragment,F),F.forEach(s),Mn=i(Q),W=p(Q,"DIV",{class:!0});var N=$(W);f(Ee.$$.fragment,N),bn=i(N),gt=p(N,"P",{"data-svelte-h":!0}),y(gt)!=="svelte-ohsxii"&&(gt.innerHTML=Dn),Cn=i(N),f(ie.$$.fragment,N),Tn=i(N),f(de.$$.fragment,N),N.forEach(s),Q.forEach(s),Vt=i(e),f(Qe.$$.fragment,e),Ht=i(e),X=p(e,"DIV",{class:!0});var Oe=$(X);f(Ge.$$.fragment,Oe),yn=i(Oe),Z=p(Oe,"DIV",{class:!0});var R=$(Z);f(Fe.$$.fragment,R),In=i(R),ft=p(R,"P",{"data-svelte-h":!0}),y(ft)!=="svelte-u9s108"&&(ft.innerHTML=On),$n=i(R),f(ce.$$.fragment,R),vn=i(R),f(me.$$.fragment,R),R.forEach(s),Oe.forEach(s),Et=i(e),f(Ne.$$.fragment,e),Qt=i(e),S=p(e,"DIV",{class:!0});var Ke=$(S);f(Re.$$.fragment,Ke),wn=i(Ke),V=p(Ke,"DIV",{class:!0});var fe=$(V);f(qe.$$.fragment,fe),xn=i(fe),ut=p(fe,"P",{"data-svelte-h":!0}),y(ut)!=="svelte-jwxxy2"&&(ut.innerHTML=Kn),Pn=i(fe),f(pe.$$.fragment,fe),Ln=i(fe),f(ge.$$.fragment,fe),fe.forEach(s),Ke.forEach(s),Gt=i(e),f(Xe.$$.fragment,e),Ft=i(e),_t=p(e,"P",{}),$(_t).forEach(s),this.h()},h(){v(n,"name","hf:doc:metadata"),v(n,"content",yo),v(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(S,"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,o){c(document.head,n),d(e,C,o),d(e,a,o),d(e,r,o),u(b,e,o),d(e,t,o),u(T,e,o),d(e,Mt,o),d(e,he,o),d(e,bt,o),d(e,_e,o),d(e,Ct,o),d(e,Me,o),d(e,Tt,o),d(e,be,o),d(e,yt,o),u(Ce,e,o),d(e,It,o),d(e,Te,o),d(e,$t,o),d(e,ye,o),d(e,vt,o),d(e,Ie,o),d(e,wt,o),d(e,$e,o),d(e,xt,o),u(ve,e,o),d(e,Pt,o),u(D,e,o),d(e,Lt,o),u(we,e,o),d(e,Jt,o),d(e,w,o),u(xe,w,null),c(w,Rt),c(w,et),c(w,qt),c(w,tt),c(w,Xt),u(O,w,null),c(w,St),c(w,K),u(Pe,K,null),c(K,Yt),c(K,nt),d(e,At,o),u(Le,e,o),d(e,jt,o),d(e,J,o),u(Je,J,null),c(J,Dt),c(J,ot),c(J,Ot),c(J,st),c(J,Kt),u(ee,J,null),d(e,kt,o),u(Ae,e,o),d(e,Ut,o),d(e,A,o),u(je,A,null),c(A,en),c(A,at),c(A,tn),c(A,rt),c(A,nn),u(te,A,null),d(e,Bt,o),u(ke,e,o),d(e,zt,o),d(e,x,o),u(Ue,x,null),c(x,on),c(x,lt),c(x,sn),c(x,it),c(x,an),c(x,ne),u(Be,ne,null),c(ne,rn),c(ne,dt),c(x,ln),c(x,oe),u(ze,oe,null),c(oe,dn),c(oe,ct),d(e,Wt,o),u(We,e,o),d(e,Zt,o),d(e,j,o),u(Ze,j,null),c(j,cn),c(j,B),u(Ve,B,null),c(B,mn),c(B,mt),c(B,pn),u(se,B,null),c(B,gn),u(ae,B,null),c(j,fn),c(j,z),u(He,z,null),c(z,un),c(z,pt),c(z,hn),u(re,z,null),c(z,_n),u(le,z,null),c(j,Mn),c(j,W),u(Ee,W,null),c(W,bn),c(W,gt),c(W,Cn),u(ie,W,null),c(W,Tn),u(de,W,null),d(e,Vt,o),u(Qe,e,o),d(e,Ht,o),d(e,X,o),u(Ge,X,null),c(X,yn),c(X,Z),u(Fe,Z,null),c(Z,In),c(Z,ft),c(Z,$n),u(ce,Z,null),c(Z,vn),u(me,Z,null),d(e,Et,o),u(Ne,e,o),d(e,Qt,o),d(e,S,o),u(Re,S,null),c(S,wn),c(S,V),u(qe,V,null),c(V,xn),c(V,ut),c(V,Pn),u(pe,V,null),c(V,Ln),u(ge,V,null),d(e,Gt,o),u(Xe,e,o),d(e,Ft,o),d(e,_t,o),Nt=!0},p(e,[o]){const k={};o&2&&(k.$$scope={dirty:o,ctx:e}),D.$set(k);const Se={};o&2&&(Se.$$scope={dirty:o,ctx:e}),O.$set(Se);const H={};o&2&&(H.$$scope={dirty:o,ctx:e}),ee.$set(H);const E={};o&2&&(E.$$scope={dirty:o,ctx:e}),te.$set(E);const U={};o&2&&(U.$$scope={dirty:o,ctx:e}),se.$set(U);const Ye={};o&2&&(Ye.$$scope={dirty:o,ctx:e}),ae.$set(Ye);const De={};o&2&&(De.$$scope={dirty:o,ctx:e}),re.$set(De);const Q={};o&2&&(Q.$$scope={dirty:o,ctx:e}),le.$set(Q);const G={};o&2&&(G.$$scope={dirty:o,ctx:e}),ie.$set(G);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),de.$set(F);const N={};o&2&&(N.$$scope={dirty:o,ctx:e}),ce.$set(N);const Oe={};o&2&&(Oe.$$scope={dirty:o,ctx:e}),me.$set(Oe);const R={};o&2&&(R.$$scope={dirty:o,ctx:e}),pe.$set(R);const Ke={};o&2&&(Ke.$$scope={dirty:o,ctx:e}),ge.$set(Ke)},i(e){Nt||(h(b.$$.fragment,e),h(T.$$.fragment,e),h(Ce.$$.fragment,e),h(ve.$$.fragment,e),h(D.$$.fragment,e),h(we.$$.fragment,e),h(xe.$$.fragment,e),h(O.$$.fragment,e),h(Pe.$$.fragment,e),h(Le.$$.fragment,e),h(Je.$$.fragment,e),h(ee.$$.fragment,e),h(Ae.$$.fragment,e),h(je.$$.fragment,e),h(te.$$.fragment,e),h(ke.$$.fragment,e),h(Ue.$$.fragment,e),h(Be.$$.fragment,e),h(ze.$$.fragment,e),h(We.$$.fragment,e),h(Ze.$$.fragment,e),h(Ve.$$.fragment,e),h(se.$$.fragment,e),h(ae.$$.fragment,e),h(He.$$.fragment,e),h(re.$$.fragment,e),h(le.$$.fragment,e),h(Ee.$$.fragment,e),h(ie.$$.fragment,e),h(de.$$.fragment,e),h(Qe.$$.fragment,e),h(Ge.$$.fragment,e),h(Fe.$$.fragment,e),h(ce.$$.fragment,e),h(me.$$.fragment,e),h(Ne.$$.fragment,e),h(Re.$$.fragment,e),h(qe.$$.fragment,e),h(pe.$$.fragment,e),h(ge.$$.fragment,e),h(Xe.$$.fragment,e),Nt=!0)},o(e){_(b.$$.fragment,e),_(T.$$.fragment,e),_(Ce.$$.fragment,e),_(ve.$$.fragment,e),_(D.$$.fragment,e),_(we.$$.fragment,e),_(xe.$$.fragment,e),_(O.$$.fragment,e),_(Pe.$$.fragment,e),_(Le.$$.fragment,e),_(Je.$$.fragment,e),_(ee.$$.fragment,e),_(Ae.$$.fragment,e),_(je.$$.fragment,e),_(te.$$.fragment,e),_(ke.$$.fragment,e),_(Ue.$$.fragment,e),_(Be.$$.fragment,e),_(ze.$$.fragment,e),_(We.$$.fragment,e),_(Ze.$$.fragment,e),_(Ve.$$.fragment,e),_(se.$$.fragment,e),_(ae.$$.fragment,e),_(He.$$.fragment,e),_(re.$$.fragment,e),_(le.$$.fragment,e),_(Ee.$$.fragment,e),_(ie.$$.fragment,e),_(de.$$.fragment,e),_(Qe.$$.fragment,e),_(Ge.$$.fragment,e),_(Fe.$$.fragment,e),_(ce.$$.fragment,e),_(me.$$.fragment,e),_(Ne.$$.fragment,e),_(Re.$$.fragment,e),_(qe.$$.fragment,e),_(pe.$$.fragment,e),_(ge.$$.fragment,e),_(Xe.$$.fragment,e),Nt=!1},d(e){e&&(s(C),s(a),s(r),s(t),s(Mt),s(he),s(bt),s(_e),s(Ct),s(Me),s(Tt),s(be),s(yt),s(It),s(Te),s($t),s(ye),s(vt),s(Ie),s(wt),s($e),s(xt),s(Pt),s(Lt),s(Jt),s(w),s(At),s(jt),s(J),s(kt),s(Ut),s(A),s(Bt),s(zt),s(x),s(Wt),s(Zt),s(j),s(Vt),s(Ht),s(X),s(Et),s(Qt),s(S),s(Gt),s(Ft),s(_t)),s(n),M(b,e),M(T,e),M(Ce,e),M(ve,e),M(D,e),M(we,e),M(xe),M(O),M(Pe),M(Le,e),M(Je),M(ee),M(Ae,e),M(je),M(te),M(ke,e),M(Ue),M(Be),M(ze),M(We,e),M(Ze),M(Ve),M(se),M(ae),M(He),M(re),M(le),M(Ee),M(ie),M(de),M(Qe,e),M(Ge),M(Fe),M(ce),M(me),M(Ne,e),M(Re),M(qe),M(pe),M(ge),M(Xe,e)}}}const yo='{"title":"AltCLIP","local":"altclip","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips and example","local":"usage-tips-and-example","sections":[],"depth":2},{"title":"AltCLIPConfig","local":"transformers.AltCLIPConfig","sections":[],"depth":2},{"title":"AltCLIPTextConfig","local":"transformers.AltCLIPTextConfig","sections":[],"depth":2},{"title":"AltCLIPVisionConfig","local":"transformers.AltCLIPVisionConfig","sections":[],"depth":2},{"title":"AltCLIPProcessor","local":"transformers.AltCLIPProcessor","sections":[],"depth":2},{"title":"AltCLIPModel","local":"transformers.AltCLIPModel","sections":[],"depth":2},{"title":"AltCLIPTextModel","local":"transformers.AltCLIPTextModel","sections":[],"depth":2},{"title":"AltCLIPVisionModel","local":"transformers.AltCLIPVisionModel","sections":[],"depth":2}],"depth":1}';function Io(I){return to(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ao extends no{constructor(n){super(),oo(this,n,Io,To,eo,{})}}export{Ao as component};
