import{S as Vd,i as Od,s as Dd,e as s,k as f,w as A,t as n,M as Sd,c as r,d as o,m as p,a as i,x as $,h as a,b as d,G as e,g as _,y as k,q as w,o as y,B as T,v as Fd,L as Xt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Nn}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as et}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Qt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Bd(x){let c,b,u,m,v;return m=new et({props:{code:`from transformers import AlignConfig, AlignModel

# Initializing a AlignConfig with kakaobrain/align-base style configuration
configuration = AlignConfig()

# Initializing a AlignModel (with random weights) from the kakaobrain/align-base style configuration
model = AlignModel(configuration)

# Accessing the model configuration
configuration = model.config

# We can also initialize a AlignConfig from a AlignTextConfig and a AlignVisionConfig
from transformers import AlignTextConfig, AlignVisionConfig

# Initializing ALIGN Text and Vision configurations
config_text = AlignTextConfig()
config_vision = AlignVisionConfig()

config = AlignConfig.from_text_vision_configs(config_text, config_vision)`,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)`}}),{c(){c=s("p"),b=n("Example:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Example:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function Wd(x){let c,b,u,m,v;return m=new et({props:{code:`from transformers import AlignTextConfig, AlignTextModel

# Initializing a AlignTextConfig with kakaobrain/align-base style configuration
configuration = AlignTextConfig()

# Initializing a AlignTextModel (with random weights) from the kakaobrain/align-base style configuration
model = AlignTextModel(configuration)

# Accessing the model configuration
configuration = model.config`,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`}}),{c(){c=s("p"),b=n("Example:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Example:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function Gd(x){let c,b,u,m,v;return m=new et({props:{code:`from transformers import AlignVisionConfig, AlignVisionModel

# Initializing a AlignVisionConfig with kakaobrain/align-base style configuration
configuration = AlignVisionConfig()

# Initializing a AlignVisionModel (with random weights) from the kakaobrain/align-base style configuration
model = AlignVisionModel(configuration)

# Accessing the model configuration
configuration = model.config`,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`}}),{c(){c=s("p"),b=n("Example:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Example:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function Rd(x){let c,b,u,m,v;return{c(){c=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(g,"CODE",{});var E=i(u);m=a(E,"Module"),E.forEach(o),v=a(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){_(l,c,g),e(c,b),e(c,u),e(u,m),e(c,v)},d(l){l&&o(c)}}}function Hd(x){let c,b,u,m,v;return{c(){c=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(g,"CODE",{});var E=i(u);m=a(E,"Module"),E.forEach(o),v=a(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){_(l,c,g),e(c,b),e(c,u),e(u,m),e(c,v)},d(l){l&&o(c)}}}function Ud(x){let c,b,u,m,v;return m=new et({props:{code:`from transformers import AutoTokenizer, AlignModel

model = AlignModel.from_pretrained("kakaobrain/align-base")
tokenizer = AutoTokenizer.from_pretrained("kakaobrain/align-base")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")
text_features = model.get_text_features(**inputs)`,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)`}}),{c(){c=s("p"),b=n("Examples:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Examples:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function Yd(x){let c,b,u,m,v;return{c(){c=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(g,"CODE",{});var E=i(u);m=a(E,"Module"),E.forEach(o),v=a(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){_(l,c,g),e(c,b),e(c,u),e(u,m),e(c,v)},d(l){l&&o(c)}}}function Kd(x){let c,b,u,m,v;return m=new et({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, AlignModel

model = AlignModel.from_pretrained("kakaobrain/align-base")
processor = AutoProcessor.from_pretrained("kakaobrain/align-base")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(images=image, return_tensors="pt")

image_features = model.get_image_features(**inputs)`,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)`}}),{c(){c=s("p"),b=n("Examples:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Examples:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function Zd(x){let c,b,u,m,v;return{c(){c=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(g,"CODE",{});var E=i(u);m=a(E,"Module"),E.forEach(o),v=a(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){_(l,c,g),e(c,b),e(c,u),e(u,m),e(c,v)},d(l){l&&o(c)}}}function Jd(x){let c,b,u,m,v;return m=new et({props:{code:`from transformers import AutoTokenizer, AlignTextModel

model = AlignTextModel.from_pretrained("kakaobrain/align-base")
tokenizer = AutoTokenizer.from_pretrained("kakaobrain/align-base")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled (EOS token) states`,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>`}}),{c(){c=s("p"),b=n("Examples:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Examples:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function Qd(x){let c,b,u,m,v;return{c(){c=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),m=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(g,"CODE",{});var E=i(u);m=a(E,"Module"),E.forEach(o),v=a(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(l,g){_(l,c,g),e(c,b),e(c,u),e(u,m),e(c,v)},d(l){l&&o(c)}}}function Xd(x){let c,b,u,m,v;return m=new et({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, AlignVisionModel

model = AlignVisionModel.from_pretrained("kakaobrain/align-base")
processor = AutoProcessor.from_pretrained("kakaobrain/align-base")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(images=image, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled CLS states`,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>`}}),{c(){c=s("p"),b=n("Examples:"),u=f(),A(m.$$.fragment)},l(l){c=r(l,"P",{});var g=i(c);b=a(g,"Examples:"),g.forEach(o),u=p(l),$(m.$$.fragment,l)},m(l,g){_(l,c,g),e(c,b),_(l,u,g),k(m,l,g),v=!0},p:Xt,i(l){v||(w(m.$$.fragment,l),v=!0)},o(l){y(m.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(u),T(m,l)}}}function ec(x){let c,b,u,m,v,l,g,E,qa,Ln,Q,ve,Zo,tt,Na,Jo,La,Vn,O,Va,ot,Oa,Da,eo,Sa,Fa,to,Ba,Wa,On,oo,Ga,Dn,no,Qo,Ra,Sn,X,be,Xo,nt,Ha,en,Ua,Fn,ao,Ya,Bn,M,so,Ka,Za,ro,Ja,Qa,io,Xa,es,lo,ts,os,co,ns,as,Wn,at,Gn,Ae,ss,st,rs,is,Rn,ee,$e,tn,rt,ls,on,ds,Hn,fo,cs,Un,Y,it,fs,lt,ps,gs,ms,dt,hs,ct,us,_s,vs,ke,ft,bs,As,nn,$s,ks,Yn,po,ws,Kn,te,we,an,pt,ys,sn,Ts,Zn,C,gt,xs,K,go,Es,Ps,mo,Ms,Cs,mt,zs,js,Is,oe,qs,ho,Ns,Ls,uo,Vs,Os,Ds,ye,Ss,Te,ht,Fs,ut,Bs,_o,Ws,Gs,Jn,ne,xe,rn,_t,Rs,ln,Hs,Qn,I,vt,Us,ae,Ys,vo,Ks,Zs,bt,Js,Qs,Xs,se,er,bo,tr,or,Ao,nr,ar,sr,Ee,Xn,re,Pe,dn,At,rr,cn,ir,ea,q,$t,lr,ie,dr,$o,cr,fr,kt,pr,gr,mr,le,hr,ko,ur,_r,wo,vr,br,Ar,Me,ta,de,Ce,fn,wt,$r,pn,kr,oa,N,yt,wr,z,yr,yo,Tr,xr,To,Er,Pr,xo,Mr,Cr,gn,zr,jr,Eo,Ir,qr,Nr,ze,Tt,Lr,xt,Vr,Po,Or,Dr,Sr,je,Et,Fr,Pt,Br,Mo,Wr,Gr,na,ce,Ie,mn,Mt,Rr,hn,Hr,aa,P,Ct,Ur,zt,Yr,Co,Kr,Zr,Jr,jt,Qr,It,Xr,ei,ti,Z,qt,oi,fe,ni,zo,ai,si,un,ri,ii,li,qe,di,D,Nt,ci,pe,fi,jo,pi,gi,_n,mi,hi,ui,Ne,_i,Le,vi,S,Lt,bi,ge,Ai,Io,$i,ki,vn,wi,yi,Ti,Ve,xi,Oe,sa,me,De,bn,Vt,Ei,An,Pi,ra,L,Ot,Mi,Dt,Ci,qo,zi,ji,Ii,St,qi,Ft,Ni,Li,Vi,F,Bt,Oi,he,Di,No,Si,Fi,$n,Bi,Wi,Gi,Se,Ri,Fe,ia,ue,Be,kn,Wt,Hi,wn,Ui,la,V,Gt,Yi,Rt,Ki,Lo,Zi,Ji,Qi,Ht,Xi,Ut,el,tl,ol,B,Yt,nl,_e,al,Vo,sl,rl,yn,il,ll,dl,We,cl,Ge,da;return l=new U({}),tt=new U({}),nt=new U({}),at=new et({props:{code:`import requests
import torch
from PIL import Image
from transformers import AlignProcessor, AlignModel

processor = AlignProcessor.from_pretrained("kakaobrain/align-base")
model = AlignModel.from_pretrained("kakaobrain/align-base")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
candidate_labels = ["an image of a cat", "an image of a dog"]

inputs = processor(text=candidate_labels, images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

# this is the image-text similarity score
logits_per_image = outputs.logits_per_image

# we can take the softmax to get the label probabilities
probs = logits_per_image.softmax(dim=1)
print(probs)`,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)`}}),rt=new U({}),pt=new U({}),gt=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/v4.27.1/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/v4.27.1/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;
Dimentionality 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 inital value of the <em>temperature</em> paramter. 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/v4.27.1/src/transformers/models/align/configuration_align.py#L298"}}),ye=new Qt({props:{anchor:"transformers.AlignConfig.example",$$slots:{default:[Bd]},$$scope:{ctx:x}}}),ht=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/v4.27.1/src/transformers/models/align/configuration_align.py#L375",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignConfig"
>AlignConfig</a></p>
`}}),_t=new U({}),vt=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/v4.27.1/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/v4.27.1/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.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"},{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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/configuration_align.py#L36"}}),Ee=new Qt({props:{anchor:"transformers.AlignTextConfig.example",$$slots:{default:[Wd]},$$scope:{ctx:x}}}),At=new U({}),$t=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:": typing.List[int] = [3, 3, 5, 3, 5, 5, 3]"},{name:"in_channels",val:": typing.List[int] = [32, 16, 24, 40, 80, 112, 192]"},{name:"out_channels",val:": typing.List[int] = [16, 24, 40, 80, 112, 192, 320]"},{name:"depthwise_padding",val:": typing.List[int] = []"},{name:"strides",val:": typing.List[int] = [1, 2, 2, 2, 1, 2, 1]"},{name:"num_block_repeats",val:": typing.List[int] = [1, 2, 2, 3, 3, 4, 1]"},{name:"expand_ratios",val:": typing.List[int] = [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:"dropout_rate",val:": float = 0.5"},{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.
strides &#x2014; (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 2, 2, 1, 2, 1]</code>):
List of stride sizes to be used in each block for convolutional layers.`,name:"depthwise_padding"},{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.hiddem_dim",description:`<strong>hiddem_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 1280) &#x2014;
The hidden dimension of the layer before the classification head.`,name:"hiddem_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.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The dropout rate to be applied before final classifier layer.`,name:"dropout_rate"},{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/v4.27.1/src/transformers/models/align/configuration_align.py#L157"}}),Me=new Qt({props:{anchor:"transformers.AlignVisionConfig.example",$$slots:{default:[Gd]},$$scope:{ctx:x}}}),wt=new U({}),yt=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/v4.27.1/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/v4.27.1/src/transformers/models/align/processing_align.py#L24"}}),Tt=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/v4.27.1/src/transformers/models/align/processing_align.py#L104"}}),Et=new j({props:{name:"decode",anchor:"transformers.AlignProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/processing_align.py#L111"}}),Mt=new U({}),Ct=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1418"}}),qt=new j({props:{name:"forward",anchor:"transformers.AlignModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1549"}}),qe=new Nn({props:{$$slots:{default:[Rd]},$$scope:{ctx:x}}}),Nt=new j({props:{name:"get_text_features",anchor:"transformers.AlignModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1451",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignTextModel"
>AlignTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Ne=new Nn({props:{$$slots:{default:[Hd]},$$scope:{ctx:x}}}),Le=new Qt({props:{anchor:"transformers.AlignModel.get_text_features.example",$$slots:{default:[Ud]},$$scope:{ctx:x}}}),Lt=new j({props:{name:"get_image_features",anchor:"transformers.AlignModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1504",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignVisionModel"
>AlignVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Ve=new Nn({props:{$$slots:{default:[Yd]},$$scope:{ctx:x}}}),Oe=new Qt({props:{anchor:"transformers.AlignModel.get_image_features.example",$$slots:{default:[Kd]},$$scope:{ctx:x}}}),Vt=new U({}),Ot=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1208"}}),Bt=new j({props:{name:"forward",anchor:"transformers.AlignTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1229",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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\u2019s 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Se=new Nn({props:{$$slots:{default:[Zd]},$$scope:{ctx:x}}}),Fe=new Qt({props:{anchor:"transformers.AlignTextModel.forward.example",$$slots:{default:[Jd]},$$scope:{ctx:x}}}),Wt=new U({}),Gt=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1333"}}),Yt=new j({props:{name:"forward",anchor:"transformers.AlignVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/align/modeling_align.py#L1357",returnDescription:`
<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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),We=new Nn({props:{$$slots:{default:[Qd]},$$scope:{ctx:x}}}),Ge=new Qt({props:{anchor:"transformers.AlignVisionModel.forward.example",$$slots:{default:[Xd]},$$scope:{ctx:x}}}),{c(){c=s("meta"),b=f(),u=s("h1"),m=s("a"),v=s("span"),A(l.$$.fragment),g=f(),E=s("span"),qa=n("ALIGN"),Ln=f(),Q=s("h2"),ve=s("a"),Zo=s("span"),A(tt.$$.fragment),Na=f(),Jo=s("span"),La=n("Overview"),Vn=f(),O=s("p"),Va=n("The ALIGN model was proposed in "),ot=s("a"),Oa=n("Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision"),Da=n(" 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 "),eo=s("a"),Sa=n("EfficientNet"),Fa=n(" as its vision encoder and "),to=s("a"),Ba=n("BERT"),Wa=n(" 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."),On=f(),oo=s("p"),Ga=n("The abstract from the paper is the following:"),Dn=f(),no=s("p"),Qo=s("em"),Ra=n("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."),Sn=f(),X=s("h2"),be=s("a"),Xo=s("span"),A(nt.$$.fragment),Ha=f(),en=s("span"),Ua=n("Usage"),Fn=f(),ao=s("p"),Ya=n("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."),Bn=f(),M=s("p"),so=s("a"),Ka=n("AlignProcessor"),Za=n(" wraps "),ro=s("a"),Ja=n("EfficientNetImageProcessor"),Qa=n(" and "),io=s("a"),Xa=n("BertTokenizer"),es=n(" 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 "),lo=s("a"),ts=n("AlignProcessor"),os=n(" and "),co=s("a"),ns=n("AlignModel"),as=n("."),Wn=f(),A(at.$$.fragment),Gn=f(),Ae=s("p"),ss=n("This model was contributed by "),st=s("a"),rs=n("Alara Dirik"),is=n(`.
The original code is not released, this implementation is based on the Kakao Brain implementation based on the original paper.`),Rn=f(),ee=s("h2"),$e=s("a"),tn=s("span"),A(rt.$$.fragment),ls=f(),on=s("span"),ds=n("Resources"),Hn=f(),fo=s("p"),cs=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ALIGN."),Un=f(),Y=s("ul"),it=s("li"),fs=n("A blog post on "),lt=s("a"),ps=n("ALIGN and the COYO-700M dataset"),gs=n("."),ms=f(),dt=s("li"),hs=n("A zero-shot image classification "),ct=s("a"),us=n("demo"),_s=n("."),vs=f(),ke=s("li"),ft=s("a"),bs=n("Model card"),As=n(" of "),nn=s("code"),$s=n("kakaobrain/align-base"),ks=n(" model."),Yn=f(),po=s("p"),ws=n("If you\u2019re 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."),Kn=f(),te=s("h2"),we=s("a"),an=s("span"),A(pt.$$.fragment),ys=f(),sn=s("span"),Ts=n("AlignConfig"),Zn=f(),C=s("div"),A(gt.$$.fragment),xs=f(),K=s("p"),go=s("a"),Es=n("AlignConfig"),Ps=n(" is the configuration class to store the configuration of a "),mo=s("a"),Ms=n("AlignModel"),Cs=n(`. 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
`),mt=s("a"),zs=n("kakaobrain/align-base"),js=n(" architecture."),Is=f(),oe=s("p"),qs=n("Configuration objects inherit from "),ho=s("a"),Ns=n("PretrainedConfig"),Ls=n(` and can be used to control the model outputs. Read the
documentation from `),uo=s("a"),Vs=n("PretrainedConfig"),Os=n(" for more information."),Ds=f(),A(ye.$$.fragment),Ss=f(),Te=s("div"),A(ht.$$.fragment),Fs=f(),ut=s("p"),Bs=n("Instantiate a "),_o=s("a"),Ws=n("AlignConfig"),Gs=n(` (or a derived class) from align text model configuration and align vision model
configuration.`),Jn=f(),ne=s("h2"),xe=s("a"),rn=s("span"),A(_t.$$.fragment),Rs=f(),ln=s("span"),Hs=n("AlignTextConfig"),Qn=f(),I=s("div"),A(vt.$$.fragment),Us=f(),ae=s("p"),Ys=n("This is the configuration class to store the configuration of a "),vo=s("a"),Ks=n("AlignTextModel"),Zs=n(`. 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
`),bt=s("a"),Js=n("kakaobrain/align-base"),Qs=n(` architecture. The default values here are
copied from BERT.`),Xs=f(),se=s("p"),er=n("Configuration objects inherit from "),bo=s("a"),tr=n("PretrainedConfig"),or=n(` and can be used to control the model outputs. Read the
documentation from `),Ao=s("a"),nr=n("PretrainedConfig"),ar=n(" for more information."),sr=f(),A(Ee.$$.fragment),Xn=f(),re=s("h2"),Pe=s("a"),dn=s("span"),A(At.$$.fragment),rr=f(),cn=s("span"),ir=n("AlignVisionConfig"),ea=f(),q=s("div"),A($t.$$.fragment),lr=f(),ie=s("p"),dr=n("This is the configuration class to store the configuration of a "),$o=s("a"),cr=n("AlignVisionModel"),fr=n(`. 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
`),kt=s("a"),pr=n("kakaobrain/align-base"),gr=n(` architecture. The default values are copied
from EfficientNet (efficientnet-b7)`),mr=f(),le=s("p"),hr=n("Configuration objects inherit from "),ko=s("a"),ur=n("PretrainedConfig"),_r=n(` and can be used to control the model outputs. Read the
documentation from `),wo=s("a"),vr=n("PretrainedConfig"),br=n(" for more information."),Ar=f(),A(Me.$$.fragment),ta=f(),de=s("h2"),Ce=s("a"),fn=s("span"),A(wt.$$.fragment),$r=f(),pn=s("span"),kr=n("AlignProcessor"),oa=f(),N=s("div"),A(yt.$$.fragment),wr=f(),z=s("p"),yr=n("Constructs an ALIGN processor which wraps "),yo=s("a"),Tr=n("EfficientNetImageProcessor"),xr=n(` and
`),To=s("a"),Er=n("BertTokenizer"),Pr=n("/"),xo=s("a"),Mr=n("BertTokenizerFast"),Cr=n(` into a single processor that interits both the image processor and
tokenizer functionalities. See the `),gn=s("code"),zr=n("__call__()"),jr=n(" and "),Eo=s("a"),Ir=n("decode()"),qr=n(` for more
information.`),Nr=f(),ze=s("div"),A(Tt.$$.fragment),Lr=f(),xt=s("p"),Vr=n("This method forwards all its arguments to BertTokenizerFast\u2019s "),Po=s("a"),Or=n("batch_decode()"),Dr=n(`. Please
refer to the docstring of this method for more information.`),Sr=f(),je=s("div"),A(Et.$$.fragment),Fr=f(),Pt=s("p"),Br=n("This method forwards all its arguments to BertTokenizerFast\u2019s "),Mo=s("a"),Wr=n("decode()"),Gr=n(`. Please refer to
the docstring of this method for more information.`),na=f(),ce=s("h2"),Ie=s("a"),mn=s("span"),A(Mt.$$.fragment),Rr=f(),hn=s("span"),Hr=n("AlignModel"),aa=f(),P=s("div"),A(Ct.$$.fragment),Ur=f(),zt=s("p"),Yr=n("This model inherits from "),Co=s("a"),Kr=n("PreTrainedModel"),Zr=n(`. 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.)`),Jr=f(),jt=s("p"),Qr=n("This model is also a PyTorch "),It=s("a"),Xr=n("torch.nn.Module"),ei=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ti=f(),Z=s("div"),A(qt.$$.fragment),oi=f(),fe=s("p"),ni=n("The "),zo=s("a"),ai=n("AlignModel"),si=n(" forward method, overrides the "),un=s("code"),ri=n("__call__"),ii=n(" special method."),li=f(),A(qe.$$.fragment),di=f(),D=s("div"),A(Nt.$$.fragment),ci=f(),pe=s("p"),fi=n("The "),jo=s("a"),pi=n("AlignModel"),gi=n(" forward method, overrides the "),_n=s("code"),mi=n("__call__"),hi=n(" special method."),ui=f(),A(Ne.$$.fragment),_i=f(),A(Le.$$.fragment),vi=f(),S=s("div"),A(Lt.$$.fragment),bi=f(),ge=s("p"),Ai=n("The "),Io=s("a"),$i=n("AlignModel"),ki=n(" forward method, overrides the "),vn=s("code"),wi=n("__call__"),yi=n(" special method."),Ti=f(),A(Ve.$$.fragment),xi=f(),A(Oe.$$.fragment),sa=f(),me=s("h2"),De=s("a"),bn=s("span"),A(Vt.$$.fragment),Ei=f(),An=s("span"),Pi=n("AlignTextModel"),ra=f(),L=s("div"),A(Ot.$$.fragment),Mi=f(),Dt=s("p"),Ci=n(`The text model from ALIGN without any head or projection on top.
This model inherits from `),qo=s("a"),zi=n("PreTrainedModel"),ji=n(`. 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.)`),Ii=f(),St=s("p"),qi=n("This model is also a PyTorch "),Ft=s("a"),Ni=n("torch.nn.Module"),Li=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vi=f(),F=s("div"),A(Bt.$$.fragment),Oi=f(),he=s("p"),Di=n("The "),No=s("a"),Si=n("AlignTextModel"),Fi=n(" forward method, overrides the "),$n=s("code"),Bi=n("__call__"),Wi=n(" special method."),Gi=f(),A(Se.$$.fragment),Ri=f(),A(Fe.$$.fragment),ia=f(),ue=s("h2"),Be=s("a"),kn=s("span"),A(Wt.$$.fragment),Hi=f(),wn=s("span"),Ui=n("AlignVisionModel"),la=f(),V=s("div"),A(Gt.$$.fragment),Yi=f(),Rt=s("p"),Ki=n(`The vision model from ALIGN without any head or projection on top.
This model inherits from `),Lo=s("a"),Zi=n("PreTrainedModel"),Ji=n(`. 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.)`),Qi=f(),Ht=s("p"),Xi=n("This model is also a PyTorch "),Ut=s("a"),el=n("torch.nn.Module"),tl=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ol=f(),B=s("div"),A(Yt.$$.fragment),nl=f(),_e=s("p"),al=n("The "),Vo=s("a"),sl=n("AlignVisionModel"),rl=n(" forward method, overrides the "),yn=s("code"),il=n("__call__"),ll=n(" special method."),dl=f(),A(We.$$.fragment),cl=f(),A(Ge.$$.fragment),this.h()},l(t){const h=Sd('[data-svelte="svelte-1phssyn"]',document.head);c=r(h,"META",{name:!0,content:!0}),h.forEach(o),b=p(t),u=r(t,"H1",{class:!0});var Kt=i(u);m=r(Kt,"A",{id:!0,class:!0,href:!0});var Tn=i(m);v=r(Tn,"SPAN",{});var xn=i(v);$(l.$$.fragment,xn),xn.forEach(o),Tn.forEach(o),g=p(Kt),E=r(Kt,"SPAN",{});var En=i(E);qa=a(En,"ALIGN"),En.forEach(o),Kt.forEach(o),Ln=p(t),Q=r(t,"H2",{class:!0});var Zt=i(Q);ve=r(Zt,"A",{id:!0,class:!0,href:!0});var Pn=i(ve);Zo=r(Pn,"SPAN",{});var Mn=i(Zo);$(tt.$$.fragment,Mn),Mn.forEach(o),Pn.forEach(o),Na=p(Zt),Jo=r(Zt,"SPAN",{});var Cn=i(Jo);La=a(Cn,"Overview"),Cn.forEach(o),Zt.forEach(o),Vn=p(t),O=r(t,"P",{});var R=i(O);Va=a(R,"The ALIGN model was proposed in "),ot=r(R,"A",{href:!0,rel:!0});var zn=i(ot);Oa=a(zn,"Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision"),zn.forEach(o),Da=a(R," 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 "),eo=r(R,"A",{href:!0});var jn=i(eo);Sa=a(jn,"EfficientNet"),jn.forEach(o),Fa=a(R," as its vision encoder and "),to=r(R,"A",{href:!0});var In=i(to);Ba=a(In,"BERT"),In.forEach(o),Wa=a(R," 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."),R.forEach(o),On=p(t),oo=r(t,"P",{});var fl=i(oo);Ga=a(fl,"The abstract from the paper is the following:"),fl.forEach(o),Dn=p(t),no=r(t,"P",{});var pl=i(no);Qo=r(pl,"EM",{});var gl=i(Qo);Ra=a(gl,"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."),gl.forEach(o),pl.forEach(o),Sn=p(t),X=r(t,"H2",{class:!0});var ca=i(X);be=r(ca,"A",{id:!0,class:!0,href:!0});var ml=i(be);Xo=r(ml,"SPAN",{});var hl=i(Xo);$(nt.$$.fragment,hl),hl.forEach(o),ml.forEach(o),Ha=p(ca),en=r(ca,"SPAN",{});var ul=i(en);Ua=a(ul,"Usage"),ul.forEach(o),ca.forEach(o),Fn=p(t),ao=r(t,"P",{});var _l=i(ao);Ya=a(_l,"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."),_l.forEach(o),Bn=p(t),M=r(t,"P",{});var H=i(M);so=r(H,"A",{href:!0});var vl=i(so);Ka=a(vl,"AlignProcessor"),vl.forEach(o),Za=a(H," wraps "),ro=r(H,"A",{href:!0});var bl=i(ro);Ja=a(bl,"EfficientNetImageProcessor"),bl.forEach(o),Qa=a(H," and "),io=r(H,"A",{href:!0});var Al=i(io);Xa=a(Al,"BertTokenizer"),Al.forEach(o),es=a(H," 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 "),lo=r(H,"A",{href:!0});var $l=i(lo);ts=a($l,"AlignProcessor"),$l.forEach(o),os=a(H," and "),co=r(H,"A",{href:!0});var kl=i(co);ns=a(kl,"AlignModel"),kl.forEach(o),as=a(H,"."),H.forEach(o),Wn=p(t),$(at.$$.fragment,t),Gn=p(t),Ae=r(t,"P",{});var fa=i(Ae);ss=a(fa,"This model was contributed by "),st=r(fa,"A",{href:!0,rel:!0});var wl=i(st);rs=a(wl,"Alara Dirik"),wl.forEach(o),is=a(fa,`.
The original code is not released, this implementation is based on the Kakao Brain implementation based on the original paper.`),fa.forEach(o),Rn=p(t),ee=r(t,"H2",{class:!0});var pa=i(ee);$e=r(pa,"A",{id:!0,class:!0,href:!0});var yl=i($e);tn=r(yl,"SPAN",{});var Tl=i(tn);$(rt.$$.fragment,Tl),Tl.forEach(o),yl.forEach(o),ls=p(pa),on=r(pa,"SPAN",{});var xl=i(on);ds=a(xl,"Resources"),xl.forEach(o),pa.forEach(o),Hn=p(t),fo=r(t,"P",{});var El=i(fo);cs=a(El,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ALIGN."),El.forEach(o),Un=p(t),Y=r(t,"UL",{});var Oo=i(Y);it=r(Oo,"LI",{});var ga=i(it);fs=a(ga,"A blog post on "),lt=r(ga,"A",{href:!0,rel:!0});var Pl=i(lt);ps=a(Pl,"ALIGN and the COYO-700M dataset"),Pl.forEach(o),gs=a(ga,"."),ga.forEach(o),ms=p(Oo),dt=r(Oo,"LI",{});var ma=i(dt);hs=a(ma,"A zero-shot image classification "),ct=r(ma,"A",{href:!0,rel:!0});var Ml=i(ct);us=a(Ml,"demo"),Ml.forEach(o),_s=a(ma,"."),ma.forEach(o),vs=p(Oo),ke=r(Oo,"LI",{});var qn=i(ke);ft=r(qn,"A",{href:!0,rel:!0});var Cl=i(ft);bs=a(Cl,"Model card"),Cl.forEach(o),As=a(qn," of "),nn=r(qn,"CODE",{});var zl=i(nn);$s=a(zl,"kakaobrain/align-base"),zl.forEach(o),ks=a(qn," model."),qn.forEach(o),Oo.forEach(o),Yn=p(t),po=r(t,"P",{});var jl=i(po);ws=a(jl,"If you\u2019re 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."),jl.forEach(o),Kn=p(t),te=r(t,"H2",{class:!0});var ha=i(te);we=r(ha,"A",{id:!0,class:!0,href:!0});var Il=i(we);an=r(Il,"SPAN",{});var ql=i(an);$(pt.$$.fragment,ql),ql.forEach(o),Il.forEach(o),ys=p(ha),sn=r(ha,"SPAN",{});var Nl=i(sn);Ts=a(Nl,"AlignConfig"),Nl.forEach(o),ha.forEach(o),Zn=p(t),C=r(t,"DIV",{class:!0});var J=i(C);$(gt.$$.fragment,J),xs=p(J),K=r(J,"P",{});var Jt=i(K);go=r(Jt,"A",{href:!0});var Ll=i(go);Es=a(Ll,"AlignConfig"),Ll.forEach(o),Ps=a(Jt," is the configuration class to store the configuration of a "),mo=r(Jt,"A",{href:!0});var Vl=i(mo);Ms=a(Vl,"AlignModel"),Vl.forEach(o),Cs=a(Jt,`. 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
`),mt=r(Jt,"A",{href:!0,rel:!0});var Ol=i(mt);zs=a(Ol,"kakaobrain/align-base"),Ol.forEach(o),js=a(Jt," architecture."),Jt.forEach(o),Is=p(J),oe=r(J,"P",{});var Do=i(oe);qs=a(Do,"Configuration objects inherit from "),ho=r(Do,"A",{href:!0});var Dl=i(ho);Ns=a(Dl,"PretrainedConfig"),Dl.forEach(o),Ls=a(Do,` and can be used to control the model outputs. Read the
documentation from `),uo=r(Do,"A",{href:!0});var Sl=i(uo);Vs=a(Sl,"PretrainedConfig"),Sl.forEach(o),Os=a(Do," for more information."),Do.forEach(o),Ds=p(J),$(ye.$$.fragment,J),Ss=p(J),Te=r(J,"DIV",{class:!0});var ua=i(Te);$(ht.$$.fragment,ua),Fs=p(ua),ut=r(ua,"P",{});var _a=i(ut);Bs=a(_a,"Instantiate a "),_o=r(_a,"A",{href:!0});var Fl=i(_o);Ws=a(Fl,"AlignConfig"),Fl.forEach(o),Gs=a(_a,` (or a derived class) from align text model configuration and align vision model
configuration.`),_a.forEach(o),ua.forEach(o),J.forEach(o),Jn=p(t),ne=r(t,"H2",{class:!0});var va=i(ne);xe=r(va,"A",{id:!0,class:!0,href:!0});var Bl=i(xe);rn=r(Bl,"SPAN",{});var Wl=i(rn);$(_t.$$.fragment,Wl),Wl.forEach(o),Bl.forEach(o),Rs=p(va),ln=r(va,"SPAN",{});var Gl=i(ln);Hs=a(Gl,"AlignTextConfig"),Gl.forEach(o),va.forEach(o),Qn=p(t),I=r(t,"DIV",{class:!0});var Re=i(I);$(vt.$$.fragment,Re),Us=p(Re),ae=r(Re,"P",{});var So=i(ae);Ys=a(So,"This is the configuration class to store the configuration of a "),vo=r(So,"A",{href:!0});var Rl=i(vo);Ks=a(Rl,"AlignTextModel"),Rl.forEach(o),Zs=a(So,`. 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
`),bt=r(So,"A",{href:!0,rel:!0});var Hl=i(bt);Js=a(Hl,"kakaobrain/align-base"),Hl.forEach(o),Qs=a(So,` architecture. The default values here are
copied from BERT.`),So.forEach(o),Xs=p(Re),se=r(Re,"P",{});var Fo=i(se);er=a(Fo,"Configuration objects inherit from "),bo=r(Fo,"A",{href:!0});var Ul=i(bo);tr=a(Ul,"PretrainedConfig"),Ul.forEach(o),or=a(Fo,` and can be used to control the model outputs. Read the
documentation from `),Ao=r(Fo,"A",{href:!0});var Yl=i(Ao);nr=a(Yl,"PretrainedConfig"),Yl.forEach(o),ar=a(Fo," for more information."),Fo.forEach(o),sr=p(Re),$(Ee.$$.fragment,Re),Re.forEach(o),Xn=p(t),re=r(t,"H2",{class:!0});var ba=i(re);Pe=r(ba,"A",{id:!0,class:!0,href:!0});var Kl=i(Pe);dn=r(Kl,"SPAN",{});var Zl=i(dn);$(At.$$.fragment,Zl),Zl.forEach(o),Kl.forEach(o),rr=p(ba),cn=r(ba,"SPAN",{});var Jl=i(cn);ir=a(Jl,"AlignVisionConfig"),Jl.forEach(o),ba.forEach(o),ea=p(t),q=r(t,"DIV",{class:!0});var He=i(q);$($t.$$.fragment,He),lr=p(He),ie=r(He,"P",{});var Bo=i(ie);dr=a(Bo,"This is the configuration class to store the configuration of a "),$o=r(Bo,"A",{href:!0});var Ql=i($o);cr=a(Ql,"AlignVisionModel"),Ql.forEach(o),fr=a(Bo,`. 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
`),kt=r(Bo,"A",{href:!0,rel:!0});var Xl=i(kt);pr=a(Xl,"kakaobrain/align-base"),Xl.forEach(o),gr=a(Bo,` architecture. The default values are copied
from EfficientNet (efficientnet-b7)`),Bo.forEach(o),mr=p(He),le=r(He,"P",{});var Wo=i(le);hr=a(Wo,"Configuration objects inherit from "),ko=r(Wo,"A",{href:!0});var ed=i(ko);ur=a(ed,"PretrainedConfig"),ed.forEach(o),_r=a(Wo,` and can be used to control the model outputs. Read the
documentation from `),wo=r(Wo,"A",{href:!0});var td=i(wo);vr=a(td,"PretrainedConfig"),td.forEach(o),br=a(Wo," for more information."),Wo.forEach(o),Ar=p(He),$(Me.$$.fragment,He),He.forEach(o),ta=p(t),de=r(t,"H2",{class:!0});var Aa=i(de);Ce=r(Aa,"A",{id:!0,class:!0,href:!0});var od=i(Ce);fn=r(od,"SPAN",{});var nd=i(fn);$(wt.$$.fragment,nd),nd.forEach(o),od.forEach(o),$r=p(Aa),pn=r(Aa,"SPAN",{});var ad=i(pn);kr=a(ad,"AlignProcessor"),ad.forEach(o),Aa.forEach(o),oa=p(t),N=r(t,"DIV",{class:!0});var Ue=i(N);$(yt.$$.fragment,Ue),wr=p(Ue),z=r(Ue,"P",{});var W=i(z);yr=a(W,"Constructs an ALIGN processor which wraps "),yo=r(W,"A",{href:!0});var sd=i(yo);Tr=a(sd,"EfficientNetImageProcessor"),sd.forEach(o),xr=a(W,` and
`),To=r(W,"A",{href:!0});var rd=i(To);Er=a(rd,"BertTokenizer"),rd.forEach(o),Pr=a(W,"/"),xo=r(W,"A",{href:!0});var id=i(xo);Mr=a(id,"BertTokenizerFast"),id.forEach(o),Cr=a(W,` into a single processor that interits both the image processor and
tokenizer functionalities. See the `),gn=r(W,"CODE",{});var ld=i(gn);zr=a(ld,"__call__()"),ld.forEach(o),jr=a(W," and "),Eo=r(W,"A",{href:!0});var dd=i(Eo);Ir=a(dd,"decode()"),dd.forEach(o),qr=a(W,` for more
information.`),W.forEach(o),Nr=p(Ue),ze=r(Ue,"DIV",{class:!0});var $a=i(ze);$(Tt.$$.fragment,$a),Lr=p($a),xt=r($a,"P",{});var ka=i(xt);Vr=a(ka,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Po=r(ka,"A",{href:!0});var cd=i(Po);Or=a(cd,"batch_decode()"),cd.forEach(o),Dr=a(ka,`. Please
refer to the docstring of this method for more information.`),ka.forEach(o),$a.forEach(o),Sr=p(Ue),je=r(Ue,"DIV",{class:!0});var wa=i(je);$(Et.$$.fragment,wa),Fr=p(wa),Pt=r(wa,"P",{});var ya=i(Pt);Br=a(ya,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Mo=r(ya,"A",{href:!0});var fd=i(Mo);Wr=a(fd,"decode()"),fd.forEach(o),Gr=a(ya,`. Please refer to
the docstring of this method for more information.`),ya.forEach(o),wa.forEach(o),Ue.forEach(o),na=p(t),ce=r(t,"H2",{class:!0});var Ta=i(ce);Ie=r(Ta,"A",{id:!0,class:!0,href:!0});var pd=i(Ie);mn=r(pd,"SPAN",{});var gd=i(mn);$(Mt.$$.fragment,gd),gd.forEach(o),pd.forEach(o),Rr=p(Ta),hn=r(Ta,"SPAN",{});var md=i(hn);Hr=a(md,"AlignModel"),md.forEach(o),Ta.forEach(o),aa=p(t),P=r(t,"DIV",{class:!0});var G=i(P);$(Ct.$$.fragment,G),Ur=p(G),zt=r(G,"P",{});var xa=i(zt);Yr=a(xa,"This model inherits from "),Co=r(xa,"A",{href:!0});var hd=i(Co);Kr=a(hd,"PreTrainedModel"),hd.forEach(o),Zr=a(xa,`. 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.)`),xa.forEach(o),Jr=p(G),jt=r(G,"P",{});var Ea=i(jt);Qr=a(Ea,"This model is also a PyTorch "),It=r(Ea,"A",{href:!0,rel:!0});var ud=i(It);Xr=a(ud,"torch.nn.Module"),ud.forEach(o),ei=a(Ea,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ea.forEach(o),ti=p(G),Z=r(G,"DIV",{class:!0});var Go=i(Z);$(qt.$$.fragment,Go),oi=p(Go),fe=r(Go,"P",{});var Ro=i(fe);ni=a(Ro,"The "),zo=r(Ro,"A",{href:!0});var _d=i(zo);ai=a(_d,"AlignModel"),_d.forEach(o),si=a(Ro," forward method, overrides the "),un=r(Ro,"CODE",{});var vd=i(un);ri=a(vd,"__call__"),vd.forEach(o),ii=a(Ro," special method."),Ro.forEach(o),li=p(Go),$(qe.$$.fragment,Go),Go.forEach(o),di=p(G),D=r(G,"DIV",{class:!0});var Ye=i(D);$(Nt.$$.fragment,Ye),ci=p(Ye),pe=r(Ye,"P",{});var Ho=i(pe);fi=a(Ho,"The "),jo=r(Ho,"A",{href:!0});var bd=i(jo);pi=a(bd,"AlignModel"),bd.forEach(o),gi=a(Ho," forward method, overrides the "),_n=r(Ho,"CODE",{});var Ad=i(_n);mi=a(Ad,"__call__"),Ad.forEach(o),hi=a(Ho," special method."),Ho.forEach(o),ui=p(Ye),$(Ne.$$.fragment,Ye),_i=p(Ye),$(Le.$$.fragment,Ye),Ye.forEach(o),vi=p(G),S=r(G,"DIV",{class:!0});var Ke=i(S);$(Lt.$$.fragment,Ke),bi=p(Ke),ge=r(Ke,"P",{});var Uo=i(ge);Ai=a(Uo,"The "),Io=r(Uo,"A",{href:!0});var $d=i(Io);$i=a($d,"AlignModel"),$d.forEach(o),ki=a(Uo," forward method, overrides the "),vn=r(Uo,"CODE",{});var kd=i(vn);wi=a(kd,"__call__"),kd.forEach(o),yi=a(Uo," special method."),Uo.forEach(o),Ti=p(Ke),$(Ve.$$.fragment,Ke),xi=p(Ke),$(Oe.$$.fragment,Ke),Ke.forEach(o),G.forEach(o),sa=p(t),me=r(t,"H2",{class:!0});var Pa=i(me);De=r(Pa,"A",{id:!0,class:!0,href:!0});var wd=i(De);bn=r(wd,"SPAN",{});var yd=i(bn);$(Vt.$$.fragment,yd),yd.forEach(o),wd.forEach(o),Ei=p(Pa),An=r(Pa,"SPAN",{});var Td=i(An);Pi=a(Td,"AlignTextModel"),Td.forEach(o),Pa.forEach(o),ra=p(t),L=r(t,"DIV",{class:!0});var Ze=i(L);$(Ot.$$.fragment,Ze),Mi=p(Ze),Dt=r(Ze,"P",{});var Ma=i(Dt);Ci=a(Ma,`The text model from ALIGN without any head or projection on top.
This model inherits from `),qo=r(Ma,"A",{href:!0});var xd=i(qo);zi=a(xd,"PreTrainedModel"),xd.forEach(o),ji=a(Ma,`. 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.)`),Ma.forEach(o),Ii=p(Ze),St=r(Ze,"P",{});var Ca=i(St);qi=a(Ca,"This model is also a PyTorch "),Ft=r(Ca,"A",{href:!0,rel:!0});var Ed=i(Ft);Ni=a(Ed,"torch.nn.Module"),Ed.forEach(o),Li=a(Ca,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ca.forEach(o),Vi=p(Ze),F=r(Ze,"DIV",{class:!0});var Je=i(F);$(Bt.$$.fragment,Je),Oi=p(Je),he=r(Je,"P",{});var Yo=i(he);Di=a(Yo,"The "),No=r(Yo,"A",{href:!0});var Pd=i(No);Si=a(Pd,"AlignTextModel"),Pd.forEach(o),Fi=a(Yo," forward method, overrides the "),$n=r(Yo,"CODE",{});var Md=i($n);Bi=a(Md,"__call__"),Md.forEach(o),Wi=a(Yo," special method."),Yo.forEach(o),Gi=p(Je),$(Se.$$.fragment,Je),Ri=p(Je),$(Fe.$$.fragment,Je),Je.forEach(o),Ze.forEach(o),ia=p(t),ue=r(t,"H2",{class:!0});var za=i(ue);Be=r(za,"A",{id:!0,class:!0,href:!0});var Cd=i(Be);kn=r(Cd,"SPAN",{});var zd=i(kn);$(Wt.$$.fragment,zd),zd.forEach(o),Cd.forEach(o),Hi=p(za),wn=r(za,"SPAN",{});var jd=i(wn);Ui=a(jd,"AlignVisionModel"),jd.forEach(o),za.forEach(o),la=p(t),V=r(t,"DIV",{class:!0});var Qe=i(V);$(Gt.$$.fragment,Qe),Yi=p(Qe),Rt=r(Qe,"P",{});var ja=i(Rt);Ki=a(ja,`The vision model from ALIGN without any head or projection on top.
This model inherits from `),Lo=r(ja,"A",{href:!0});var Id=i(Lo);Zi=a(Id,"PreTrainedModel"),Id.forEach(o),Ji=a(ja,`. 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.)`),ja.forEach(o),Qi=p(Qe),Ht=r(Qe,"P",{});var Ia=i(Ht);Xi=a(Ia,"This model is also a PyTorch "),Ut=r(Ia,"A",{href:!0,rel:!0});var qd=i(Ut);el=a(qd,"torch.nn.Module"),qd.forEach(o),tl=a(Ia,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ia.forEach(o),ol=p(Qe),B=r(Qe,"DIV",{class:!0});var Xe=i(B);$(Yt.$$.fragment,Xe),nl=p(Xe),_e=r(Xe,"P",{});var Ko=i(_e);al=a(Ko,"The "),Vo=r(Ko,"A",{href:!0});var Nd=i(Vo);sl=a(Nd,"AlignVisionModel"),Nd.forEach(o),rl=a(Ko," forward method, overrides the "),yn=r(Ko,"CODE",{});var Ld=i(yn);il=a(Ld,"__call__"),Ld.forEach(o),ll=a(Ko," special method."),Ko.forEach(o),dl=p(Xe),$(We.$$.fragment,Xe),cl=p(Xe),$(Ge.$$.fragment,Xe),Xe.forEach(o),Qe.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(tc)),d(m,"id","align"),d(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(m,"href","#align"),d(u,"class","relative group"),d(ve,"id","overview"),d(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ve,"href","#overview"),d(Q,"class","relative group"),d(ot,"href","https://arxiv.org/abs/2102.05918"),d(ot,"rel","nofollow"),d(eo,"href","efficientnet"),d(to,"href","bert"),d(be,"id","usage"),d(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(be,"href","#usage"),d(X,"class","relative group"),d(so,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignProcessor"),d(ro,"href","/docs/transformers/v4.27.1/en/model_doc/efficientnet#transformers.EfficientNetImageProcessor"),d(io,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer"),d(lo,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignProcessor"),d(co,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignModel"),d(st,"href","https://huggingface.co/adirik"),d(st,"rel","nofollow"),d($e,"id","resources"),d($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d($e,"href","#resources"),d(ee,"class","relative group"),d(lt,"href","https://huggingface.co/blog"),d(lt,"rel","nofollow"),d(ct,"href","https://huggingface.co/spaces/adirik/ALIGN-zero-shot-image-classification"),d(ct,"rel","nofollow"),d(ft,"href","https://huggingface.co/kakaobrain/align-base"),d(ft,"rel","nofollow"),d(we,"id","transformers.AlignConfig"),d(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(we,"href","#transformers.AlignConfig"),d(te,"class","relative group"),d(go,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignConfig"),d(mo,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignModel"),d(mt,"href","https://huggingface.co/kakaobrain/align-base"),d(mt,"rel","nofollow"),d(ho,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(uo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(_o,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignConfig"),d(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xe,"id","transformers.AlignTextConfig"),d(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(xe,"href","#transformers.AlignTextConfig"),d(ne,"class","relative group"),d(vo,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignTextModel"),d(bt,"href","https://huggingface.co/kakaobrain/align-base"),d(bt,"rel","nofollow"),d(bo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ao,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pe,"id","transformers.AlignVisionConfig"),d(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Pe,"href","#transformers.AlignVisionConfig"),d(re,"class","relative group"),d($o,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignVisionModel"),d(kt,"href","https://huggingface.co/kakaobrain/align-base"),d(kt,"rel","nofollow"),d(ko,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(wo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ce,"id","transformers.AlignProcessor"),d(Ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ce,"href","#transformers.AlignProcessor"),d(de,"class","relative group"),d(yo,"href","/docs/transformers/v4.27.1/en/model_doc/efficientnet#transformers.EfficientNetImageProcessor"),d(To,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer"),d(xo,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizerFast"),d(Eo,"href","/docs/transformers/v4.27.1/en/model_doc/owlvit#transformers.OwlViTProcessor.decode"),d(Po,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),d(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mo,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),d(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ie,"id","transformers.AlignModel"),d(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ie,"href","#transformers.AlignModel"),d(ce,"class","relative group"),d(Co,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(It,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(It,"rel","nofollow"),d(zo,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignModel"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jo,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignModel"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Io,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignModel"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(De,"id","transformers.AlignTextModel"),d(De,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(De,"href","#transformers.AlignTextModel"),d(me,"class","relative group"),d(qo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(Ft,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ft,"rel","nofollow"),d(No,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignTextModel"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Be,"id","transformers.AlignVisionModel"),d(Be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Be,"href","#transformers.AlignVisionModel"),d(ue,"class","relative group"),d(Lo,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(Ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ut,"rel","nofollow"),d(Vo,"href","/docs/transformers/v4.27.1/en/model_doc/align#transformers.AlignVisionModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,c),_(t,b,h),_(t,u,h),e(u,m),e(m,v),k(l,v,null),e(u,g),e(u,E),e(E,qa),_(t,Ln,h),_(t,Q,h),e(Q,ve),e(ve,Zo),k(tt,Zo,null),e(Q,Na),e(Q,Jo),e(Jo,La),_(t,Vn,h),_(t,O,h),e(O,Va),e(O,ot),e(ot,Oa),e(O,Da),e(O,eo),e(eo,Sa),e(O,Fa),e(O,to),e(to,Ba),e(O,Wa),_(t,On,h),_(t,oo,h),e(oo,Ga),_(t,Dn,h),_(t,no,h),e(no,Qo),e(Qo,Ra),_(t,Sn,h),_(t,X,h),e(X,be),e(be,Xo),k(nt,Xo,null),e(X,Ha),e(X,en),e(en,Ua),_(t,Fn,h),_(t,ao,h),e(ao,Ya),_(t,Bn,h),_(t,M,h),e(M,so),e(so,Ka),e(M,Za),e(M,ro),e(ro,Ja),e(M,Qa),e(M,io),e(io,Xa),e(M,es),e(M,lo),e(lo,ts),e(M,os),e(M,co),e(co,ns),e(M,as),_(t,Wn,h),k(at,t,h),_(t,Gn,h),_(t,Ae,h),e(Ae,ss),e(Ae,st),e(st,rs),e(Ae,is),_(t,Rn,h),_(t,ee,h),e(ee,$e),e($e,tn),k(rt,tn,null),e(ee,ls),e(ee,on),e(on,ds),_(t,Hn,h),_(t,fo,h),e(fo,cs),_(t,Un,h),_(t,Y,h),e(Y,it),e(it,fs),e(it,lt),e(lt,ps),e(it,gs),e(Y,ms),e(Y,dt),e(dt,hs),e(dt,ct),e(ct,us),e(dt,_s),e(Y,vs),e(Y,ke),e(ke,ft),e(ft,bs),e(ke,As),e(ke,nn),e(nn,$s),e(ke,ks),_(t,Yn,h),_(t,po,h),e(po,ws),_(t,Kn,h),_(t,te,h),e(te,we),e(we,an),k(pt,an,null),e(te,ys),e(te,sn),e(sn,Ts),_(t,Zn,h),_(t,C,h),k(gt,C,null),e(C,xs),e(C,K),e(K,go),e(go,Es),e(K,Ps),e(K,mo),e(mo,Ms),e(K,Cs),e(K,mt),e(mt,zs),e(K,js),e(C,Is),e(C,oe),e(oe,qs),e(oe,ho),e(ho,Ns),e(oe,Ls),e(oe,uo),e(uo,Vs),e(oe,Os),e(C,Ds),k(ye,C,null),e(C,Ss),e(C,Te),k(ht,Te,null),e(Te,Fs),e(Te,ut),e(ut,Bs),e(ut,_o),e(_o,Ws),e(ut,Gs),_(t,Jn,h),_(t,ne,h),e(ne,xe),e(xe,rn),k(_t,rn,null),e(ne,Rs),e(ne,ln),e(ln,Hs),_(t,Qn,h),_(t,I,h),k(vt,I,null),e(I,Us),e(I,ae),e(ae,Ys),e(ae,vo),e(vo,Ks),e(ae,Zs),e(ae,bt),e(bt,Js),e(ae,Qs),e(I,Xs),e(I,se),e(se,er),e(se,bo),e(bo,tr),e(se,or),e(se,Ao),e(Ao,nr),e(se,ar),e(I,sr),k(Ee,I,null),_(t,Xn,h),_(t,re,h),e(re,Pe),e(Pe,dn),k(At,dn,null),e(re,rr),e(re,cn),e(cn,ir),_(t,ea,h),_(t,q,h),k($t,q,null),e(q,lr),e(q,ie),e(ie,dr),e(ie,$o),e($o,cr),e(ie,fr),e(ie,kt),e(kt,pr),e(ie,gr),e(q,mr),e(q,le),e(le,hr),e(le,ko),e(ko,ur),e(le,_r),e(le,wo),e(wo,vr),e(le,br),e(q,Ar),k(Me,q,null),_(t,ta,h),_(t,de,h),e(de,Ce),e(Ce,fn),k(wt,fn,null),e(de,$r),e(de,pn),e(pn,kr),_(t,oa,h),_(t,N,h),k(yt,N,null),e(N,wr),e(N,z),e(z,yr),e(z,yo),e(yo,Tr),e(z,xr),e(z,To),e(To,Er),e(z,Pr),e(z,xo),e(xo,Mr),e(z,Cr),e(z,gn),e(gn,zr),e(z,jr),e(z,Eo),e(Eo,Ir),e(z,qr),e(N,Nr),e(N,ze),k(Tt,ze,null),e(ze,Lr),e(ze,xt),e(xt,Vr),e(xt,Po),e(Po,Or),e(xt,Dr),e(N,Sr),e(N,je),k(Et,je,null),e(je,Fr),e(je,Pt),e(Pt,Br),e(Pt,Mo),e(Mo,Wr),e(Pt,Gr),_(t,na,h),_(t,ce,h),e(ce,Ie),e(Ie,mn),k(Mt,mn,null),e(ce,Rr),e(ce,hn),e(hn,Hr),_(t,aa,h),_(t,P,h),k(Ct,P,null),e(P,Ur),e(P,zt),e(zt,Yr),e(zt,Co),e(Co,Kr),e(zt,Zr),e(P,Jr),e(P,jt),e(jt,Qr),e(jt,It),e(It,Xr),e(jt,ei),e(P,ti),e(P,Z),k(qt,Z,null),e(Z,oi),e(Z,fe),e(fe,ni),e(fe,zo),e(zo,ai),e(fe,si),e(fe,un),e(un,ri),e(fe,ii),e(Z,li),k(qe,Z,null),e(P,di),e(P,D),k(Nt,D,null),e(D,ci),e(D,pe),e(pe,fi),e(pe,jo),e(jo,pi),e(pe,gi),e(pe,_n),e(_n,mi),e(pe,hi),e(D,ui),k(Ne,D,null),e(D,_i),k(Le,D,null),e(P,vi),e(P,S),k(Lt,S,null),e(S,bi),e(S,ge),e(ge,Ai),e(ge,Io),e(Io,$i),e(ge,ki),e(ge,vn),e(vn,wi),e(ge,yi),e(S,Ti),k(Ve,S,null),e(S,xi),k(Oe,S,null),_(t,sa,h),_(t,me,h),e(me,De),e(De,bn),k(Vt,bn,null),e(me,Ei),e(me,An),e(An,Pi),_(t,ra,h),_(t,L,h),k(Ot,L,null),e(L,Mi),e(L,Dt),e(Dt,Ci),e(Dt,qo),e(qo,zi),e(Dt,ji),e(L,Ii),e(L,St),e(St,qi),e(St,Ft),e(Ft,Ni),e(St,Li),e(L,Vi),e(L,F),k(Bt,F,null),e(F,Oi),e(F,he),e(he,Di),e(he,No),e(No,Si),e(he,Fi),e(he,$n),e($n,Bi),e(he,Wi),e(F,Gi),k(Se,F,null),e(F,Ri),k(Fe,F,null),_(t,ia,h),_(t,ue,h),e(ue,Be),e(Be,kn),k(Wt,kn,null),e(ue,Hi),e(ue,wn),e(wn,Ui),_(t,la,h),_(t,V,h),k(Gt,V,null),e(V,Yi),e(V,Rt),e(Rt,Ki),e(Rt,Lo),e(Lo,Zi),e(Rt,Ji),e(V,Qi),e(V,Ht),e(Ht,Xi),e(Ht,Ut),e(Ut,el),e(Ht,tl),e(V,ol),e(V,B),k(Yt,B,null),e(B,nl),e(B,_e),e(_e,al),e(_e,Vo),e(Vo,sl),e(_e,rl),e(_e,yn),e(yn,il),e(_e,ll),e(B,dl),k(We,B,null),e(B,cl),k(Ge,B,null),da=!0},p(t,[h]){const Kt={};h&2&&(Kt.$$scope={dirty:h,ctx:t}),ye.$set(Kt);const Tn={};h&2&&(Tn.$$scope={dirty:h,ctx:t}),Ee.$set(Tn);const xn={};h&2&&(xn.$$scope={dirty:h,ctx:t}),Me.$set(xn);const En={};h&2&&(En.$$scope={dirty:h,ctx:t}),qe.$set(En);const Zt={};h&2&&(Zt.$$scope={dirty:h,ctx:t}),Ne.$set(Zt);const Pn={};h&2&&(Pn.$$scope={dirty:h,ctx:t}),Le.$set(Pn);const Mn={};h&2&&(Mn.$$scope={dirty:h,ctx:t}),Ve.$set(Mn);const Cn={};h&2&&(Cn.$$scope={dirty:h,ctx:t}),Oe.$set(Cn);const R={};h&2&&(R.$$scope={dirty:h,ctx:t}),Se.$set(R);const zn={};h&2&&(zn.$$scope={dirty:h,ctx:t}),Fe.$set(zn);const jn={};h&2&&(jn.$$scope={dirty:h,ctx:t}),We.$set(jn);const In={};h&2&&(In.$$scope={dirty:h,ctx:t}),Ge.$set(In)},i(t){da||(w(l.$$.fragment,t),w(tt.$$.fragment,t),w(nt.$$.fragment,t),w(at.$$.fragment,t),w(rt.$$.fragment,t),w(pt.$$.fragment,t),w(gt.$$.fragment,t),w(ye.$$.fragment,t),w(ht.$$.fragment,t),w(_t.$$.fragment,t),w(vt.$$.fragment,t),w(Ee.$$.fragment,t),w(At.$$.fragment,t),w($t.$$.fragment,t),w(Me.$$.fragment,t),w(wt.$$.fragment,t),w(yt.$$.fragment,t),w(Tt.$$.fragment,t),w(Et.$$.fragment,t),w(Mt.$$.fragment,t),w(Ct.$$.fragment,t),w(qt.$$.fragment,t),w(qe.$$.fragment,t),w(Nt.$$.fragment,t),w(Ne.$$.fragment,t),w(Le.$$.fragment,t),w(Lt.$$.fragment,t),w(Ve.$$.fragment,t),w(Oe.$$.fragment,t),w(Vt.$$.fragment,t),w(Ot.$$.fragment,t),w(Bt.$$.fragment,t),w(Se.$$.fragment,t),w(Fe.$$.fragment,t),w(Wt.$$.fragment,t),w(Gt.$$.fragment,t),w(Yt.$$.fragment,t),w(We.$$.fragment,t),w(Ge.$$.fragment,t),da=!0)},o(t){y(l.$$.fragment,t),y(tt.$$.fragment,t),y(nt.$$.fragment,t),y(at.$$.fragment,t),y(rt.$$.fragment,t),y(pt.$$.fragment,t),y(gt.$$.fragment,t),y(ye.$$.fragment,t),y(ht.$$.fragment,t),y(_t.$$.fragment,t),y(vt.$$.fragment,t),y(Ee.$$.fragment,t),y(At.$$.fragment,t),y($t.$$.fragment,t),y(Me.$$.fragment,t),y(wt.$$.fragment,t),y(yt.$$.fragment,t),y(Tt.$$.fragment,t),y(Et.$$.fragment,t),y(Mt.$$.fragment,t),y(Ct.$$.fragment,t),y(qt.$$.fragment,t),y(qe.$$.fragment,t),y(Nt.$$.fragment,t),y(Ne.$$.fragment,t),y(Le.$$.fragment,t),y(Lt.$$.fragment,t),y(Ve.$$.fragment,t),y(Oe.$$.fragment,t),y(Vt.$$.fragment,t),y(Ot.$$.fragment,t),y(Bt.$$.fragment,t),y(Se.$$.fragment,t),y(Fe.$$.fragment,t),y(Wt.$$.fragment,t),y(Gt.$$.fragment,t),y(Yt.$$.fragment,t),y(We.$$.fragment,t),y(Ge.$$.fragment,t),da=!1},d(t){o(c),t&&o(b),t&&o(u),T(l),t&&o(Ln),t&&o(Q),T(tt),t&&o(Vn),t&&o(O),t&&o(On),t&&o(oo),t&&o(Dn),t&&o(no),t&&o(Sn),t&&o(X),T(nt),t&&o(Fn),t&&o(ao),t&&o(Bn),t&&o(M),t&&o(Wn),T(at,t),t&&o(Gn),t&&o(Ae),t&&o(Rn),t&&o(ee),T(rt),t&&o(Hn),t&&o(fo),t&&o(Un),t&&o(Y),t&&o(Yn),t&&o(po),t&&o(Kn),t&&o(te),T(pt),t&&o(Zn),t&&o(C),T(gt),T(ye),T(ht),t&&o(Jn),t&&o(ne),T(_t),t&&o(Qn),t&&o(I),T(vt),T(Ee),t&&o(Xn),t&&o(re),T(At),t&&o(ea),t&&o(q),T($t),T(Me),t&&o(ta),t&&o(de),T(wt),t&&o(oa),t&&o(N),T(yt),T(Tt),T(Et),t&&o(na),t&&o(ce),T(Mt),t&&o(aa),t&&o(P),T(Ct),T(qt),T(qe),T(Nt),T(Ne),T(Le),T(Lt),T(Ve),T(Oe),t&&o(sa),t&&o(me),T(Vt),t&&o(ra),t&&o(L),T(Ot),T(Bt),T(Se),T(Fe),t&&o(ia),t&&o(ue),T(Wt),t&&o(la),t&&o(V),T(Gt),T(Yt),T(We),T(Ge)}}}const tc={local:"align",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"resources",title:"Resources"},{local:"transformers.AlignConfig",title:"AlignConfig"},{local:"transformers.AlignTextConfig",title:"AlignTextConfig"},{local:"transformers.AlignVisionConfig",title:"AlignVisionConfig"},{local:"transformers.AlignProcessor",title:"AlignProcessor"},{local:"transformers.AlignModel",title:"AlignModel"},{local:"transformers.AlignTextModel",title:"AlignTextModel"},{local:"transformers.AlignVisionModel",title:"AlignVisionModel"}],title:"ALIGN"};function oc(x){return Fd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dc extends Vd{constructor(c){super();Od(this,c,oc,ec,Dd,{})}}export{dc as default,tc as metadata};
