import{s as Mo,o as yo,n as V}from"../chunks/scheduler.25b97de1.js";import{S as To,i as vo,g as m,s as r,r as g,A as wo,h as p,f as s,c as i,j as k,u as f,x as T,k as x,y as d,a as c,v as h,d as u,t as _,w as b}from"../chunks/index.d9030fc9.js";import{T as wt}from"../chunks/Tip.baa67368.js";import{D as J}from"../chunks/Docstring.e257edda.js";import{C as D}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ue}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as X,E as $o}from"../chunks/EditOnGithub.91d95064.js";function ko(w){let t,M="Example:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsaWduQ29uZmlnJTJDJTIwQWxpZ25Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBBbGlnbkNvbmZpZyUyMHdpdGglMjBrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBBbGlnbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEFsaWduTW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBBbGlnbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZyUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGluaXRpYWxpemUlMjBhJTIwQWxpZ25Db25maWclMjBmcm9tJTIwYSUyMEFsaWduVGV4dENvbmZpZyUyMGFuZCUyMGElMjBBbGlnblZpc2lvbkNvbmZpZyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBbGlnblRleHRDb25maWclMkMlMjBBbGlnblZpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMEFMSUdOJTIwVGV4dCUyMGFuZCUyMFZpc2lvbiUyMGNvbmZpZ3VyYXRpb25zJTBBY29uZmlnX3RleHQlMjAlM0QlMjBBbGlnblRleHRDb25maWcoKSUwQWNvbmZpZ192aXNpb24lMjAlM0QlMjBBbGlnblZpc2lvbkNvbmZpZygpJTBBJTBBY29uZmlnJTIwJTNEJTIwQWxpZ25Db25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AlignConfig, AlignModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AlignConfig with kakaobrain/align-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = AlignConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AlignModel (with random weights) from the kakaobrain/align-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignModel(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 AlignConfig from a AlignTextConfig and a AlignVisionConfig</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AlignTextConfig, AlignVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing ALIGN Text and Vision configurations</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = AlignTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = AlignVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = AlignConfig.from_text_vision_configs(config_text, config_vision)`,wrap:!1}}),{c(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function xo(w){let t,M="Example:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsaWduVGV4dENvbmZpZyUyQyUyMEFsaWduVGV4dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEFsaWduVGV4dENvbmZpZyUyMHdpdGglMjBrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBBbGlnblRleHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBBbGlnblRleHRNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwa2FrYW9icmFpbiUyRmFsaWduLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEFsaWduVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AlignTextConfig, AlignTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AlignTextConfig with kakaobrain/align-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = AlignTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AlignTextModel (with random weights) from the kakaobrain/align-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignTextModel(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(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function Ao(w){let t,M="Example:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsaWduVmlzaW9uQ29uZmlnJTJDJTIwQWxpZ25WaXNpb25Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBBbGlnblZpc2lvbkNvbmZpZyUyMHdpdGglMjBrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBBbGlnblZpc2lvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEFsaWduVmlzaW9uTW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBBbGlnblZpc2lvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AlignVisionConfig, AlignVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AlignVisionConfig with kakaobrain/align-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = AlignVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AlignVisionModel (with random weights) from the kakaobrain/align-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignVisionModel(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(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function jo(w){let t,M;return t=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEFsaWduUHJvY2Vzc29yJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMiUwQXByb2Nlc3NvciUyMCUzRCUyMEFsaWduUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCklMEElMEFwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwaW1hZ2VzJTNEeW91cl9waWxfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjB0ZXh0JTNEJTVCJTIyV2hhdCUyMGlzJTIwdGhhdCUzRiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGltYWdlc19rd2FyZ3MlMjAlM0QlMjAlN0IlMjJjcm9wX3NpemUlMjIlM0ElMjAlN0IlMjJoZWlnaHQlMjIlM0ElMjAyMjQlMkMlMjAlMjJ3aWR0aCUyMiUzQSUyMDIyNCU3RCU3RCUyQyUwQSUyMCUyMCUyMCUyMHRleHRfa3dhcmdzJTIwJTNEJTIwJTdCJTIycGFkZGluZyUyMiUzQSUyMCUyMmRvX25vdF9wYWQlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjBjb21tb25fa3dhcmdzJTIwJTNEJTIwJTdCJTIycmV0dXJuX3RlbnNvcnMlMjIlM0ElMjAlMjJwdCUyMiU3RCUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AlignProcessor
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
model_id = <span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>
processor = AlignProcessor.from_pretrained(model_id)

processor(
    images=your_pil_image,
    text=[<span class="hljs-string">&quot;What is that?&quot;</span>],
    images_kwargs = {<span class="hljs-string">&quot;crop_size&quot;</span>: {<span class="hljs-string">&quot;height&quot;</span>: <span class="hljs-number">224</span>, <span class="hljs-string">&quot;width&quot;</span>: <span class="hljs-number">224</span>}},
    text_kwargs = {<span class="hljs-string">&quot;padding&quot;</span>: <span class="hljs-string">&quot;do_not_pad&quot;</span>},
    common_kwargs = {<span class="hljs-string">&quot;return_tensors&quot;</span>: <span class="hljs-string">&quot;pt&quot;</span>},
)`,wrap:!1}}),{c(){g(t.$$.fragment)},l(a){f(t.$$.fragment,a)},m(a,l){h(t,a,l),M=!0},p:V,i(a){M||(u(t.$$.fragment,a),M=!0)},o(a){_(t.$$.fragment,a),M=!1},d(a){b(t,a)}}}function Co(w){let t,M=`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(){t=m("p"),t.innerHTML=M},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(a,l){c(a,t,l)},p:V,d(a){a&&s(t)}}}function Jo(w){let t,M=`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(){t=m("p"),t.innerHTML=M},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(a,l){c(a,t,l)},p:V,d(a){a&&s(t)}}}function Uo(w){let t,M="Examples:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBbGlnbk1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBBbGlnbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfdGV4dF9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AlignModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignModel.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<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(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-kvfsh7"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function zo(w){let t,M=`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(){t=m("p"),t.innerHTML=M},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(a,l){c(a,t,l)},p:V,d(a){a&&s(t)}}}function Wo(w){let t,M="Examples:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEFsaWduTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEFsaWduTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",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, AlignModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignModel.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&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(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-kvfsh7"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function Zo(w){let t,M=`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(){t=m("p"),t.innerHTML=M},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(a,l){c(a,t,l)},p:V,d(a){a&&s(t)}}}function Io(w){let t,M="Examples:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBbGlnblRleHRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQWxpZ25UZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlZF9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjAoRU9TJTIwdG9rZW4pJTIwc3RhdGVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AlignTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignTextModel.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<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>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 (EOS token) states</span>`,wrap:!1}}),{c(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-kvfsh7"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function Bo(w){let t,M=`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(){t=m("p"),t.innerHTML=M},l(a){t=p(a,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(a,l){c(a,t,l)},p:V,d(a){a&&s(t)}}}function Vo(w){let t,M="Examples:",a,l,y;return l=new D({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEFsaWduVmlzaW9uTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEFsaWduVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmtha2FvYnJhaW4lMkZhbGlnbi1iYXNlJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",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, AlignVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AlignVisionModel.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&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(){t=m("p"),t.textContent=M,a=r(),g(l.$$.fragment)},l(n){t=p(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-kvfsh7"&&(t.textContent=M),a=i(n),f(l.$$.fragment,n)},m(n,v){c(n,t,v),c(n,a,v),h(l,n,v),y=!0},p:V,i(n){y||(u(l.$$.fragment,n),y=!0)},o(n){_(l.$$.fragment,n),y=!1},d(n){n&&(s(t),s(a)),b(l,n)}}}function Go(w){let t,M,a,l,y,n,v,$t,_e,Pn='The ALIGN model was proposed in <a href="https://arxiv.org/abs/2102.05918" rel="nofollow">Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision</a> by Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, Yunhsuan Sung, Zhen Li, Tom Duerig. ALIGN is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image classification. ALIGN features a dual-encoder architecture with <a href="efficientnet">EfficientNet</a> as its vision encoder and <a href="bert">BERT</a> as its text encoder, and learns to align visual and text representations with contrastive learning. Unlike previous work, ALIGN leverages a massive noisy dataset and shows that the scale of the corpus can be used to achieve SOTA representations with a simple recipe.',kt,be,En="The abstract from the paper is the following:",xt,Me,Fn="<em>Pre-trained representations are becoming crucial for many NLP and perception tasks. While representation learning in NLP has transitioned to training on raw text without human annotations, visual and vision-language representations still rely heavily on curated training datasets that are expensive or require expert knowledge. For vision applications, representations are mostly learned using datasets with explicit class labels such as ImageNet or OpenImages. For vision-language, popular datasets like Conceptual Captions, MSCOCO, or CLIP all involve a non-trivial data collection (and cleaning) process. This costly curation process limits the size of datasets and hence hinders the scaling of trained models. In this paper, we leverage a noisy dataset of over one billion image alt-text pairs, obtained without expensive filtering or post-processing steps in the Conceptual Captions dataset. A simple dual-encoder architecture learns to align visual and language representations of the image and text pairs using a contrastive loss. We show that the scale of our corpus can make up for its noise and leads to state-of-the-art representations even with such a simple learning scheme. Our visual representation achieves strong performance when transferred to classification tasks such as ImageNet and VTAB. The aligned visual and language representations enables zero-shot image classification and also set new state-of-the-art results on Flickr30K and MSCOCO image-text retrieval benchmarks, even when compared with more sophisticated cross-attention models. The representations also enable cross-modality search with complex text and text + image queries.</em>",At,ye,Hn=`This model was contributed by <a href="https://huggingface.co/adirik" rel="nofollow">Alara Dirik</a>.
The original code is not released, this implementation is based on the Kakao Brain implementation based on the original paper.`,jt,Te,Ct,ve,Rn="ALIGN uses EfficientNet to get visual features and BERT 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 similarity score.",Jt,we,Yn='<a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignProcessor">AlignProcessor</a> wraps <a href="/docs/transformers/pr_31098/en/model_doc/efficientnet#transformers.EfficientNetImageProcessor">EfficientNetImageProcessor</a> and <a href="/docs/transformers/pr_31098/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a> into a single instance to both encode the text and preprocess the images. The following example shows how to get the image-text similarity scores using <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignProcessor">AlignProcessor</a> and <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignModel">AlignModel</a>.',Ut,$e,zt,ke,Wt,xe,Xn="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with ALIGN.",Zt,Ae,Sn='<li>A blog post on <a href="https://huggingface.co/blog/vit-align" rel="nofollow">ALIGN and the COYO-700M dataset</a>.</li> <li>A zero-shot image classification <a href="https://huggingface.co/spaces/adirik/ALIGN-zero-shot-image-classification" rel="nofollow">demo</a>.</li> <li><a href="https://huggingface.co/kakaobrain/align-base" rel="nofollow">Model card</a> of <code>kakaobrain/align-base</code> model.</li>',It,je,Qn="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it. The resource should ideally demonstrate something new instead of duplicating an existing resource.",Bt,Ce,Vt,A,Je,Kt,tt,Dn=`<a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignConfig">AlignConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignModel">AlignModel</a>. It is used to
instantiate a ALIGN model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the ALIGN
<a href="https://huggingface.co/kakaobrain/align-base" rel="nofollow">kakaobrain/align-base</a> architecture.`,en,nt,On=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/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/pr_31098/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,tn,O,nn,K,Ue,on,ot,Kn=`Instantiate a <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignConfig">AlignConfig</a> (or a derived class) from align text model configuration and align vision model
configuration.`,Gt,ze,Nt,U,We,sn,st,eo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignTextModel">AlignTextModel</a>. It is used to instantiate a
ALIGN text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text encoder of the ALIGN
<a href="https://huggingface.co/kakaobrain/align-base" rel="nofollow">kakaobrain/align-base</a> architecture. The default values here are
copied from BERT.`,an,at,to=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/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/pr_31098/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,rn,ee,Lt,Ze,qt,z,Ie,ln,rt,no=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignVisionModel">AlignVisionModel</a>. It is used to instantiate a
ALIGN vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the ALIGN
<a href="https://huggingface.co/kakaobrain/align-base" rel="nofollow">kakaobrain/align-base</a> architecture. The default values are copied
from EfficientNet (efficientnet-b7)`,dn,it,oo=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/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/pr_31098/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,cn,te,Pt,Be,Et,j,Ve,mn,lt,so=`Constructs an ALIGN processor which wraps <a href="/docs/transformers/pr_31098/en/model_doc/efficientnet#transformers.EfficientNetImageProcessor">EfficientNetImageProcessor</a> and
<a href="/docs/transformers/pr_31098/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>/<a href="/docs/transformers/pr_31098/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a> into a single processor that interits both the image processor and
tokenizer functionalities. See the <code>__call__()</code> and <a href="/docs/transformers/pr_31098/en/model_doc/owlvit#transformers.OwlViTProcessor.decode">decode()</a> for more
information.
The preferred way of passing kwargs is as a dictionary per modality, see usage example below.`,pn,ne,gn,oe,Ge,fn,dt,ao=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/pr_31098/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,hn,se,Ne,un,ct,ro=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/pr_31098/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,Ft,Le,Ht,$,qe,_n,mt,io=`This model inherits from <a href="/docs/transformers/pr_31098/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,bn,pt,lo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Mn,S,Pe,yn,gt,co='The <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignModel">AlignModel</a> forward method, overrides the <code>__call__</code> special method.',Tn,ae,vn,G,Ee,wn,ft,mo='The <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignModel">AlignModel</a> forward method, overrides the <code>__call__</code> special method.',$n,re,kn,ie,xn,N,Fe,An,ht,po='The <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignModel">AlignModel</a> forward method, overrides the <code>__call__</code> special method.',jn,le,Cn,de,Rt,He,Yt,W,Re,Jn,ut,go=`The text model from ALIGN without any head or projection on top.
This model inherits from <a href="/docs/transformers/pr_31098/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Un,_t,fo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,zn,L,Ye,Wn,bt,ho='The <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignTextModel">AlignTextModel</a> forward method, overrides the <code>__call__</code> special method.',Zn,ce,In,me,Xt,Xe,St,Z,Se,Bn,Mt,uo=`The vision model from ALIGN without any head or projection on top.
This model inherits from <a href="/docs/transformers/pr_31098/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Vn,yt,_o=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Gn,q,Qe,Nn,Tt,bo='The <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignVisionModel">AlignVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Ln,pe,qn,ge,Qt,De,Dt,vt,Ot;return y=new X({props:{title:"ALIGN",local:"align",headingTag:"h1"}}),v=new X({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Te=new X({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),$e=new D({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBbGlnblByb2Nlc3NvciUyQyUyMEFsaWduTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBbGlnblByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIya2FrYW9icmFpbiUyRmFsaWduLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBBbGlnbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJrYWthb2JyYWluJTJGYWxpZ24tYmFzZSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBY2FuZGlkYXRlX2xhYmVscyUyMCUzRCUyMCU1QiUyMmFuJTIwaW1hZ2UlMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhbiUyMGltYWdlJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0RjYW5kaWRhdGVfbGFiZWxzJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMEElMEElMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXMlMEFwcm9icyUyMCUzRCUyMGxvZ2l0c19wZXJfaW1hZ2Uuc29mdG1heChkaW0lM0QxKSUwQXByaW50KHByb2JzKQ==",highlighted:`<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AlignProcessor, AlignModel

processor = AlignProcessor.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)
model = AlignModel.from_pretrained(<span class="hljs-string">&quot;kakaobrain/align-base&quot;</span>)

url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
candidate_labels = [<span class="hljs-string">&quot;an image of a cat&quot;</span>, <span class="hljs-string">&quot;an image of a dog&quot;</span>]

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

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = model(**inputs)

<span class="hljs-comment"># this is the image-text similarity score</span>
logits_per_image = outputs.logits_per_image

<span class="hljs-comment"># we can take the softmax to get the label probabilities</span>
probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)
<span class="hljs-built_in">print</span>(probs)`,wrap:!1}}),ke=new X({props:{title:"Resources",local:"resources",headingTag:"h2"}}),Ce=new X({props:{title:"AlignConfig",local:"transformers.AlignConfig",headingTag:"h2"}}),Je=new J({props:{name:"class transformers.AlignConfig",anchor:"transformers.AlignConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 640"},{name:"temperature_init_value",val:" = 1.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AlignConfig.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/pr_31098/en/model_doc/align#transformers.AlignTextConfig">AlignTextConfig</a>.`,name:"text_config"},{anchor:"transformers.AlignConfig.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/pr_31098/en/model_doc/align#transformers.AlignVisionConfig">AlignVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.AlignConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 640) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.AlignConfig.temperature_init_value",description:`<strong>temperature_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The initial value of the <em>temperature</em> parameter. Default is used as per the original ALIGN implementation.`,name:"temperature_init_value"},{anchor:"transformers.AlignConfig.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.AlignConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/configuration_align.py#L294"}}),O=new ue({props:{anchor:"transformers.AlignConfig.example",$$slots:{default:[ko]},$$scope:{ctx:w}}}),Ue=new J({props:{name:"from_text_vision_configs",anchor:"transformers.AlignConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": AlignTextConfig"},{name:"vision_config",val:": AlignVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/configuration_align.py#L370",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/pr_31098/en/model_doc/align#transformers.AlignConfig"
>AlignConfig</a></p>
`}}),ze=new X({props:{title:"AlignTextConfig",local:"transformers.AlignTextConfig",headingTag:"h2"}}),We=new J({props:{name:"class transformers.AlignTextConfig",anchor:"transformers.AlignTextConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{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:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AlignTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the Align Text model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignTextModel">AlignTextModel</a>.`,name:"vocab_size"},{anchor:"transformers.AlignTextConfig.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.AlignTextConfig.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.AlignTextConfig.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.AlignTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.AlignTextConfig.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.AlignTextConfig.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.AlignTextConfig.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.AlignTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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.AlignTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignTextModel">AlignTextModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.AlignTextConfig.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.AlignTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.AlignTextConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.AlignTextConfig.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.AlignTextConfig.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"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/configuration_align.py#L31"}}),ee=new ue({props:{anchor:"transformers.AlignTextConfig.example",$$slots:{default:[xo]},$$scope:{ctx:w}}}),Ze=new X({props:{title:"AlignVisionConfig",local:"transformers.AlignVisionConfig",headingTag:"h2"}}),Ie=new J({props:{name:"class transformers.AlignVisionConfig",anchor:"transformers.AlignVisionConfig",parameters:[{name:"num_channels",val:": int = 3"},{name:"image_size",val:": int = 600"},{name:"width_coefficient",val:": float = 2.0"},{name:"depth_coefficient",val:": float = 3.1"},{name:"depth_divisor",val:": int = 8"},{name:"kernel_sizes",val:": List = [3, 3, 5, 3, 5, 5, 3]"},{name:"in_channels",val:": List = [32, 16, 24, 40, 80, 112, 192]"},{name:"out_channels",val:": List = [16, 24, 40, 80, 112, 192, 320]"},{name:"depthwise_padding",val:": List = []"},{name:"strides",val:": List = [1, 2, 2, 2, 1, 2, 1]"},{name:"num_block_repeats",val:": List = [1, 2, 2, 3, 3, 4, 1]"},{name:"expand_ratios",val:": List = [1, 6, 6, 6, 6, 6, 6]"},{name:"squeeze_expansion_ratio",val:": float = 0.25"},{name:"hidden_act",val:": str = 'swish'"},{name:"hidden_dim",val:": int = 2560"},{name:"pooling_type",val:": str = 'mean'"},{name:"initializer_range",val:": float = 0.02"},{name:"batch_norm_eps",val:": float = 0.001"},{name:"batch_norm_momentum",val:": float = 0.99"},{name:"drop_connect_rate",val:": float = 0.2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AlignVisionConfig.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.AlignVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 600) &#x2014;
The input image size.`,name:"image_size"},{anchor:"transformers.AlignVisionConfig.width_coefficient",description:`<strong>width_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
Scaling coefficient for network width at each stage.`,name:"width_coefficient"},{anchor:"transformers.AlignVisionConfig.depth_coefficient",description:`<strong>depth_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 3.1) &#x2014;
Scaling coefficient for network depth at each stage.`,name:"depth_coefficient"},{anchor:"transformers.AlignVisionConfig.depth_divisor",description:`<strong>depth_divisor</strong> <code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
A unit of network width.`,name:"depth_divisor"},{anchor:"transformers.AlignVisionConfig.kernel_sizes",description:`<strong>kernel_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 5, 3, 5, 5, 3]</code>) &#x2014;
List of kernel sizes to be used in each block.`,name:"kernel_sizes"},{anchor:"transformers.AlignVisionConfig.in_channels",description:`<strong>in_channels</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[32, 16, 24, 40, 80, 112, 192]</code>) &#x2014;
List of input channel sizes to be used in each block for convolutional layers.`,name:"in_channels"},{anchor:"transformers.AlignVisionConfig.out_channels",description:`<strong>out_channels</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[16, 24, 40, 80, 112, 192, 320]</code>) &#x2014;
List of output channel sizes to be used in each block for convolutional layers.`,name:"out_channels"},{anchor:"transformers.AlignVisionConfig.depthwise_padding",description:`<strong>depthwise_padding</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
List of block indices with square padding.`,name:"depthwise_padding"},{anchor:"transformers.AlignVisionConfig.strides",description:`<strong>strides</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 2, 2, 1, 2, 1]</code>) &#x2014;
List of stride sizes to be used in each block for convolutional layers.`,name:"strides"},{anchor:"transformers.AlignVisionConfig.num_block_repeats",description:`<strong>num_block_repeats</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 2, 3, 3, 4, 1]</code>) &#x2014;
List of the number of times each block is to repeated.`,name:"num_block_repeats"},{anchor:"transformers.AlignVisionConfig.expand_ratios",description:`<strong>expand_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 6, 6, 6, 6, 6, 6]</code>) &#x2014;
List of scaling coefficient of each block.`,name:"expand_ratios"},{anchor:"transformers.AlignVisionConfig.squeeze_expansion_ratio",description:`<strong>squeeze_expansion_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.25) &#x2014;
Squeeze expansion ratio.`,name:"squeeze_expansion_ratio"},{anchor:"transformers.AlignVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in each block. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;selu&quot;, </code>&#x201C;gelu_new&#x201D;<code>, </code>&#x201C;silu&#x201D;<code>and</code>&#x201C;mish&#x201D;\` are supported.`,name:"hidden_act"},{anchor:"transformers.AlignVisionConfig.hidden_dim",description:`<strong>hidden_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 1280) &#x2014;
The hidden dimension of the layer before the classification head.`,name:"hidden_dim"},{anchor:"transformers.AlignVisionConfig.pooling_type",description:`<strong>pooling_type</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;mean&quot;</code>) &#x2014;
Type of final pooling to be applied before the dense classification head. Available options are [<code>&quot;mean&quot;</code>,
<code>&quot;max&quot;</code>]`,name:"pooling_type"},{anchor:"transformers.AlignVisionConfig.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.AlignVisionConfig.batch_norm_eps",description:`<strong>batch_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-3) &#x2014;
The epsilon used by the batch normalization layers.`,name:"batch_norm_eps"},{anchor:"transformers.AlignVisionConfig.batch_norm_momentum",description:`<strong>batch_norm_momentum</strong> (<code>float</code>, <em>optional</em>, defaults to 0.99) &#x2014;
The momentum used by the batch normalization layers.`,name:"batch_norm_momentum"},{anchor:"transformers.AlignVisionConfig.drop_connect_rate",description:`<strong>drop_connect_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.2) &#x2014;
The drop rate for skip connections.`,name:"drop_connect_rate"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/configuration_align.py#L155"}}),te=new ue({props:{anchor:"transformers.AlignVisionConfig.example",$$slots:{default:[Ao]},$$scope:{ctx:w}}}),Be=new X({props:{title:"AlignProcessor",local:"transformers.AlignProcessor",headingTag:"h2"}}),Ve=new J({props:{name:"class transformers.AlignProcessor",anchor:"transformers.AlignProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.AlignProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/efficientnet#transformers.EfficientNetImageProcessor">EfficientNetImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.AlignProcessor.tokenizer",description:`<strong>tokenizer</strong> ([<code>BertTokenizer</code>, <code>BertTokenizerFast</code>]) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/processing_align.py#L45"}}),ne=new ue({props:{anchor:"transformers.AlignProcessor.example",$$slots:{default:[jo]},$$scope:{ctx:w}}}),Ge=new J({props:{name:"batch_decode",anchor:"transformers.AlignProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/processing_align.py#L146"}}),Ne=new J({props:{name:"decode",anchor:"transformers.AlignProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/processing_align.py#L153"}}),Le=new X({props:{title:"AlignModel",local:"transformers.AlignModel",headingTag:"h2"}}),qe=new J({props:{name:"class transformers.AlignModel",anchor:"transformers.AlignModel",parameters:[{name:"config",val:": AlignConfig"}],parametersDescription:[{anchor:"transformers.AlignModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignConfig">AlignConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_31098/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1413"}}),Pe=new J({props:{name:"forward",anchor:"transformers.AlignModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"pixel_values",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"return_loss",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.AlignModel.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/pr_31098/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31098/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31098/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>
attention_mask (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>
position_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
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>
token_type_ids (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>):
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>
head_mask (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>):
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>
<p>inputs_embeds (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>):
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.
pixel_values (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>):
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_31098/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31098/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">EfficientNetImageProcessor.<strong>call</strong>()</a> for details.
return_loss (<code>bool</code>, <em>optional</em>):
Whether or not to return the contrastive loss.
output_attentions (<code>bool</code>, <em>optional</em>):
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.
output_hidden_states (<code>bool</code>, <em>optional</em>):
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.
return_dict (<code>bool</code>, <em>optional</em>):
Whether or not to return a <a href="/docs/transformers/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1545"}}),ae=new wt({props:{$$slots:{default:[Co]},$$scope:{ctx:w}}}),Ee=new J({props:{name:"get_text_features",anchor:"transformers.AlignModel.get_text_features",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.AlignModel.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/pr_31098/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31098/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31098/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.AlignModel.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.AlignModel.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.AlignModel.get_text_features.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.AlignModel.get_text_features.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.AlignModel.get_text_features.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.AlignModel.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.AlignModel.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.AlignModel.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1447",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/pr_31098/en/model_doc/align#transformers.AlignTextModel"
>AlignTextModel</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 wt({props:{$$slots:{default:[Jo]},$$scope:{ctx:w}}}),ie=new ue({props:{anchor:"transformers.AlignModel.get_text_features.example",$$slots:{default:[Uo]},$$scope:{ctx:w}}}),Fe=new J({props:{name:"get_image_features",anchor:"transformers.AlignModel.get_image_features",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.AlignModel.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/pr_31098/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31098/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">EfficientNetImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.AlignModel.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.AlignModel.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1500",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/pr_31098/en/model_doc/align#transformers.AlignVisionModel"
>AlignVisionModel</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>
`}}),le=new wt({props:{$$slots:{default:[zo]},$$scope:{ctx:w}}}),de=new ue({props:{anchor:"transformers.AlignModel.get_image_features.example",$$slots:{default:[Wo]},$$scope:{ctx:w}}}),He=new X({props:{title:"AlignTextModel",local:"transformers.AlignTextModel",headingTag:"h2"}}),Re=new J({props:{name:"class transformers.AlignTextModel",anchor:"transformers.AlignTextModel",parameters:[{name:"config",val:": AlignTextConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.AlignTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignConfig">AlignConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_31098/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1197"}}),Ye=new J({props:{name:"forward",anchor:"transformers.AlignTextModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"token_type_ids",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.AlignTextModel.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/pr_31098/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31098/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31098/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.AlignTextModel.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.AlignTextModel.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.AlignTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.AlignTextModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.AlignTextModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.AlignTextModel.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.AlignTextModel.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.AlignTextModel.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1223",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31098/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</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.align.configuration_align.AlignTextConfig'&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>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=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 of the decoder’s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31098/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new wt({props:{$$slots:{default:[Zo]},$$scope:{ctx:w}}}),me=new ue({props:{anchor:"transformers.AlignTextModel.forward.example",$$slots:{default:[Io]},$$scope:{ctx:w}}}),Xe=new X({props:{title:"AlignVisionModel",local:"transformers.AlignVisionModel",headingTag:"h2"}}),Se=new J({props:{name:"class transformers.AlignVisionModel",anchor:"transformers.AlignVisionModel",parameters:[{name:"config",val:": AlignVisionConfig"}],parametersDescription:[{anchor:"transformers.AlignVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31098/en/model_doc/align#transformers.AlignConfig">AlignConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_31098/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1324"}}),Qe=new J({props:{name:"forward",anchor:"transformers.AlignVisionModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.AlignVisionModel.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/pr_31098/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31098/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">EfficientNetImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.AlignVisionModel.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.AlignVisionModel.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/pr_31098/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/align/modeling_align.py#L1353",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</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.align.configuration_align.AlignVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</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 after a pooling operation on the spatial dimensions.</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, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new wt({props:{$$slots:{default:[Bo]},$$scope:{ctx:w}}}),ge=new ue({props:{anchor:"transformers.AlignVisionModel.forward.example",$$slots:{default:[Vo]},$$scope:{ctx:w}}}),De=new $o({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/align.md"}}),{c(){t=m("meta"),M=r(),a=m("p"),l=r(),g(y.$$.fragment),n=r(),g(v.$$.fragment),$t=r(),_e=m("p"),_e.innerHTML=Pn,kt=r(),be=m("p"),be.textContent=En,xt=r(),Me=m("p"),Me.innerHTML=Fn,At=r(),ye=m("p"),ye.innerHTML=Hn,jt=r(),g(Te.$$.fragment),Ct=r(),ve=m("p"),ve.textContent=Rn,Jt=r(),we=m("p"),we.innerHTML=Yn,Ut=r(),g($e.$$.fragment),zt=r(),g(ke.$$.fragment),Wt=r(),xe=m("p"),xe.textContent=Xn,Zt=r(),Ae=m("ul"),Ae.innerHTML=Sn,It=r(),je=m("p"),je.textContent=Qn,Bt=r(),g(Ce.$$.fragment),Vt=r(),A=m("div"),g(Je.$$.fragment),Kt=r(),tt=m("p"),tt.innerHTML=Dn,en=r(),nt=m("p"),nt.innerHTML=On,tn=r(),g(O.$$.fragment),nn=r(),K=m("div"),g(Ue.$$.fragment),on=r(),ot=m("p"),ot.innerHTML=Kn,Gt=r(),g(ze.$$.fragment),Nt=r(),U=m("div"),g(We.$$.fragment),sn=r(),st=m("p"),st.innerHTML=eo,an=r(),at=m("p"),at.innerHTML=to,rn=r(),g(ee.$$.fragment),Lt=r(),g(Ze.$$.fragment),qt=r(),z=m("div"),g(Ie.$$.fragment),ln=r(),rt=m("p"),rt.innerHTML=no,dn=r(),it=m("p"),it.innerHTML=oo,cn=r(),g(te.$$.fragment),Pt=r(),g(Be.$$.fragment),Et=r(),j=m("div"),g(Ve.$$.fragment),mn=r(),lt=m("p"),lt.innerHTML=so,pn=r(),g(ne.$$.fragment),gn=r(),oe=m("div"),g(Ge.$$.fragment),fn=r(),dt=m("p"),dt.innerHTML=ao,hn=r(),se=m("div"),g(Ne.$$.fragment),un=r(),ct=m("p"),ct.innerHTML=ro,Ft=r(),g(Le.$$.fragment),Ht=r(),$=m("div"),g(qe.$$.fragment),_n=r(),mt=m("p"),mt.innerHTML=io,bn=r(),pt=m("p"),pt.innerHTML=lo,Mn=r(),S=m("div"),g(Pe.$$.fragment),yn=r(),gt=m("p"),gt.innerHTML=co,Tn=r(),g(ae.$$.fragment),vn=r(),G=m("div"),g(Ee.$$.fragment),wn=r(),ft=m("p"),ft.innerHTML=mo,$n=r(),g(re.$$.fragment),kn=r(),g(ie.$$.fragment),xn=r(),N=m("div"),g(Fe.$$.fragment),An=r(),ht=m("p"),ht.innerHTML=po,jn=r(),g(le.$$.fragment),Cn=r(),g(de.$$.fragment),Rt=r(),g(He.$$.fragment),Yt=r(),W=m("div"),g(Re.$$.fragment),Jn=r(),ut=m("p"),ut.innerHTML=go,Un=r(),_t=m("p"),_t.innerHTML=fo,zn=r(),L=m("div"),g(Ye.$$.fragment),Wn=r(),bt=m("p"),bt.innerHTML=ho,Zn=r(),g(ce.$$.fragment),In=r(),g(me.$$.fragment),Xt=r(),g(Xe.$$.fragment),St=r(),Z=m("div"),g(Se.$$.fragment),Bn=r(),Mt=m("p"),Mt.innerHTML=uo,Vn=r(),yt=m("p"),yt.innerHTML=_o,Gn=r(),q=m("div"),g(Qe.$$.fragment),Nn=r(),Tt=m("p"),Tt.innerHTML=bo,Ln=r(),g(pe.$$.fragment),qn=r(),g(ge.$$.fragment),Qt=r(),g(De.$$.fragment),Dt=r(),vt=m("p"),this.h()},l(e){const o=wo("svelte-u9bgzb",document.head);t=p(o,"META",{name:!0,content:!0}),o.forEach(s),M=i(e),a=p(e,"P",{}),k(a).forEach(s),l=i(e),f(y.$$.fragment,e),n=i(e),f(v.$$.fragment,e),$t=i(e),_e=p(e,"P",{"data-svelte-h":!0}),T(_e)!=="svelte-e7xpmt"&&(_e.innerHTML=Pn),kt=i(e),be=p(e,"P",{"data-svelte-h":!0}),T(be)!=="svelte-vfdo9a"&&(be.textContent=En),xt=i(e),Me=p(e,"P",{"data-svelte-h":!0}),T(Me)!=="svelte-747a1b"&&(Me.innerHTML=Fn),At=i(e),ye=p(e,"P",{"data-svelte-h":!0}),T(ye)!=="svelte-1cbw7oq"&&(ye.innerHTML=Hn),jt=i(e),f(Te.$$.fragment,e),Ct=i(e),ve=p(e,"P",{"data-svelte-h":!0}),T(ve)!=="svelte-fvtg6e"&&(ve.textContent=Rn),Jt=i(e),we=p(e,"P",{"data-svelte-h":!0}),T(we)!=="svelte-t19iue"&&(we.innerHTML=Yn),Ut=i(e),f($e.$$.fragment,e),zt=i(e),f(ke.$$.fragment,e),Wt=i(e),xe=p(e,"P",{"data-svelte-h":!0}),T(xe)!=="svelte-y2rm4c"&&(xe.textContent=Xn),Zt=i(e),Ae=p(e,"UL",{"data-svelte-h":!0}),T(Ae)!=="svelte-1sk2kf"&&(Ae.innerHTML=Sn),It=i(e),je=p(e,"P",{"data-svelte-h":!0}),T(je)!=="svelte-19bu04q"&&(je.textContent=Qn),Bt=i(e),f(Ce.$$.fragment,e),Vt=i(e),A=p(e,"DIV",{class:!0});var I=k(A);f(Je.$$.fragment,I),Kt=i(I),tt=p(I,"P",{"data-svelte-h":!0}),T(tt)!=="svelte-1x6mn15"&&(tt.innerHTML=Dn),en=i(I),nt=p(I,"P",{"data-svelte-h":!0}),T(nt)!=="svelte-1eopo2z"&&(nt.innerHTML=On),tn=i(I),f(O.$$.fragment,I),nn=i(I),K=p(I,"DIV",{class:!0});var Oe=k(K);f(Ue.$$.fragment,Oe),on=i(Oe),ot=p(Oe,"P",{"data-svelte-h":!0}),T(ot)!=="svelte-8t577k"&&(ot.innerHTML=Kn),Oe.forEach(s),I.forEach(s),Gt=i(e),f(ze.$$.fragment,e),Nt=i(e),U=p(e,"DIV",{class:!0});var P=k(U);f(We.$$.fragment,P),sn=i(P),st=p(P,"P",{"data-svelte-h":!0}),T(st)!=="svelte-1ge5d6r"&&(st.innerHTML=eo),an=i(P),at=p(P,"P",{"data-svelte-h":!0}),T(at)!=="svelte-1eopo2z"&&(at.innerHTML=to),rn=i(P),f(ee.$$.fragment,P),P.forEach(s),Lt=i(e),f(Ze.$$.fragment,e),qt=i(e),z=p(e,"DIV",{class:!0});var E=k(z);f(Ie.$$.fragment,E),ln=i(E),rt=p(E,"P",{"data-svelte-h":!0}),T(rt)!=="svelte-1h3u7h7"&&(rt.innerHTML=no),dn=i(E),it=p(E,"P",{"data-svelte-h":!0}),T(it)!=="svelte-1eopo2z"&&(it.innerHTML=oo),cn=i(E),f(te.$$.fragment,E),E.forEach(s),Pt=i(e),f(Be.$$.fragment,e),Et=i(e),j=p(e,"DIV",{class:!0});var B=k(j);f(Ve.$$.fragment,B),mn=i(B),lt=p(B,"P",{"data-svelte-h":!0}),T(lt)!=="svelte-12tu0ro"&&(lt.innerHTML=so),pn=i(B),f(ne.$$.fragment,B),gn=i(B),oe=p(B,"DIV",{class:!0});var Ke=k(oe);f(Ge.$$.fragment,Ke),fn=i(Ke),dt=p(Ke,"P",{"data-svelte-h":!0}),T(dt)!=="svelte-1iw9bpt"&&(dt.innerHTML=ao),Ke.forEach(s),hn=i(B),se=p(B,"DIV",{class:!0});var et=k(se);f(Ne.$$.fragment,et),un=i(et),ct=p(et,"P",{"data-svelte-h":!0}),T(ct)!=="svelte-w5fgdz"&&(ct.innerHTML=ro),et.forEach(s),B.forEach(s),Ft=i(e),f(Le.$$.fragment,e),Ht=i(e),$=p(e,"DIV",{class:!0});var C=k($);f(qe.$$.fragment,C),_n=i(C),mt=p(C,"P",{"data-svelte-h":!0}),T(mt)!=="svelte-1b312h9"&&(mt.innerHTML=io),bn=i(C),pt=p(C,"P",{"data-svelte-h":!0}),T(pt)!=="svelte-hswkmf"&&(pt.innerHTML=lo),Mn=i(C),S=p(C,"DIV",{class:!0});var Q=k(S);f(Pe.$$.fragment,Q),yn=i(Q),gt=p(Q,"P",{"data-svelte-h":!0}),T(gt)!=="svelte-jz6ku1"&&(gt.innerHTML=co),Tn=i(Q),f(ae.$$.fragment,Q),Q.forEach(s),vn=i(C),G=p(C,"DIV",{class:!0});var F=k(G);f(Ee.$$.fragment,F),wn=i(F),ft=p(F,"P",{"data-svelte-h":!0}),T(ft)!=="svelte-jz6ku1"&&(ft.innerHTML=mo),$n=i(F),f(re.$$.fragment,F),kn=i(F),f(ie.$$.fragment,F),F.forEach(s),xn=i(C),N=p(C,"DIV",{class:!0});var H=k(N);f(Fe.$$.fragment,H),An=i(H),ht=p(H,"P",{"data-svelte-h":!0}),T(ht)!=="svelte-jz6ku1"&&(ht.innerHTML=po),jn=i(H),f(le.$$.fragment,H),Cn=i(H),f(de.$$.fragment,H),H.forEach(s),C.forEach(s),Rt=i(e),f(He.$$.fragment,e),Yt=i(e),W=p(e,"DIV",{class:!0});var R=k(W);f(Re.$$.fragment,R),Jn=i(R),ut=p(R,"P",{"data-svelte-h":!0}),T(ut)!=="svelte-qmzw9v"&&(ut.innerHTML=go),Un=i(R),_t=p(R,"P",{"data-svelte-h":!0}),T(_t)!=="svelte-hswkmf"&&(_t.innerHTML=fo),zn=i(R),L=p(R,"DIV",{class:!0});var Y=k(L);f(Ye.$$.fragment,Y),Wn=i(Y),bt=p(Y,"P",{"data-svelte-h":!0}),T(bt)!=="svelte-19mgrw3"&&(bt.innerHTML=ho),Zn=i(Y),f(ce.$$.fragment,Y),In=i(Y),f(me.$$.fragment,Y),Y.forEach(s),R.forEach(s),Xt=i(e),f(Xe.$$.fragment,e),St=i(e),Z=p(e,"DIV",{class:!0});var fe=k(Z);f(Se.$$.fragment,fe),Bn=i(fe),Mt=p(fe,"P",{"data-svelte-h":!0}),T(Mt)!=="svelte-qqqv9i"&&(Mt.innerHTML=uo),Vn=i(fe),yt=p(fe,"P",{"data-svelte-h":!0}),T(yt)!=="svelte-hswkmf"&&(yt.innerHTML=_o),Gn=i(fe),q=p(fe,"DIV",{class:!0});var he=k(q);f(Qe.$$.fragment,he),Nn=i(he),Tt=p(he,"P",{"data-svelte-h":!0}),T(Tt)!=="svelte-y39otl"&&(Tt.innerHTML=bo),Ln=i(he),f(pe.$$.fragment,he),qn=i(he),f(ge.$$.fragment,he),he.forEach(s),fe.forEach(s),Qt=i(e),f(De.$$.fragment,e),Dt=i(e),vt=p(e,"P",{}),k(vt).forEach(s),this.h()},h(){x(t,"name","hf:doc:metadata"),x(t,"content",No),x(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Z,"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){d(document.head,t),c(e,M,o),c(e,a,o),c(e,l,o),h(y,e,o),c(e,n,o),h(v,e,o),c(e,$t,o),c(e,_e,o),c(e,kt,o),c(e,be,o),c(e,xt,o),c(e,Me,o),c(e,At,o),c(e,ye,o),c(e,jt,o),h(Te,e,o),c(e,Ct,o),c(e,ve,o),c(e,Jt,o),c(e,we,o),c(e,Ut,o),h($e,e,o),c(e,zt,o),h(ke,e,o),c(e,Wt,o),c(e,xe,o),c(e,Zt,o),c(e,Ae,o),c(e,It,o),c(e,je,o),c(e,Bt,o),h(Ce,e,o),c(e,Vt,o),c(e,A,o),h(Je,A,null),d(A,Kt),d(A,tt),d(A,en),d(A,nt),d(A,tn),h(O,A,null),d(A,nn),d(A,K),h(Ue,K,null),d(K,on),d(K,ot),c(e,Gt,o),h(ze,e,o),c(e,Nt,o),c(e,U,o),h(We,U,null),d(U,sn),d(U,st),d(U,an),d(U,at),d(U,rn),h(ee,U,null),c(e,Lt,o),h(Ze,e,o),c(e,qt,o),c(e,z,o),h(Ie,z,null),d(z,ln),d(z,rt),d(z,dn),d(z,it),d(z,cn),h(te,z,null),c(e,Pt,o),h(Be,e,o),c(e,Et,o),c(e,j,o),h(Ve,j,null),d(j,mn),d(j,lt),d(j,pn),h(ne,j,null),d(j,gn),d(j,oe),h(Ge,oe,null),d(oe,fn),d(oe,dt),d(j,hn),d(j,se),h(Ne,se,null),d(se,un),d(se,ct),c(e,Ft,o),h(Le,e,o),c(e,Ht,o),c(e,$,o),h(qe,$,null),d($,_n),d($,mt),d($,bn),d($,pt),d($,Mn),d($,S),h(Pe,S,null),d(S,yn),d(S,gt),d(S,Tn),h(ae,S,null),d($,vn),d($,G),h(Ee,G,null),d(G,wn),d(G,ft),d(G,$n),h(re,G,null),d(G,kn),h(ie,G,null),d($,xn),d($,N),h(Fe,N,null),d(N,An),d(N,ht),d(N,jn),h(le,N,null),d(N,Cn),h(de,N,null),c(e,Rt,o),h(He,e,o),c(e,Yt,o),c(e,W,o),h(Re,W,null),d(W,Jn),d(W,ut),d(W,Un),d(W,_t),d(W,zn),d(W,L),h(Ye,L,null),d(L,Wn),d(L,bt),d(L,Zn),h(ce,L,null),d(L,In),h(me,L,null),c(e,Xt,o),h(Xe,e,o),c(e,St,o),c(e,Z,o),h(Se,Z,null),d(Z,Bn),d(Z,Mt),d(Z,Vn),d(Z,yt),d(Z,Gn),d(Z,q),h(Qe,q,null),d(q,Nn),d(q,Tt),d(q,Ln),h(pe,q,null),d(q,qn),h(ge,q,null),c(e,Qt,o),h(De,e,o),c(e,Dt,o),c(e,vt,o),Ot=!0},p(e,[o]){const I={};o&2&&(I.$$scope={dirty:o,ctx:e}),O.$set(I);const Oe={};o&2&&(Oe.$$scope={dirty:o,ctx:e}),ee.$set(Oe);const P={};o&2&&(P.$$scope={dirty:o,ctx:e}),te.$set(P);const E={};o&2&&(E.$$scope={dirty:o,ctx:e}),ne.$set(E);const B={};o&2&&(B.$$scope={dirty:o,ctx:e}),ae.$set(B);const Ke={};o&2&&(Ke.$$scope={dirty:o,ctx:e}),re.$set(Ke);const et={};o&2&&(et.$$scope={dirty:o,ctx:e}),ie.$set(et);const C={};o&2&&(C.$$scope={dirty:o,ctx:e}),le.$set(C);const Q={};o&2&&(Q.$$scope={dirty:o,ctx:e}),de.$set(Q);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),ce.$set(F);const H={};o&2&&(H.$$scope={dirty:o,ctx:e}),me.$set(H);const R={};o&2&&(R.$$scope={dirty:o,ctx:e}),pe.$set(R);const Y={};o&2&&(Y.$$scope={dirty:o,ctx:e}),ge.$set(Y)},i(e){Ot||(u(y.$$.fragment,e),u(v.$$.fragment,e),u(Te.$$.fragment,e),u($e.$$.fragment,e),u(ke.$$.fragment,e),u(Ce.$$.fragment,e),u(Je.$$.fragment,e),u(O.$$.fragment,e),u(Ue.$$.fragment,e),u(ze.$$.fragment,e),u(We.$$.fragment,e),u(ee.$$.fragment,e),u(Ze.$$.fragment,e),u(Ie.$$.fragment,e),u(te.$$.fragment,e),u(Be.$$.fragment,e),u(Ve.$$.fragment,e),u(ne.$$.fragment,e),u(Ge.$$.fragment,e),u(Ne.$$.fragment,e),u(Le.$$.fragment,e),u(qe.$$.fragment,e),u(Pe.$$.fragment,e),u(ae.$$.fragment,e),u(Ee.$$.fragment,e),u(re.$$.fragment,e),u(ie.$$.fragment,e),u(Fe.$$.fragment,e),u(le.$$.fragment,e),u(de.$$.fragment,e),u(He.$$.fragment,e),u(Re.$$.fragment,e),u(Ye.$$.fragment,e),u(ce.$$.fragment,e),u(me.$$.fragment,e),u(Xe.$$.fragment,e),u(Se.$$.fragment,e),u(Qe.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(De.$$.fragment,e),Ot=!0)},o(e){_(y.$$.fragment,e),_(v.$$.fragment,e),_(Te.$$.fragment,e),_($e.$$.fragment,e),_(ke.$$.fragment,e),_(Ce.$$.fragment,e),_(Je.$$.fragment,e),_(O.$$.fragment,e),_(Ue.$$.fragment,e),_(ze.$$.fragment,e),_(We.$$.fragment,e),_(ee.$$.fragment,e),_(Ze.$$.fragment,e),_(Ie.$$.fragment,e),_(te.$$.fragment,e),_(Be.$$.fragment,e),_(Ve.$$.fragment,e),_(ne.$$.fragment,e),_(Ge.$$.fragment,e),_(Ne.$$.fragment,e),_(Le.$$.fragment,e),_(qe.$$.fragment,e),_(Pe.$$.fragment,e),_(ae.$$.fragment,e),_(Ee.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(Fe.$$.fragment,e),_(le.$$.fragment,e),_(de.$$.fragment,e),_(He.$$.fragment,e),_(Re.$$.fragment,e),_(Ye.$$.fragment,e),_(ce.$$.fragment,e),_(me.$$.fragment,e),_(Xe.$$.fragment,e),_(Se.$$.fragment,e),_(Qe.$$.fragment,e),_(pe.$$.fragment,e),_(ge.$$.fragment,e),_(De.$$.fragment,e),Ot=!1},d(e){e&&(s(M),s(a),s(l),s(n),s($t),s(_e),s(kt),s(be),s(xt),s(Me),s(At),s(ye),s(jt),s(Ct),s(ve),s(Jt),s(we),s(Ut),s(zt),s(Wt),s(xe),s(Zt),s(Ae),s(It),s(je),s(Bt),s(Vt),s(A),s(Gt),s(Nt),s(U),s(Lt),s(qt),s(z),s(Pt),s(Et),s(j),s(Ft),s(Ht),s($),s(Rt),s(Yt),s(W),s(Xt),s(St),s(Z),s(Qt),s(Dt),s(vt)),s(t),b(y,e),b(v,e),b(Te,e),b($e,e),b(ke,e),b(Ce,e),b(Je),b(O),b(Ue),b(ze,e),b(We),b(ee),b(Ze,e),b(Ie),b(te),b(Be,e),b(Ve),b(ne),b(Ge),b(Ne),b(Le,e),b(qe),b(Pe),b(ae),b(Ee),b(re),b(ie),b(Fe),b(le),b(de),b(He,e),b(Re),b(Ye),b(ce),b(me),b(Xe,e),b(Se),b(Qe),b(pe),b(ge),b(De,e)}}}const No='{"title":"ALIGN","local":"align","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"AlignConfig","local":"transformers.AlignConfig","sections":[],"depth":2},{"title":"AlignTextConfig","local":"transformers.AlignTextConfig","sections":[],"depth":2},{"title":"AlignVisionConfig","local":"transformers.AlignVisionConfig","sections":[],"depth":2},{"title":"AlignProcessor","local":"transformers.AlignProcessor","sections":[],"depth":2},{"title":"AlignModel","local":"transformers.AlignModel","sections":[],"depth":2},{"title":"AlignTextModel","local":"transformers.AlignTextModel","sections":[],"depth":2},{"title":"AlignVisionModel","local":"transformers.AlignVisionModel","sections":[],"depth":2}],"depth":1}';function Lo(w){return yo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xo extends To{constructor(t){super(),vo(this,t,Lo,Go,Mo,{})}}export{Xo as component};
