import{S as cc,i as mc,s as gc,e as t,k as c,w as T,t as a,M as pc,c as n,d as r,m,a as i,x as b,h as s,b as l,N as hc,G as e,g as p,y as v,q as y,o as B,B as x,v as fc,L as Jr}from"../../chunks/vendor-hf-doc-builder.js";import{T as zd}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ro}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as G}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function uc(k){let h,$,_,f,w;return f=new ro({props:{code:`from transformers import BridgeTowerModel, BridgeTowerConfig

# Initializing a BridgeTower BridgeTower/bridgetower-base style configuration
configuration = BridgeTowerConfig()

# Initializing a model from the BridgeTower/bridgetower-base style configuration
model = BridgeTowerModel(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> BridgeTowerModel, BridgeTowerConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BridgeTower BridgeTower/bridgetower-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BridgeTowerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the BridgeTower/bridgetower-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerModel(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(){h=t("p"),$=a("Example:"),_=c(),T(f.$$.fragment)},l(d){h=n(d,"P",{});var u=i(h);$=s(u,"Example:"),u.forEach(r),_=m(d),b(f.$$.fragment,d)},m(d,u){p(d,h,u),e(h,$),p(d,_,u),v(f,d,u),w=!0},p:Jr,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(h),d&&r(_),x(f,d)}}}function _c(k){let h,$,_,f,w;return f=new ro({props:{code:`from transformers import BridgeTowerTextConfig

# Initializing a BridgeTower BridgeTower/bridgetower-base style configuration for the text model
configuration = BridgeTowerTextConfig()

# Accessing the configuration
configuration`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerTextConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BridgeTower BridgeTower/bridgetower-base style configuration for the text model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BridgeTowerTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration`}}),{c(){h=t("p"),$=a("Example:"),_=c(),T(f.$$.fragment)},l(d){h=n(d,"P",{});var u=i(h);$=s(u,"Example:"),u.forEach(r),_=m(d),b(f.$$.fragment,d)},m(d,u){p(d,h,u),e(h,$),p(d,_,u),v(f,d,u),w=!0},p:Jr,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(h),d&&r(_),x(f,d)}}}function wc(k){let h,$,_,f,w;return f=new ro({props:{code:`from transformers import BridgeTowerVisionConfig

# Initializing a BridgeTower BridgeTower/bridgetower-base style configuration for the vision model
configuration = BridgeTowerVisionConfig()

# Accessing the configuration
configuration`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BridgeTower BridgeTower/bridgetower-base style configuration for the vision model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BridgeTowerVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration`}}),{c(){h=t("p"),$=a("Example:"),_=c(),T(f.$$.fragment)},l(d){h=n(d,"P",{});var u=i(h);$=s(u,"Example:"),u.forEach(r),_=m(d),b(f.$$.fragment,d)},m(d,u){p(d,h,u),e(h,$),p(d,_,u),v(f,d,u),w=!0},p:Jr,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(h),d&&r(_),x(f,d)}}}function Tc(k){let h,$,_,f,w;return{c(){h=t("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=t("code"),f=a("Module"),w=a(`
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(d){h=n(d,"P",{});var u=i(h);$=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(u,"CODE",{});var I=i(_);f=s(I,"Module"),I.forEach(r),w=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(r)},m(d,u){p(d,h,u),e(h,$),e(h,_),e(_,f),e(h,w)},d(d){d&&r(h)}}}function bc(k){let h,$,_,f,w;return f=new ro({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerModel
from PIL import Image
import requests

# prepare image and text
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
text = "hello world"
processor = BridgeTowerProcessor.from_pretrained("BridgeTower/bridgetower-base")
model = BridgeTowerModel.from_pretrained("BridgeTower/bridgetower-base")

inputs = processor(image, text, return_tensors="pt")
outputs = model(**inputs)
outputs.keys()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerModel
<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-comment"># prepare image and text</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>text = <span class="hljs-string">&quot;hello world&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BridgeTowerProcessor.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerModel.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, text, 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>outputs.keys()
odict_keys([<span class="hljs-string">&#x27;text_features&#x27;</span>, <span class="hljs-string">&#x27;image_features&#x27;</span>, <span class="hljs-string">&#x27;pooler_output&#x27;</span>])`}}),{c(){h=t("p"),$=a("Examples:"),_=c(),T(f.$$.fragment)},l(d){h=n(d,"P",{});var u=i(h);$=s(u,"Examples:"),u.forEach(r),_=m(d),b(f.$$.fragment,d)},m(d,u){p(d,h,u),e(h,$),p(d,_,u),v(f,d,u),w=!0},p:Jr,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(h),d&&r(_),x(f,d)}}}function vc(k){let h,$,_,f,w;return{c(){h=t("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=t("code"),f=a("Module"),w=a(`
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(d){h=n(d,"P",{});var u=i(h);$=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(u,"CODE",{});var I=i(_);f=s(I,"Module"),I.forEach(r),w=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(r)},m(d,u){p(d,h,u),e(h,$),e(h,_),e(_,f),e(h,w)},d(d){d&&r(h)}}}function yc(k){let h,$,_,f,w;return f=new ro({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerForMaskedLM
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000360943.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
text = "a <mask> looking out of the window"

processor = BridgeTowerProcessor.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")
model = BridgeTowerForMaskedLM.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")

# prepare inputs
encoding = processor(image, text, return_tensors="pt")

# forward pass
outputs = model(**encoding)

results = processor.decode(outputs.logits.argmax(dim=-1).squeeze(0).tolist())

print(results)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerForMaskedLM
<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>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000360943.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).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;a &lt;mask&gt; looking out of the window&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BridgeTowerProcessor.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerForMaskedLM.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)

<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.decode(outputs.logits.argmax(dim=-<span class="hljs-number">1</span>).squeeze(<span class="hljs-number">0</span>).tolist())

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(results)
.a cat looking out of the window.`}}),{c(){h=t("p"),$=a("Examples:"),_=c(),T(f.$$.fragment)},l(d){h=n(d,"P",{});var u=i(h);$=s(u,"Examples:"),u.forEach(r),_=m(d),b(f.$$.fragment,d)},m(d,u){p(d,h,u),e(h,$),p(d,_,u),v(f,d,u),w=!0},p:Jr,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(h),d&&r(_),x(f,d)}}}function Bc(k){let h,$,_,f,w;return{c(){h=t("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=t("code"),f=a("Module"),w=a(`
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(d){h=n(d,"P",{});var u=i(h);$=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(u,"CODE",{});var I=i(_);f=s(I,"Module"),I.forEach(r),w=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(r)},m(d,u){p(d,h,u),e(h,$),e(h,_),e(_,f),e(h,w)},d(d){d&&r(h)}}}function xc(k){let h,$,_,f,w;return f=new ro({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerForImageAndTextRetrieval
import requests
from PIL import Image

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
texts = ["An image of two cats chilling on a couch", "A football player scoring a goal"]

processor = BridgeTowerProcessor.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")
model = BridgeTowerForImageAndTextRetrieval.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")

# forward pass
scores = dict()
for text in texts:
    # prepare inputs
    encoding = processor(image, text, return_tensors="pt")
    outputs = model(**encoding)
    scores[text] = outputs.logits[0, 1].item()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerForImageAndTextRetrieval
<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> PIL <span class="hljs-keyword">import</span> Image

<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>texts = [<span class="hljs-string">&quot;An image of two cats chilling on a couch&quot;</span>, <span class="hljs-string">&quot;A football player scoring a goal&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BridgeTowerProcessor.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerForImageAndTextRetrieval.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scores = <span class="hljs-built_in">dict</span>()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> text <span class="hljs-keyword">in</span> texts:
<span class="hljs-meta">... </span>    <span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">... </span>    encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">... </span>    outputs = model(**encoding)
<span class="hljs-meta">... </span>    scores[text] = outputs.logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>].item()`}}),{c(){h=t("p"),$=a("Examples:"),_=c(),T(f.$$.fragment)},l(d){h=n(d,"P",{});var u=i(h);$=s(u,"Examples:"),u.forEach(r),_=m(d),b(f.$$.fragment,d)},m(d,u){p(d,h,u),e(h,$),p(d,_,u),v(f,d,u),w=!0},p:Jr,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(h),d&&r(_),x(f,d)}}}function $c(k){let h,$,_,f,w,d,u,I,Sn,Nt,Y,Te,Qr,to,Wn,Yr,Vn,Dt,be,Un,no,Gn,Hn,St,ve,Xn,ao,Jn,Qn,Wt,er,Yn,Vt,or,Kr,Kn,Ut,ye,Id,Gt,so,Zn,rr,ea,Ht,K,Be,Zr,io,oa,et,ra,Xt,tr,ta,Jt,L,na,nr,aa,sa,ar,ia,da,sr,la,ca,Qt,H,ma,ir,ga,pa,dr,ha,fa,Yt,lo,Kt,X,ua,lr,_a,wa,cr,Ta,ba,Zt,co,en,E,va,mo,ya,Ba,go,xa,$a,po,ka,Pa,ho,za,Ia,on,mr,Ea,rn,R,fo,Ma,gr,ja,Ca,Fa,Z,Aa,uo,qa,La,_o,Ra,Oa,Na,wo,Da,To,Sa,Wa,Va,ot,Ua,tn,ee,xe,rt,bo,Ga,tt,Ha,nn,P,vo,Xa,oe,Ja,pr,Qa,Ya,yo,Ka,Za,es,re,os,hr,rs,ts,fr,ns,as,ss,$e,is,ke,Bo,ds,te,ls,ur,cs,ms,_r,gs,ps,hs,Pe,xo,fs,$o,us,wr,_s,ws,an,ne,ze,nt,ko,Ts,at,bs,sn,j,Po,vs,ae,ys,Tr,Bs,xs,zo,$s,ks,Ps,se,zs,br,Is,Es,vr,Ms,js,Cs,Ie,dn,ie,Ee,st,Io,Fs,it,As,ln,C,Eo,qs,de,Ls,yr,Rs,Os,Mo,Ns,Ds,Ss,le,Ws,Br,Vs,Us,xr,Gs,Hs,Xs,Me,cn,ce,je,dt,jo,Js,lt,Qs,mn,W,Co,Ys,ct,Ks,Zs,Ce,Fo,ei,mt,oi,gn,me,Fe,gt,Ao,ri,pt,ti,pn,F,qo,ni,ht,ai,si,M,$r,ii,di,kr,li,ci,Pr,mi,gi,Lo,ft,pi,hi,fi,ut,ui,_i,wi,J,Ro,Ti,ge,bi,Ae,vi,_t,yi,Bi,xi,qe,$i,wt,ki,Pi,zi,Ii,Tt,Ei,hn,pe,Le,bt,Oo,Mi,vt,ji,fn,V,No,Ci,Do,Fi,yt,Ai,qi,Li,O,So,Ri,he,Oi,zr,Ni,Di,Bt,Si,Wi,Vi,Re,Ui,Oe,un,fe,Ne,xt,Wo,Gi,$t,Hi,_n,A,Vo,Xi,kt,Ji,Qi,Uo,Yi,Pt,Ki,Zi,ed,N,Go,od,ue,rd,Ir,td,nd,zt,ad,sd,id,De,dd,Se,wn,_e,We,It,Ho,ld,Et,cd,Tn,q,Xo,md,Mt,gd,pd,Jo,hd,jt,fd,ud,_d,D,Qo,wd,we,Td,Er,bd,vd,Ct,yd,Bd,xd,Ve,$d,Ue,bn;return d=new G({}),to=new G({}),io=new G({}),lo=new ro({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerForImageAndTextRetrieval
import requests
from PIL import Image

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
texts = ["An image of two cats chilling on a couch", "A football player scoring a goal"]

processor = BridgeTowerProcessor.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")
model = BridgeTowerForImageAndTextRetrieval.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")

# forward pass
scores = dict()
for text in texts:
    # prepare inputs
    encoding = processor(image, text, return_tensors="pt")
    outputs = model(**encoding)
    scores[text] = outputs.logits[0, 1].item()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerForImageAndTextRetrieval
<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> PIL <span class="hljs-keyword">import</span> Image

<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>texts = [<span class="hljs-string">&quot;An image of two cats chilling on a couch&quot;</span>, <span class="hljs-string">&quot;A football player scoring a goal&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BridgeTowerProcessor.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerForImageAndTextRetrieval.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scores = <span class="hljs-built_in">dict</span>()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> text <span class="hljs-keyword">in</span> texts:
<span class="hljs-meta">... </span>    <span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">... </span>    encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">... </span>    outputs = model(**encoding)
<span class="hljs-meta">... </span>    scores[text] = outputs.logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>].item()`}}),co=new ro({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerForMaskedLM
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000360943.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
text = "a <mask> looking out of the window"

processor = BridgeTowerProcessor.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")
model = BridgeTowerForMaskedLM.from_pretrained("BridgeTower/bridgetower-base-itm-mlm")

# prepare inputs
encoding = processor(image, text, return_tensors="pt")

# forward pass
outputs = model(**encoding)

results = processor.decode(outputs.logits.argmax(dim=-1).squeeze(0).tolist())

print(results)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerForMaskedLM
<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>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000360943.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).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;a &lt;mask&gt; looking out of the window&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BridgeTowerProcessor.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerForMaskedLM.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-base-itm-mlm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)

<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.decode(outputs.logits.argmax(dim=-<span class="hljs-number">1</span>).squeeze(<span class="hljs-number">0</span>).tolist())

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(results)
.a cat looking out of the window.`}}),bo=new G({}),vo=new z({props:{name:"class transformers.BridgeTowerConfig",anchor:"transformers.BridgeTowerConfig",parameters:[{name:"share_cross_modal_transformer_layers",val:" = True"},{name:"drop_rate",val:" = 0.1"},{name:"head_hidden_scale",val:" = 2"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_size",val:" = 768"},{name:"initializer_factor",val:" = 1"},{name:"is_encoder_decoder",val:" = False"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"share_link_tower_layers",val:" = False"},{name:"link_tower_type",val:" = 'add'"},{name:"num_attention_heads",val:" = 12"},{name:"num_hidden_layers",val:" = 6"},{name:"tie_word_embeddings",val:" = False"},{name:"init_layernorm_from_vision_encoder",val:" = False"},{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerConfig.share_cross_modal_transformer_layers",description:`<strong>share_cross_modal_transformer_layers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether cross modal transformer layers are shared.`,name:"share_cross_modal_transformer_layers"},{anchor:"transformers.BridgeTowerConfig.drop_rate",description:`<strong>drop_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Drop out probability.`,name:"drop_rate"},{anchor:"transformers.BridgeTowerConfig.head_hidden_scale",description:`<strong>head_hidden_scale</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Scale of hidden layers head.`,name:"head_hidden_scale"},{anchor:"transformers.BridgeTowerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</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.`,name:"hidden_act"},{anchor:"transformers.BridgeTowerConfig.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.BridgeTowerConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.BridgeTowerConfig.is_encoder_decoder",description:`<strong>is_encoder_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether this is an encoder/decoder model`,name:"is_encoder_decoder"},{anchor:"transformers.BridgeTowerConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BridgeTowerConfig.share_link_tower_layers",description:`<strong>share_link_tower_layers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the bride/link tower layers are shared.`,name:"share_link_tower_layers"},{anchor:"transformers.BridgeTowerConfig.link_tower_type",description:`<strong>link_tower_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;add&quot;</code>) &#x2014;
Type of the bridge/link layer.`,name:"link_tower_type"},{anchor:"transformers.BridgeTowerConfig.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.BridgeTowerConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.BridgeTowerConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie input and output embeddings.`,name:"tie_word_embeddings"},{anchor:"transformers.BridgeTowerConfig.init_layernorm_from_vision_encoder",description:`<strong>init_layernorm_from_vision_encoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to init LayerNorm from the vision encoder.`,name:"init_layernorm_from_vision_encoder"},{anchor:"transformers.BridgeTowerConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerTextConfig">BridgeTowerTextConfig</a>.`,name:"text_config"},{anchor:"transformers.BridgeTowerConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerVisionConfig">BridgeTowerVisionConfig</a>.`,name:"vision_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/configuration_bridgetower.py#L250"}}),$e=new Xr({props:{anchor:"transformers.BridgeTowerConfig.example",$$slots:{default:[uc]},$$scope:{ctx:k}}}),Bo=new z({props:{name:"from_text_vision_configs",anchor:"transformers.BridgeTowerConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": BridgeTowerTextConfig"},{name:"vision_config",val:": BridgeTowerVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/configuration_bridgetower.py#L365"}}),xo=new z({props:{name:"to_dict",anchor:"transformers.BridgeTowerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/configuration_bridgetower.py#L376",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),ko=new G({}),Po=new z({props:{name:"class transformers.BridgeTowerTextConfig",anchor:"transformers.BridgeTowerTextConfig",parameters:[{name:"vocab_size",val:" = 50265"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"initializer_factor",val:" = 1"},{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:" = 514"},{name:"type_vocab_size",val:" = 1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the text part of the model. Defines the number of different tokens that can be
represented by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerModel">BridgeTowerModel</a>.`,name:"vocab_size"},{anchor:"transformers.BridgeTowerTextConfig.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.BridgeTowerTextConfig.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.BridgeTowerTextConfig.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.BridgeTowerTextConfig.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.BridgeTowerTextConfig.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.BridgeTowerTextConfig.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.BridgeTowerTextConfig.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.BridgeTowerTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 514) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BridgeTowerTextConfig.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>.`,name:"type_vocab_size"},{anchor:"transformers.BridgeTowerTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.BridgeTowerTextConfig.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.BridgeTowerTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BridgeTowerTextConfig.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.BridgeTowerTextConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.BridgeTowerTextConfig.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.BridgeTowerTextConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/configuration_bridgetower.py#L121"}}),Ie=new Xr({props:{anchor:"transformers.BridgeTowerTextConfig.example",$$slots:{default:[_c]},$$scope:{ctx:k}}}),Io=new G({}),Eo=new z({props:{name:"class transformers.BridgeTowerVisionConfig",anchor:"transformers.BridgeTowerVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"patch_size",val:" = 16"},{name:"image_size",val:" = 288"},{name:"initializer_factor",val:" = 1"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"stop_gradient",val:" = False"},{name:"share_layernorm",val:" = True"},{name:"remove_last_layer",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerVisionConfig.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.BridgeTowerVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in visual encoder model.`,name:"num_hidden_layers"},{anchor:"transformers.BridgeTowerVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.BridgeTowerVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 288) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.BridgeTowerVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.BridgeTowerVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BridgeTowerVisionConfig.stop_gradient",description:`<strong>stop_gradient</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to stop gradient for training.`,name:"stop_gradient"},{anchor:"transformers.BridgeTowerVisionConfig.share_layernorm",description:`<strong>share_layernorm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether LayerNorm layers are shared.`,name:"share_layernorm"},{anchor:"transformers.BridgeTowerVisionConfig.remove_last_layer",description:`<strong>remove_last_layer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to remove the last layer from the vision encoder.`,name:"remove_last_layer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/configuration_bridgetower.py#L35"}}),Me=new Xr({props:{anchor:"transformers.BridgeTowerVisionConfig.example",$$slots:{default:[wc]},$$scope:{ctx:k}}}),jo=new G({}),Co=new z({props:{name:"class transformers.BridgeTowerImageProcessor",anchor:"transformers.BridgeTowerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = 288"},{name:"size_divisor",val:": int = 32"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_center_crop",val:": bool = True"},{name:"do_pad",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.BridgeTowerImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>288</code>) &#x2014;
Resize the shorter side of the input to <code>size[&quot;shortest_edge&quot;]</code>. The longer side will be limited to under
<code>int((1333 / 800) * size[&quot;shortest_edge&quot;])</code> while preserving the aspect ratio. Only has an effect if
<code>do_resize</code> is set to <code>True</code>. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.BridgeTowerImageProcessor.size_divisor",description:`<strong>size_divisor</strong> (<code>int</code>, <em>optional</em>, defaults to <code>32</code>) &#x2014;
The size by which to make sure both the height and width can be divided. Only has an effect if <code>do_resize</code>
is set to <code>True</code>. Can be overridden by the <code>size_divisor</code> parameter in the <code>preprocess</code> method.`,name:"size_divisor"},{anchor:"transformers.BridgeTowerImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. Can be
overridden by the <code>resample</code> parameter in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.BridgeTowerImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.BridgeTowerImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.BridgeTowerImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.BridgeTowerImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.BridgeTowerImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.BridgeTowerImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image. Can be overridden by the <code>do_center_crop</code> parameter in the <code>preprocess</code>
method.`,name:"do_center_crop"},{anchor:"transformers.BridgeTowerImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to pad the image to the <code>(max_height, max_width)</code> of the images in the batch. Can be overridden by
the <code>do_pad</code> parameter in the <code>preprocess</code> method.`,name:"do_pad"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/image_processing_bridgetower.py#L115"}}),Fo=new z({props:{name:"preprocess",anchor:"transformers.BridgeTowerImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"size_divisor",val:": typing.Optional[int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Controls the size of the image after <code>resize</code>. The shortest edge of the image is resized to
<code>size[&quot;shortest_edge&quot;]</code> whilst preserving the aspect ratio. If the longest edge of this resized image
is &gt; <code>int(size[&quot;shortest_edge&quot;] * (1333 / 800))</code>, then the image is resized again to make the longest
edge equal to <code>int(size[&quot;shortest_edge&quot;] * (1333 / 800))</code>.`,name:"size"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.size_divisor",description:`<strong>size_divisor</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.size_divisor</code>) &#x2014;
The image is resized to a size that is a multiple of this value.`,name:"size_divisor"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to normalize the image by if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to normalize the image by if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_pad</code>) &#x2014;
Whether to pad the image to the (max_height, max_width) in the batch. If <code>True</code>, a pixel mask is also
created and returned.`,name:"do_pad"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the
image is padded with 0&#x2019;s and then center cropped.`,name:"do_center_crop"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.BridgeTowerImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/image_processing_bridgetower.py#L392"}}),Ao=new G({}),qo=new z({props:{name:"class transformers.BridgeTowerProcessor",anchor:"transformers.BridgeTowerProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerProcessor.image_processor",description:`<strong>image_processor</strong> (<code>BridgeTowerImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.BridgeTowerProcessor.tokenizer",description:"<strong>tokenizer</strong> (<code>RobertaTokenizerFast</code>) &#x2014;\nAn instance of [&#x2018;RobertaTokenizerFast`]. The tokenizer is a required input.",name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/processing_bridgetower.py#L26"}}),Ro=new z({props:{name:"__call__",anchor:"transformers.BridgeTowerProcessor.__call__",parameters:[{name:"images",val:""},{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/processing_bridgetower.py#L48"}}),Oo=new G({}),No=new z({props:{name:"class transformers.BridgeTowerModel",anchor:"transformers.BridgeTowerModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig">BridgeTowerConfig</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/main/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/main/src/transformers/models/bridgetower/modeling_bridgetower.py#L1175"}}),So=new z({props:{name:"forward",anchor:"transformers.BridgeTowerModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_token_type_idx",val:": typing.Optional[int] = 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"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.BridgeTowerModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.BridgeTowerModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</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>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.BridgeTowerModel.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.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.BridgeTowerModel.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. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">BridgeTowerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BridgeTowerModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.BridgeTowerModel.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.BridgeTowerModel.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.BridgeTowerModel.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.BridgeTowerModel.forward.image_token_type_idx",description:`<strong>image_token_type_idx</strong> (<code>int</code>, <em>optional</em>) &#x2014;</p>
<ul>
<li>The token type ids for images.</li>
</ul>`,name:"image_token_type_idx"},{anchor:"transformers.BridgeTowerModel.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.BridgeTowerModel.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.BridgeTowerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BridgeTowerModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, hidden states are returned as a list containing the hidden states of text, image, and
cross-modal components respectively. i.e. <code>(hidden_states_text, hidden_states_image, hidden_states_cross_modal)</code> where each element is a list of the hidden states of the corresponding
modality. <code>hidden_states_txt/img</code> are a list of tensors corresponding to unimodal hidden states and
<code>hidden_states_cross_modal</code> is a list of tuples containing <code>cross_modal_text_hidden_states</code> and
<code>cross_modal_image_hidden_states</code> of each brdige layer.`,name:"output_hidden_states"},{anchor:"transformers.BridgeTowerModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels are currently not supported.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/modeling_bridgetower.py#L1232",returnDescription:`
<p>A <code>transformers.models.bridgetower.modeling_bridgetower.BridgeTowerModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig"
>BridgeTowerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>text_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the text output of the last layer of the model.</p>
</li>
<li>
<p><strong>image_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the image 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 x 2)</code>) \u2014 Concatenation of last layer hidden-state of the first token of the text and image sequence (classification
token), respectively, after further processing through layers used for auxiliary pretraining tasks.</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>
</ul>
`,returnType:`
<p><code>transformers.models.bridgetower.modeling_bridgetower.BridgeTowerModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Re=new zd({props:{$$slots:{default:[Tc]},$$scope:{ctx:k}}}),Oe=new Xr({props:{anchor:"transformers.BridgeTowerModel.forward.example",$$slots:{default:[bc]},$$scope:{ctx:k}}}),Wo=new G({}),Vo=new z({props:{name:"class transformers.BridgeTowerForMaskedLM",anchor:"transformers.BridgeTowerForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig">BridgeTowerConfig</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/main/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/main/src/transformers/models/bridgetower/modeling_bridgetower.py#L1505"}}),Go=new z({props:{name:"forward",anchor:"transformers.BridgeTowerForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = 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"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.BridgeTowerForMaskedLM.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. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.BridgeTowerForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.BridgeTowerForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.BridgeTowerForMaskedLM.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. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">BridgeTowerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BridgeTowerForMaskedLM.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.BridgeTowerForMaskedLM.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.BridgeTowerForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, 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.BridgeTowerForMaskedLM.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.BridgeTowerForMaskedLM.forward.image_token_type_idx",description:`<strong>image_token_type_idx</strong> (<code>int</code>, <em>optional</em>) &#x2014;</p>
<ul>
<li>The token type ids for images.</li>
</ul>`,name:"image_token_type_idx"},{anchor:"transformers.BridgeTowerForMaskedLM.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.BridgeTowerForMaskedLM.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.BridgeTowerForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BridgeTowerForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels are currently not supported.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/modeling_bridgetower.py#L1521",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</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 (<a
  href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig"
>BridgeTowerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new zd({props:{$$slots:{default:[vc]},$$scope:{ctx:k}}}),Se=new Xr({props:{anchor:"transformers.BridgeTowerForMaskedLM.forward.example",$$slots:{default:[yc]},$$scope:{ctx:k}}}),Ho=new G({}),Xo=new z({props:{name:"class transformers.BridgeTowerForImageAndTextRetrieval",anchor:"transformers.BridgeTowerForImageAndTextRetrieval",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig">BridgeTowerConfig</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/main/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/main/src/transformers/models/bridgetower/modeling_bridgetower.py#L1602"}}),Qo=new z({props:{name:"forward",anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = 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"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</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>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.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.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.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. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">BridgeTowerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.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.BridgeTowerForImageAndTextRetrieval.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.BridgeTowerForImageAndTextRetrieval.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.image_token_type_idx",description:`<strong>image_token_type_idx</strong> (<code>int</code>, <em>optional</em>) &#x2014;</p>
<ul>
<li>The token type ids for images.</li>
</ul>`,name:"image_token_type_idx"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.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.BridgeTowerForImageAndTextRetrieval.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.BridgeTowerForImageAndTextRetrieval.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels are currently not supported.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/modeling_bridgetower.py#L1613",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</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 (<a
  href="/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig"
>BridgeTowerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new zd({props:{$$slots:{default:[Bc]},$$scope:{ctx:k}}}),Ue=new Xr({props:{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.example",$$slots:{default:[xc]},$$scope:{ctx:k}}}),{c(){h=t("meta"),$=c(),_=t("h1"),f=t("a"),w=t("span"),T(d.$$.fragment),u=c(),I=t("span"),Sn=a("BridgeTower"),Nt=c(),Y=t("h2"),Te=t("a"),Qr=t("span"),T(to.$$.fragment),Wn=c(),Yr=t("span"),Vn=a("Overview"),Dt=c(),be=t("p"),Un=a("The BridgeTower model was proposed in "),no=t("a"),Gn=a("BridgeTower: Building Bridges Between Encoders in Vision-Language Representative Learning"),Hn=a(` by Xiao Xu, Chenfei Wu, Shachar Rosenman, Vasudev Lal, Wanxiang Che, Nan Duan. The goal of this model is to build a
bridge between each uni-modal encoder and the cross-modal encoder to enable comprehensive and detailed interaction at each layer of the cross-modal encoder thus achieving remarkable performance on various downstream tasks with almost negligible additional performance and computational costs.`),St=c(),ve=t("p"),Xn=a("This paper has been accepted to the "),ao=t("a"),Jn=a("AAAI\u201923"),Qn=a(" conference."),Wt=c(),er=t("p"),Yn=a("The abstract from the paper is the following:"),Vt=c(),or=t("p"),Kr=t("em"),Kn=a(`Vision-Language (VL) models with the TWO-TOWER architecture have dominated visual-language representation learning in recent years.
Current VL models either use lightweight uni-modal encoders and learn to extract, align and fuse both modalities simultaneously in a deep cross-modal encoder, or feed the last-layer uni-modal representations from the deep pre-trained uni-modal encoders into the top cross-modal encoder.
Both approaches potentially restrict vision-language representation learning and limit model performance. In this paper, we propose BRIDGETOWER, which introduces multiple bridge layers that build a connection between the top layers of uni-modal encoders and each layer of the crossmodal encoder.
This enables effective bottom-up cross-modal alignment and fusion between visual and textual representations of different semantic levels of pre-trained uni-modal encoders in the cross-modal encoder. Pre-trained with only 4M images, BRIDGETOWER achieves state-of-the-art performance on various downstream vision-language tasks.
In particular, on the VQAv2 test-std set, BRIDGETOWER achieves an accuracy of 78.73%, outperforming the previous state-of-the-art model METER by 1.09% with the same pre-training data and almost negligible additional parameters and computational costs.
Notably, when further scaling the model, BRIDGETOWER achieves an accuracy of 81.15%, surpassing models that are pre-trained on orders-of-magnitude larger datasets.`),Ut=c(),ye=t("img"),Gt=c(),so=t("small"),Zn=a("BridgeTower architecture. Taken from the "),rr=t("a"),ea=a("original paper."),Ht=c(),K=t("h2"),Be=t("a"),Zr=t("span"),T(io.$$.fragment),oa=c(),et=t("span"),ra=a("Usage"),Xt=c(),tr=t("p"),ta=a(`BridgeTower consists of a visual encoder, a textual encoder and cross-modal encoder with multiple lightweight bridge layers.
The goal of this approach was to build a bridge between each uni-modal encoder and the cross-modal encoder to enable comprehensive and detailed interaction at each layer of the cross-modal encoder.
In principle, one can apply any visual, textual or cross-modal encoder in the proposed architecture.`),Jt=c(),L=t("p"),na=a("The "),nr=t("a"),aa=a("BridgeTowerProcessor"),sa=a(" wraps "),ar=t("a"),ia=a("RobertaTokenizer"),da=a(" and "),sr=t("a"),la=a("BridgeTowerImageProcessor"),ca=a(` into a single instance to both
encode the text and prepare the images respectively.`),Qt=c(),H=t("p"),ma=a("The following example shows how to run image-text retrieval using "),ir=t("a"),ga=a("BridgeTowerProcessor"),pa=a(" and "),dr=t("a"),ha=a("BridgeTowerForImageAndTextRetrieval"),fa=a("."),Yt=c(),T(lo.$$.fragment),Kt=c(),X=t("p"),ua=a("The following example shows how to run masked language modeling using "),lr=t("a"),_a=a("BridgeTowerProcessor"),wa=a(" and "),cr=t("a"),Ta=a("BridgeTowerForMaskedLM"),ba=a("."),Zt=c(),T(co.$$.fragment),en=c(),E=t("p"),va=a("This model was contributed by "),mo=t("a"),ya=a("Anahita Bhiwandiwalla"),Ba=a(", "),go=t("a"),xa=a("Tiep Le"),$a=a(" and "),po=t("a"),ka=a("Shaoyen Tseng"),Pa=a(". The original code can be found "),ho=t("a"),za=a("here"),Ia=a("."),on=c(),mr=t("p"),Ea=a("Tips:"),rn=c(),R=t("ul"),fo=t("li"),Ma=a("This implementation of BridgeTower uses "),gr=t("a"),ja=a("RobertaTokenizer"),Ca=a(" to generate text embeddings and OpenAI\u2019s CLIP/ViT model to compute visual embeddings."),Fa=c(),Z=t("li"),Aa=a("Checkpoints for pre-trained "),uo=t("a"),qa=a("bridgeTower-base"),La=a(" and "),_o=t("a"),Ra=a("bridgetower masked language modeling and image text matching"),Oa=a(" are released."),Na=c(),wo=t("li"),Da=a("Please refer to "),To=t("a"),Sa=a("Table 5"),Wa=a(" for BridgeTower\u2019s performance on Image Retrieval and other down stream tasks."),Va=c(),ot=t("li"),Ua=a("The PyTorch version of this model is only available in torch 1.10 and higher."),tn=c(),ee=t("h2"),xe=t("a"),rt=t("span"),T(bo.$$.fragment),Ga=c(),tt=t("span"),Ha=a("BridgeTowerConfig"),nn=c(),P=t("div"),T(vo.$$.fragment),Xa=c(),oe=t("p"),Ja=a("This is the configuration class to store the configuration of a "),pr=t("a"),Qa=a("BridgeTowerModel"),Ya=a(`. It is used to instantiate a
BridgeTower model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
`),yo=t("a"),Ka=a("BridgeTower/bridgetower-base"),Za=a(" architecture."),es=c(),re=t("p"),os=a("Configuration objects inherit from "),hr=t("a"),rs=a("PretrainedConfig"),ts=a(` and can be used to control the model outputs. Read the
documentation from `),fr=t("a"),ns=a("PretrainedConfig"),as=a(" for more information."),ss=c(),T($e.$$.fragment),is=c(),ke=t("div"),T(Bo.$$.fragment),ds=c(),te=t("p"),ls=a("Instantiate a "),ur=t("a"),cs=a("BridgeTowerConfig"),ms=a(` (or a derived class) from BridgeTower text model configuration. Returns:
`),_r=t("a"),gs=a("BridgeTowerConfig"),ps=a(": An instance of a configuration object"),hs=c(),Pe=t("div"),T(xo.$$.fragment),fs=c(),$o=t("p"),us=a("Serializes this instance to a Python dictionary. Override the default "),wr=t("a"),_s=a("to_dict()"),ws=a("."),an=c(),ne=t("h2"),ze=t("a"),nt=t("span"),T(ko.$$.fragment),Ts=c(),at=t("span"),bs=a("BridgeTowerTextConfig"),sn=c(),j=t("div"),T(Po.$$.fragment),vs=c(),ae=t("p"),ys=a("This is the configuration class to store the text configuration of a "),Tr=t("a"),Bs=a("BridgeTowerModel"),xs=a(`. The default values here
are copied from RoBERTa. Instantiating a configuration with the defaults will yield a similar configuration to that
of the bridgetower-base `),zo=t("a"),$s=a("BridegTower/bridgetower-base"),ks=a(`
architecture.`),Ps=c(),se=t("p"),zs=a("Configuration objects inherit from "),br=t("a"),Is=a("PretrainedConfig"),Es=a(` and can be used to control the model outputs. Read the
documentation from `),vr=t("a"),Ms=a("PretrainedConfig"),js=a(" for more information."),Cs=c(),T(Ie.$$.fragment),dn=c(),ie=t("h2"),Ee=t("a"),st=t("span"),T(Io.$$.fragment),Fs=c(),it=t("span"),As=a("BridgeTowerVisionConfig"),ln=c(),C=t("div"),T(Eo.$$.fragment),qs=c(),de=t("p"),Ls=a("This is the configuration class to store the vision configuration of a "),yr=t("a"),Rs=a("BridgeTowerModel"),Os=a(`. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
`),Mo=t("a"),Ns=a("BridgeTower/bridgetower-base"),Ds=a(" architecture."),Ss=c(),le=t("p"),Ws=a("Configuration objects inherit from "),Br=t("a"),Vs=a("PretrainedConfig"),Us=a(` and can be used to control the model outputs. Read the
documentation from `),xr=t("a"),Gs=a("PretrainedConfig"),Hs=a(" for more information."),Xs=c(),T(Me.$$.fragment),cn=c(),ce=t("h2"),je=t("a"),dt=t("span"),T(jo.$$.fragment),Js=c(),lt=t("span"),Qs=a("BridgeTowerImageProcessor"),mn=c(),W=t("div"),T(Co.$$.fragment),Ys=c(),ct=t("p"),Ks=a("Constructs a BridgeTower image processor."),Zs=c(),Ce=t("div"),T(Fo.$$.fragment),ei=c(),mt=t("p"),oi=a("Preprocess an image or batch of images."),gn=c(),me=t("h2"),Fe=t("a"),gt=t("span"),T(Ao.$$.fragment),ri=c(),pt=t("span"),ti=a("BridgeTowerProcessor"),pn=c(),F=t("div"),T(qo.$$.fragment),ni=c(),ht=t("p"),ai=a(`Constructs a BridgeTower processor which wraps a Roberta tokenizer and BridgeTower image processor into a single
processor.`),si=c(),M=t("p"),$r=t("a"),ii=a("BridgeTowerProcessor"),di=a(" offers all the functionalities of "),kr=t("a"),li=a("BridgeTowerImageProcessor"),ci=a(` and
`),Pr=t("a"),mi=a("RobertaTokenizerFast"),gi=a(". See the docstring of "),Lo=t("a"),ft=t("strong"),pi=a("call"),hi=a("()"),fi=a(` and
`),ut=t("code"),ui=a("decode()"),_i=a(" for more information."),wi=c(),J=t("div"),T(Ro.$$.fragment),Ti=c(),ge=t("p"),bi=a("This method uses "),Ae=t("a"),vi=a("BridgeTowerImageProcessor."),_t=t("strong"),yi=a("call"),Bi=a("()"),xi=a(` method to prepare image(s) for the model, and
`),qe=t("a"),$i=a("RobertaTokenizerFast."),wt=t("strong"),ki=a("call"),Pi=a("()"),zi=a(" to prepare text for the model."),Ii=c(),Tt=t("p"),Ei=a("Please refer to the docstring of the above two methods for more information."),hn=c(),pe=t("h2"),Le=t("a"),bt=t("span"),T(Oo.$$.fragment),Mi=c(),vt=t("span"),ji=a("BridgeTowerModel"),fn=c(),V=t("div"),T(No.$$.fragment),Ci=c(),Do=t("p"),Fi=a(`The bare BridgeTower Model transformer outputting BridgeTowerModelOutput object without any specific head on top.
This model is a PyTorch `),yt=t("code"),Ai=a("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),qi=a(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Li=c(),O=t("div"),T(So.$$.fragment),Ri=c(),he=t("p"),Oi=a("The "),zr=t("a"),Ni=a("BridgeTowerModel"),Di=a(" forward method, overrides the "),Bt=t("code"),Si=a("__call__"),Wi=a(" special method."),Vi=c(),T(Re.$$.fragment),Ui=c(),T(Oe.$$.fragment),un=c(),fe=t("h2"),Ne=t("a"),xt=t("span"),T(Wo.$$.fragment),Gi=c(),$t=t("span"),Hi=a("BridgeTowerForMaskedLM"),_n=c(),A=t("div"),T(Vo.$$.fragment),Xi=c(),kt=t("p"),Ji=a("BridgeTower Model with a language modeling head on top as done during pretraining."),Qi=c(),Uo=t("p"),Yi=a("This model is a PyTorch "),Pt=t("code"),Ki=a("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Zi=a(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ed=c(),N=t("div"),T(Go.$$.fragment),od=c(),ue=t("p"),rd=a("The "),Ir=t("a"),td=a("BridgeTowerForMaskedLM"),nd=a(" forward method, overrides the "),zt=t("code"),ad=a("__call__"),sd=a(" special method."),id=c(),T(De.$$.fragment),dd=c(),T(Se.$$.fragment),wn=c(),_e=t("h2"),We=t("a"),It=t("span"),T(Ho.$$.fragment),ld=c(),Et=t("span"),cd=a("BridgeTowerForImageAndTextRetrieval"),Tn=c(),q=t("div"),T(Xo.$$.fragment),md=c(),Mt=t("p"),gd=a(`BridgeTower Model transformer with a classifier head on top (a linear layer on top of the final hidden state of the
[CLS] token) for image-to-text matching.`),pd=c(),Jo=t("p"),hd=a("This model is a PyTorch "),jt=t("code"),fd=a("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),ud=a(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_d=c(),D=t("div"),T(Qo.$$.fragment),wd=c(),we=t("p"),Td=a("The "),Er=t("a"),bd=a("BridgeTowerForImageAndTextRetrieval"),vd=a(" forward method, overrides the "),Ct=t("code"),yd=a("__call__"),Bd=a(" special method."),xd=c(),T(Ve.$$.fragment),$d=c(),T(Ue.$$.fragment),this.h()},l(o){const g=pc('[data-svelte="svelte-1phssyn"]',document.head);h=n(g,"META",{name:!0,content:!0}),g.forEach(r),$=m(o),_=n(o,"H1",{class:!0});var Yo=i(_);f=n(Yo,"A",{id:!0,class:!0,href:!0});var Ft=i(f);w=n(Ft,"SPAN",{});var At=i(w);b(d.$$.fragment,At),At.forEach(r),Ft.forEach(r),u=m(Yo),I=n(Yo,"SPAN",{});var qt=i(I);Sn=s(qt,"BridgeTower"),qt.forEach(r),Yo.forEach(r),Nt=m(o),Y=n(o,"H2",{class:!0});var Ko=i(Y);Te=n(Ko,"A",{id:!0,class:!0,href:!0});var Lt=i(Te);Qr=n(Lt,"SPAN",{});var Rt=i(Qr);b(to.$$.fragment,Rt),Rt.forEach(r),Lt.forEach(r),Wn=m(Ko),Yr=n(Ko,"SPAN",{});var Ot=i(Yr);Vn=s(Ot,"Overview"),Ot.forEach(r),Ko.forEach(r),Dt=m(o),be=n(o,"P",{});var Zo=i(be);Un=s(Zo,"The BridgeTower model was proposed in "),no=n(Zo,"A",{href:!0,rel:!0});var Ed=i(no);Gn=s(Ed,"BridgeTower: Building Bridges Between Encoders in Vision-Language Representative Learning"),Ed.forEach(r),Hn=s(Zo,` by Xiao Xu, Chenfei Wu, Shachar Rosenman, Vasudev Lal, Wanxiang Che, Nan Duan. The goal of this model is to build a
bridge between each uni-modal encoder and the cross-modal encoder to enable comprehensive and detailed interaction at each layer of the cross-modal encoder thus achieving remarkable performance on various downstream tasks with almost negligible additional performance and computational costs.`),Zo.forEach(r),St=m(o),ve=n(o,"P",{});var vn=i(ve);Xn=s(vn,"This paper has been accepted to the "),ao=n(vn,"A",{href:!0,rel:!0});var Md=i(ao);Jn=s(Md,"AAAI\u201923"),Md.forEach(r),Qn=s(vn," conference."),vn.forEach(r),Wt=m(o),er=n(o,"P",{});var jd=i(er);Yn=s(jd,"The abstract from the paper is the following:"),jd.forEach(r),Vt=m(o),or=n(o,"P",{});var Cd=i(or);Kr=n(Cd,"EM",{});var Fd=i(Kr);Kn=s(Fd,`Vision-Language (VL) models with the TWO-TOWER architecture have dominated visual-language representation learning in recent years.
Current VL models either use lightweight uni-modal encoders and learn to extract, align and fuse both modalities simultaneously in a deep cross-modal encoder, or feed the last-layer uni-modal representations from the deep pre-trained uni-modal encoders into the top cross-modal encoder.
Both approaches potentially restrict vision-language representation learning and limit model performance. In this paper, we propose BRIDGETOWER, which introduces multiple bridge layers that build a connection between the top layers of uni-modal encoders and each layer of the crossmodal encoder.
This enables effective bottom-up cross-modal alignment and fusion between visual and textual representations of different semantic levels of pre-trained uni-modal encoders in the cross-modal encoder. Pre-trained with only 4M images, BRIDGETOWER achieves state-of-the-art performance on various downstream vision-language tasks.
In particular, on the VQAv2 test-std set, BRIDGETOWER achieves an accuracy of 78.73%, outperforming the previous state-of-the-art model METER by 1.09% with the same pre-training data and almost negligible additional parameters and computational costs.
Notably, when further scaling the model, BRIDGETOWER achieves an accuracy of 81.15%, surpassing models that are pre-trained on orders-of-magnitude larger datasets.`),Fd.forEach(r),Cd.forEach(r),Ut=m(o),ye=n(o,"IMG",{src:!0,alt:!0,width:!0}),Gt=m(o),so=n(o,"SMALL",{});var kd=i(so);Zn=s(kd,"BridgeTower architecture. Taken from the "),rr=n(kd,"A",{href:!0});var Ad=i(rr);ea=s(Ad,"original paper."),Ad.forEach(r),kd.forEach(r),Ht=m(o),K=n(o,"H2",{class:!0});var yn=i(K);Be=n(yn,"A",{id:!0,class:!0,href:!0});var qd=i(Be);Zr=n(qd,"SPAN",{});var Ld=i(Zr);b(io.$$.fragment,Ld),Ld.forEach(r),qd.forEach(r),oa=m(yn),et=n(yn,"SPAN",{});var Rd=i(et);ra=s(Rd,"Usage"),Rd.forEach(r),yn.forEach(r),Xt=m(o),tr=n(o,"P",{});var Od=i(tr);ta=s(Od,`BridgeTower consists of a visual encoder, a textual encoder and cross-modal encoder with multiple lightweight bridge layers.
The goal of this approach was to build a bridge between each uni-modal encoder and the cross-modal encoder to enable comprehensive and detailed interaction at each layer of the cross-modal encoder.
In principle, one can apply any visual, textual or cross-modal encoder in the proposed architecture.`),Od.forEach(r),Jt=m(o),L=n(o,"P",{});var Ge=i(L);na=s(Ge,"The "),nr=n(Ge,"A",{href:!0});var Nd=i(nr);aa=s(Nd,"BridgeTowerProcessor"),Nd.forEach(r),sa=s(Ge," wraps "),ar=n(Ge,"A",{href:!0});var Dd=i(ar);ia=s(Dd,"RobertaTokenizer"),Dd.forEach(r),da=s(Ge," and "),sr=n(Ge,"A",{href:!0});var Sd=i(sr);la=s(Sd,"BridgeTowerImageProcessor"),Sd.forEach(r),ca=s(Ge,` into a single instance to both
encode the text and prepare the images respectively.`),Ge.forEach(r),Qt=m(o),H=n(o,"P",{});var Mr=i(H);ma=s(Mr,"The following example shows how to run image-text retrieval using "),ir=n(Mr,"A",{href:!0});var Wd=i(ir);ga=s(Wd,"BridgeTowerProcessor"),Wd.forEach(r),pa=s(Mr," and "),dr=n(Mr,"A",{href:!0});var Vd=i(dr);ha=s(Vd,"BridgeTowerForImageAndTextRetrieval"),Vd.forEach(r),fa=s(Mr,"."),Mr.forEach(r),Yt=m(o),b(lo.$$.fragment,o),Kt=m(o),X=n(o,"P",{});var jr=i(X);ua=s(jr,"The following example shows how to run masked language modeling using "),lr=n(jr,"A",{href:!0});var Ud=i(lr);_a=s(Ud,"BridgeTowerProcessor"),Ud.forEach(r),wa=s(jr," and "),cr=n(jr,"A",{href:!0});var Gd=i(cr);Ta=s(Gd,"BridgeTowerForMaskedLM"),Gd.forEach(r),ba=s(jr,"."),jr.forEach(r),Zt=m(o),b(co.$$.fragment,o),en=m(o),E=n(o,"P",{});var Q=i(E);va=s(Q,"This model was contributed by "),mo=n(Q,"A",{href:!0,rel:!0});var Hd=i(mo);ya=s(Hd,"Anahita Bhiwandiwalla"),Hd.forEach(r),Ba=s(Q,", "),go=n(Q,"A",{href:!0,rel:!0});var Xd=i(go);xa=s(Xd,"Tiep Le"),Xd.forEach(r),$a=s(Q," and "),po=n(Q,"A",{href:!0,rel:!0});var Jd=i(po);ka=s(Jd,"Shaoyen Tseng"),Jd.forEach(r),Pa=s(Q,". The original code can be found "),ho=n(Q,"A",{href:!0,rel:!0});var Qd=i(ho);za=s(Qd,"here"),Qd.forEach(r),Ia=s(Q,"."),Q.forEach(r),on=m(o),mr=n(o,"P",{});var Yd=i(mr);Ea=s(Yd,"Tips:"),Yd.forEach(r),rn=m(o),R=n(o,"UL",{});var He=i(R);fo=n(He,"LI",{});var Bn=i(fo);Ma=s(Bn,"This implementation of BridgeTower uses "),gr=n(Bn,"A",{href:!0});var Kd=i(gr);ja=s(Kd,"RobertaTokenizer"),Kd.forEach(r),Ca=s(Bn," to generate text embeddings and OpenAI\u2019s CLIP/ViT model to compute visual embeddings."),Bn.forEach(r),Fa=m(He),Z=n(He,"LI",{});var Cr=i(Z);Aa=s(Cr,"Checkpoints for pre-trained "),uo=n(Cr,"A",{href:!0,rel:!0});var Zd=i(uo);qa=s(Zd,"bridgeTower-base"),Zd.forEach(r),La=s(Cr," and "),_o=n(Cr,"A",{href:!0,rel:!0});var el=i(_o);Ra=s(el,"bridgetower masked language modeling and image text matching"),el.forEach(r),Oa=s(Cr," are released."),Cr.forEach(r),Na=m(He),wo=n(He,"LI",{});var xn=i(wo);Da=s(xn,"Please refer to "),To=n(xn,"A",{href:!0,rel:!0});var ol=i(To);Sa=s(ol,"Table 5"),ol.forEach(r),Wa=s(xn," for BridgeTower\u2019s performance on Image Retrieval and other down stream tasks."),xn.forEach(r),Va=m(He),ot=n(He,"LI",{});var rl=i(ot);Ua=s(rl,"The PyTorch version of this model is only available in torch 1.10 and higher."),rl.forEach(r),He.forEach(r),tn=m(o),ee=n(o,"H2",{class:!0});var $n=i(ee);xe=n($n,"A",{id:!0,class:!0,href:!0});var tl=i(xe);rt=n(tl,"SPAN",{});var nl=i(rt);b(bo.$$.fragment,nl),nl.forEach(r),tl.forEach(r),Ga=m($n),tt=n($n,"SPAN",{});var al=i(tt);Ha=s(al,"BridgeTowerConfig"),al.forEach(r),$n.forEach(r),nn=m(o),P=n(o,"DIV",{class:!0});var S=i(P);b(vo.$$.fragment,S),Xa=m(S),oe=n(S,"P",{});var Fr=i(oe);Ja=s(Fr,"This is the configuration class to store the configuration of a "),pr=n(Fr,"A",{href:!0});var sl=i(pr);Qa=s(sl,"BridgeTowerModel"),sl.forEach(r),Ya=s(Fr,`. It is used to instantiate a
BridgeTower model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
`),yo=n(Fr,"A",{href:!0,rel:!0});var il=i(yo);Ka=s(il,"BridgeTower/bridgetower-base"),il.forEach(r),Za=s(Fr," architecture."),Fr.forEach(r),es=m(S),re=n(S,"P",{});var Ar=i(re);os=s(Ar,"Configuration objects inherit from "),hr=n(Ar,"A",{href:!0});var dl=i(hr);rs=s(dl,"PretrainedConfig"),dl.forEach(r),ts=s(Ar,` and can be used to control the model outputs. Read the
documentation from `),fr=n(Ar,"A",{href:!0});var ll=i(fr);ns=s(ll,"PretrainedConfig"),ll.forEach(r),as=s(Ar," for more information."),Ar.forEach(r),ss=m(S),b($e.$$.fragment,S),is=m(S),ke=n(S,"DIV",{class:!0});var kn=i(ke);b(Bo.$$.fragment,kn),ds=m(kn),te=n(kn,"P",{});var qr=i(te);ls=s(qr,"Instantiate a "),ur=n(qr,"A",{href:!0});var cl=i(ur);cs=s(cl,"BridgeTowerConfig"),cl.forEach(r),ms=s(qr,` (or a derived class) from BridgeTower text model configuration. Returns:
`),_r=n(qr,"A",{href:!0});var ml=i(_r);gs=s(ml,"BridgeTowerConfig"),ml.forEach(r),ps=s(qr,": An instance of a configuration object"),qr.forEach(r),kn.forEach(r),hs=m(S),Pe=n(S,"DIV",{class:!0});var Pn=i(Pe);b(xo.$$.fragment,Pn),fs=m(Pn),$o=n(Pn,"P",{});var zn=i($o);us=s(zn,"Serializes this instance to a Python dictionary. Override the default "),wr=n(zn,"A",{href:!0});var gl=i(wr);_s=s(gl,"to_dict()"),gl.forEach(r),ws=s(zn,"."),zn.forEach(r),Pn.forEach(r),S.forEach(r),an=m(o),ne=n(o,"H2",{class:!0});var In=i(ne);ze=n(In,"A",{id:!0,class:!0,href:!0});var pl=i(ze);nt=n(pl,"SPAN",{});var hl=i(nt);b(ko.$$.fragment,hl),hl.forEach(r),pl.forEach(r),Ts=m(In),at=n(In,"SPAN",{});var fl=i(at);bs=s(fl,"BridgeTowerTextConfig"),fl.forEach(r),In.forEach(r),sn=m(o),j=n(o,"DIV",{class:!0});var Xe=i(j);b(Po.$$.fragment,Xe),vs=m(Xe),ae=n(Xe,"P",{});var Lr=i(ae);ys=s(Lr,"This is the configuration class to store the text configuration of a "),Tr=n(Lr,"A",{href:!0});var ul=i(Tr);Bs=s(ul,"BridgeTowerModel"),ul.forEach(r),xs=s(Lr,`. The default values here
are copied from RoBERTa. Instantiating a configuration with the defaults will yield a similar configuration to that
of the bridgetower-base `),zo=n(Lr,"A",{href:!0,rel:!0});var _l=i(zo);$s=s(_l,"BridegTower/bridgetower-base"),_l.forEach(r),ks=s(Lr,`
architecture.`),Lr.forEach(r),Ps=m(Xe),se=n(Xe,"P",{});var Rr=i(se);zs=s(Rr,"Configuration objects inherit from "),br=n(Rr,"A",{href:!0});var wl=i(br);Is=s(wl,"PretrainedConfig"),wl.forEach(r),Es=s(Rr,` and can be used to control the model outputs. Read the
documentation from `),vr=n(Rr,"A",{href:!0});var Tl=i(vr);Ms=s(Tl,"PretrainedConfig"),Tl.forEach(r),js=s(Rr," for more information."),Rr.forEach(r),Cs=m(Xe),b(Ie.$$.fragment,Xe),Xe.forEach(r),dn=m(o),ie=n(o,"H2",{class:!0});var En=i(ie);Ee=n(En,"A",{id:!0,class:!0,href:!0});var bl=i(Ee);st=n(bl,"SPAN",{});var vl=i(st);b(Io.$$.fragment,vl),vl.forEach(r),bl.forEach(r),Fs=m(En),it=n(En,"SPAN",{});var yl=i(it);As=s(yl,"BridgeTowerVisionConfig"),yl.forEach(r),En.forEach(r),ln=m(o),C=n(o,"DIV",{class:!0});var Je=i(C);b(Eo.$$.fragment,Je),qs=m(Je),de=n(Je,"P",{});var Or=i(de);Ls=s(Or,"This is the configuration class to store the vision configuration of a "),yr=n(Or,"A",{href:!0});var Bl=i(yr);Rs=s(Bl,"BridgeTowerModel"),Bl.forEach(r),Os=s(Or,`. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
`),Mo=n(Or,"A",{href:!0,rel:!0});var xl=i(Mo);Ns=s(xl,"BridgeTower/bridgetower-base"),xl.forEach(r),Ds=s(Or," architecture."),Or.forEach(r),Ss=m(Je),le=n(Je,"P",{});var Nr=i(le);Ws=s(Nr,"Configuration objects inherit from "),Br=n(Nr,"A",{href:!0});var $l=i(Br);Vs=s($l,"PretrainedConfig"),$l.forEach(r),Us=s(Nr,` and can be used to control the model outputs. Read the
documentation from `),xr=n(Nr,"A",{href:!0});var kl=i(xr);Gs=s(kl,"PretrainedConfig"),kl.forEach(r),Hs=s(Nr," for more information."),Nr.forEach(r),Xs=m(Je),b(Me.$$.fragment,Je),Je.forEach(r),cn=m(o),ce=n(o,"H2",{class:!0});var Mn=i(ce);je=n(Mn,"A",{id:!0,class:!0,href:!0});var Pl=i(je);dt=n(Pl,"SPAN",{});var zl=i(dt);b(jo.$$.fragment,zl),zl.forEach(r),Pl.forEach(r),Js=m(Mn),lt=n(Mn,"SPAN",{});var Il=i(lt);Qs=s(Il,"BridgeTowerImageProcessor"),Il.forEach(r),Mn.forEach(r),mn=m(o),W=n(o,"DIV",{class:!0});var Dr=i(W);b(Co.$$.fragment,Dr),Ys=m(Dr),ct=n(Dr,"P",{});var El=i(ct);Ks=s(El,"Constructs a BridgeTower image processor."),El.forEach(r),Zs=m(Dr),Ce=n(Dr,"DIV",{class:!0});var jn=i(Ce);b(Fo.$$.fragment,jn),ei=m(jn),mt=n(jn,"P",{});var Ml=i(mt);oi=s(Ml,"Preprocess an image or batch of images."),Ml.forEach(r),jn.forEach(r),Dr.forEach(r),gn=m(o),me=n(o,"H2",{class:!0});var Cn=i(me);Fe=n(Cn,"A",{id:!0,class:!0,href:!0});var jl=i(Fe);gt=n(jl,"SPAN",{});var Cl=i(gt);b(Ao.$$.fragment,Cl),Cl.forEach(r),jl.forEach(r),ri=m(Cn),pt=n(Cn,"SPAN",{});var Fl=i(pt);ti=s(Fl,"BridgeTowerProcessor"),Fl.forEach(r),Cn.forEach(r),pn=m(o),F=n(o,"DIV",{class:!0});var Qe=i(F);b(qo.$$.fragment,Qe),ni=m(Qe),ht=n(Qe,"P",{});var Al=i(ht);ai=s(Al,`Constructs a BridgeTower processor which wraps a Roberta tokenizer and BridgeTower image processor into a single
processor.`),Al.forEach(r),si=m(Qe),M=n(Qe,"P",{});var U=i(M);$r=n(U,"A",{href:!0});var ql=i($r);ii=s(ql,"BridgeTowerProcessor"),ql.forEach(r),di=s(U," offers all the functionalities of "),kr=n(U,"A",{href:!0});var Ll=i(kr);li=s(Ll,"BridgeTowerImageProcessor"),Ll.forEach(r),ci=s(U,` and
`),Pr=n(U,"A",{href:!0});var Rl=i(Pr);mi=s(Rl,"RobertaTokenizerFast"),Rl.forEach(r),gi=s(U,". See the docstring of "),Lo=n(U,"A",{href:!0});var Pd=i(Lo);ft=n(Pd,"STRONG",{});var Ol=i(ft);pi=s(Ol,"call"),Ol.forEach(r),hi=s(Pd,"()"),Pd.forEach(r),fi=s(U,` and
`),ut=n(U,"CODE",{});var Nl=i(ut);ui=s(Nl,"decode()"),Nl.forEach(r),_i=s(U," for more information."),U.forEach(r),wi=m(Qe),J=n(Qe,"DIV",{class:!0});var Sr=i(J);b(Ro.$$.fragment,Sr),Ti=m(Sr),ge=n(Sr,"P",{});var Wr=i(ge);bi=s(Wr,"This method uses "),Ae=n(Wr,"A",{href:!0});var Fn=i(Ae);vi=s(Fn,"BridgeTowerImageProcessor."),_t=n(Fn,"STRONG",{});var Dl=i(_t);yi=s(Dl,"call"),Dl.forEach(r),Bi=s(Fn,"()"),Fn.forEach(r),xi=s(Wr,` method to prepare image(s) for the model, and
`),qe=n(Wr,"A",{href:!0});var An=i(qe);$i=s(An,"RobertaTokenizerFast."),wt=n(An,"STRONG",{});var Sl=i(wt);ki=s(Sl,"call"),Sl.forEach(r),Pi=s(An,"()"),An.forEach(r),zi=s(Wr," to prepare text for the model."),Wr.forEach(r),Ii=m(Sr),Tt=n(Sr,"P",{});var Wl=i(Tt);Ei=s(Wl,"Please refer to the docstring of the above two methods for more information."),Wl.forEach(r),Sr.forEach(r),Qe.forEach(r),hn=m(o),pe=n(o,"H2",{class:!0});var qn=i(pe);Le=n(qn,"A",{id:!0,class:!0,href:!0});var Vl=i(Le);bt=n(Vl,"SPAN",{});var Ul=i(bt);b(Oo.$$.fragment,Ul),Ul.forEach(r),Vl.forEach(r),Mi=m(qn),vt=n(qn,"SPAN",{});var Gl=i(vt);ji=s(Gl,"BridgeTowerModel"),Gl.forEach(r),qn.forEach(r),fn=m(o),V=n(o,"DIV",{class:!0});var Vr=i(V);b(No.$$.fragment,Vr),Ci=m(Vr),Do=n(Vr,"P",{});var Ln=i(Do);Fi=s(Ln,`The bare BridgeTower Model transformer outputting BridgeTowerModelOutput object without any specific head on top.
This model is a PyTorch `),yt=n(Ln,"CODE",{});var Hl=i(yt);Ai=s(Hl,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Hl.forEach(r),qi=s(Ln,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ln.forEach(r),Li=m(Vr),O=n(Vr,"DIV",{class:!0});var Ye=i(O);b(So.$$.fragment,Ye),Ri=m(Ye),he=n(Ye,"P",{});var Ur=i(he);Oi=s(Ur,"The "),zr=n(Ur,"A",{href:!0});var Xl=i(zr);Ni=s(Xl,"BridgeTowerModel"),Xl.forEach(r),Di=s(Ur," forward method, overrides the "),Bt=n(Ur,"CODE",{});var Jl=i(Bt);Si=s(Jl,"__call__"),Jl.forEach(r),Wi=s(Ur," special method."),Ur.forEach(r),Vi=m(Ye),b(Re.$$.fragment,Ye),Ui=m(Ye),b(Oe.$$.fragment,Ye),Ye.forEach(r),Vr.forEach(r),un=m(o),fe=n(o,"H2",{class:!0});var Rn=i(fe);Ne=n(Rn,"A",{id:!0,class:!0,href:!0});var Ql=i(Ne);xt=n(Ql,"SPAN",{});var Yl=i(xt);b(Wo.$$.fragment,Yl),Yl.forEach(r),Ql.forEach(r),Gi=m(Rn),$t=n(Rn,"SPAN",{});var Kl=i($t);Hi=s(Kl,"BridgeTowerForMaskedLM"),Kl.forEach(r),Rn.forEach(r),_n=m(o),A=n(o,"DIV",{class:!0});var Ke=i(A);b(Vo.$$.fragment,Ke),Xi=m(Ke),kt=n(Ke,"P",{});var Zl=i(kt);Ji=s(Zl,"BridgeTower Model with a language modeling head on top as done during pretraining."),Zl.forEach(r),Qi=m(Ke),Uo=n(Ke,"P",{});var On=i(Uo);Yi=s(On,"This model is a PyTorch "),Pt=n(On,"CODE",{});var ec=i(Pt);Ki=s(ec,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),ec.forEach(r),Zi=s(On,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),On.forEach(r),ed=m(Ke),N=n(Ke,"DIV",{class:!0});var Ze=i(N);b(Go.$$.fragment,Ze),od=m(Ze),ue=n(Ze,"P",{});var Gr=i(ue);rd=s(Gr,"The "),Ir=n(Gr,"A",{href:!0});var oc=i(Ir);td=s(oc,"BridgeTowerForMaskedLM"),oc.forEach(r),nd=s(Gr," forward method, overrides the "),zt=n(Gr,"CODE",{});var rc=i(zt);ad=s(rc,"__call__"),rc.forEach(r),sd=s(Gr," special method."),Gr.forEach(r),id=m(Ze),b(De.$$.fragment,Ze),dd=m(Ze),b(Se.$$.fragment,Ze),Ze.forEach(r),Ke.forEach(r),wn=m(o),_e=n(o,"H2",{class:!0});var Nn=i(_e);We=n(Nn,"A",{id:!0,class:!0,href:!0});var tc=i(We);It=n(tc,"SPAN",{});var nc=i(It);b(Ho.$$.fragment,nc),nc.forEach(r),tc.forEach(r),ld=m(Nn),Et=n(Nn,"SPAN",{});var ac=i(Et);cd=s(ac,"BridgeTowerForImageAndTextRetrieval"),ac.forEach(r),Nn.forEach(r),Tn=m(o),q=n(o,"DIV",{class:!0});var eo=i(q);b(Xo.$$.fragment,eo),md=m(eo),Mt=n(eo,"P",{});var sc=i(Mt);gd=s(sc,`BridgeTower Model transformer with a classifier head on top (a linear layer on top of the final hidden state of the
[CLS] token) for image-to-text matching.`),sc.forEach(r),pd=m(eo),Jo=n(eo,"P",{});var Dn=i(Jo);hd=s(Dn,"This model is a PyTorch "),jt=n(Dn,"CODE",{});var ic=i(jt);fd=s(ic,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),ic.forEach(r),ud=s(Dn,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dn.forEach(r),_d=m(eo),D=n(eo,"DIV",{class:!0});var oo=i(D);b(Qo.$$.fragment,oo),wd=m(oo),we=n(oo,"P",{});var Hr=i(we);Td=s(Hr,"The "),Er=n(Hr,"A",{href:!0});var dc=i(Er);bd=s(dc,"BridgeTowerForImageAndTextRetrieval"),dc.forEach(r),vd=s(Hr," forward method, overrides the "),Ct=n(Hr,"CODE",{});var lc=i(Ct);yd=s(lc,"__call__"),lc.forEach(r),Bd=s(Hr," special method."),Hr.forEach(r),xd=m(oo),b(Ve.$$.fragment,oo),$d=m(oo),b(Ue.$$.fragment,oo),oo.forEach(r),eo.forEach(r),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(kc)),l(f,"id","bridgetower"),l(f,"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"),l(f,"href","#bridgetower"),l(_,"class","relative group"),l(Te,"id","overview"),l(Te,"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"),l(Te,"href","#overview"),l(Y,"class","relative group"),l(no,"href","https://arxiv.org/abs/2206.08657"),l(no,"rel","nofollow"),l(ao,"href","https://aaai.org/Conferences/AAAI-23/"),l(ao,"rel","nofollow"),hc(ye.src,Id="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/bridgetower_architecture%20.jpg")||l(ye,"src",Id),l(ye,"alt","drawing"),l(ye,"width","600"),l(rr,"href","https://arxiv.org/abs/2206.08657"),l(Be,"id","usage"),l(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"),l(Be,"href","#usage"),l(K,"class","relative group"),l(nr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(ar,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizer"),l(sr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor"),l(ir,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(dr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerForImageAndTextRetrieval"),l(lr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(cr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerForMaskedLM"),l(mo,"href","https://huggingface.co/anahita-b"),l(mo,"rel","nofollow"),l(go,"href","https://huggingface.co/Tile"),l(go,"rel","nofollow"),l(po,"href","https://huggingface.co/shaoyent"),l(po,"rel","nofollow"),l(ho,"href","https://github.com/microsoft/BridgeTower"),l(ho,"rel","nofollow"),l(gr,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizer"),l(uo,"href","https://huggingface.co/BridgeTower/bridgetower-base"),l(uo,"rel","nofollow"),l(_o,"href","https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm"),l(_o,"rel","nofollow"),l(To,"href","https://arxiv.org/pdf/2206.08657.pdf"),l(To,"rel","nofollow"),l(xe,"id","transformers.BridgeTowerConfig"),l(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"),l(xe,"href","#transformers.BridgeTowerConfig"),l(ee,"class","relative group"),l(pr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(yo,"href","https://huggingface.co/BridgeTower/bridgetower-base/"),l(yo,"rel","nofollow"),l(hr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(fr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(ur,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig"),l(_r,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerConfig"),l(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(wr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),l(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"id","transformers.BridgeTowerTextConfig"),l(ze,"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"),l(ze,"href","#transformers.BridgeTowerTextConfig"),l(ne,"class","relative group"),l(Tr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(zo,"href","https://huggingface.co/BridgeTower/bridgetower-base/"),l(zo,"rel","nofollow"),l(br,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(vr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ee,"id","transformers.BridgeTowerVisionConfig"),l(Ee,"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"),l(Ee,"href","#transformers.BridgeTowerVisionConfig"),l(ie,"class","relative group"),l(yr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(Mo,"href","https://huggingface.co/BridgeTower/bridgetower-base/"),l(Mo,"rel","nofollow"),l(Br,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(xr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(je,"id","transformers.BridgeTowerImageProcessor"),l(je,"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"),l(je,"href","#transformers.BridgeTowerImageProcessor"),l(ce,"class","relative group"),l(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Fe,"id","transformers.BridgeTowerProcessor"),l(Fe,"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"),l(Fe,"href","#transformers.BridgeTowerProcessor"),l(me,"class","relative group"),l($r,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(kr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor"),l(Pr,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaTokenizerFast"),l(Lo,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerProcessor.__call__"),l(Ae,"href","/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__"),l(qe,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Le,"id","transformers.BridgeTowerModel"),l(Le,"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"),l(Le,"href","#transformers.BridgeTowerModel"),l(pe,"class","relative group"),l(zr,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ne,"id","transformers.BridgeTowerForMaskedLM"),l(Ne,"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"),l(Ne,"href","#transformers.BridgeTowerForMaskedLM"),l(fe,"class","relative group"),l(Ir,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerForMaskedLM"),l(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(We,"id","transformers.BridgeTowerForImageAndTextRetrieval"),l(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"),l(We,"href","#transformers.BridgeTowerForImageAndTextRetrieval"),l(_e,"class","relative group"),l(Er,"href","/docs/transformers/main/en/model_doc/bridgetower#transformers.BridgeTowerForImageAndTextRetrieval"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,h),p(o,$,g),p(o,_,g),e(_,f),e(f,w),v(d,w,null),e(_,u),e(_,I),e(I,Sn),p(o,Nt,g),p(o,Y,g),e(Y,Te),e(Te,Qr),v(to,Qr,null),e(Y,Wn),e(Y,Yr),e(Yr,Vn),p(o,Dt,g),p(o,be,g),e(be,Un),e(be,no),e(no,Gn),e(be,Hn),p(o,St,g),p(o,ve,g),e(ve,Xn),e(ve,ao),e(ao,Jn),e(ve,Qn),p(o,Wt,g),p(o,er,g),e(er,Yn),p(o,Vt,g),p(o,or,g),e(or,Kr),e(Kr,Kn),p(o,Ut,g),p(o,ye,g),p(o,Gt,g),p(o,so,g),e(so,Zn),e(so,rr),e(rr,ea),p(o,Ht,g),p(o,K,g),e(K,Be),e(Be,Zr),v(io,Zr,null),e(K,oa),e(K,et),e(et,ra),p(o,Xt,g),p(o,tr,g),e(tr,ta),p(o,Jt,g),p(o,L,g),e(L,na),e(L,nr),e(nr,aa),e(L,sa),e(L,ar),e(ar,ia),e(L,da),e(L,sr),e(sr,la),e(L,ca),p(o,Qt,g),p(o,H,g),e(H,ma),e(H,ir),e(ir,ga),e(H,pa),e(H,dr),e(dr,ha),e(H,fa),p(o,Yt,g),v(lo,o,g),p(o,Kt,g),p(o,X,g),e(X,ua),e(X,lr),e(lr,_a),e(X,wa),e(X,cr),e(cr,Ta),e(X,ba),p(o,Zt,g),v(co,o,g),p(o,en,g),p(o,E,g),e(E,va),e(E,mo),e(mo,ya),e(E,Ba),e(E,go),e(go,xa),e(E,$a),e(E,po),e(po,ka),e(E,Pa),e(E,ho),e(ho,za),e(E,Ia),p(o,on,g),p(o,mr,g),e(mr,Ea),p(o,rn,g),p(o,R,g),e(R,fo),e(fo,Ma),e(fo,gr),e(gr,ja),e(fo,Ca),e(R,Fa),e(R,Z),e(Z,Aa),e(Z,uo),e(uo,qa),e(Z,La),e(Z,_o),e(_o,Ra),e(Z,Oa),e(R,Na),e(R,wo),e(wo,Da),e(wo,To),e(To,Sa),e(wo,Wa),e(R,Va),e(R,ot),e(ot,Ua),p(o,tn,g),p(o,ee,g),e(ee,xe),e(xe,rt),v(bo,rt,null),e(ee,Ga),e(ee,tt),e(tt,Ha),p(o,nn,g),p(o,P,g),v(vo,P,null),e(P,Xa),e(P,oe),e(oe,Ja),e(oe,pr),e(pr,Qa),e(oe,Ya),e(oe,yo),e(yo,Ka),e(oe,Za),e(P,es),e(P,re),e(re,os),e(re,hr),e(hr,rs),e(re,ts),e(re,fr),e(fr,ns),e(re,as),e(P,ss),v($e,P,null),e(P,is),e(P,ke),v(Bo,ke,null),e(ke,ds),e(ke,te),e(te,ls),e(te,ur),e(ur,cs),e(te,ms),e(te,_r),e(_r,gs),e(te,ps),e(P,hs),e(P,Pe),v(xo,Pe,null),e(Pe,fs),e(Pe,$o),e($o,us),e($o,wr),e(wr,_s),e($o,ws),p(o,an,g),p(o,ne,g),e(ne,ze),e(ze,nt),v(ko,nt,null),e(ne,Ts),e(ne,at),e(at,bs),p(o,sn,g),p(o,j,g),v(Po,j,null),e(j,vs),e(j,ae),e(ae,ys),e(ae,Tr),e(Tr,Bs),e(ae,xs),e(ae,zo),e(zo,$s),e(ae,ks),e(j,Ps),e(j,se),e(se,zs),e(se,br),e(br,Is),e(se,Es),e(se,vr),e(vr,Ms),e(se,js),e(j,Cs),v(Ie,j,null),p(o,dn,g),p(o,ie,g),e(ie,Ee),e(Ee,st),v(Io,st,null),e(ie,Fs),e(ie,it),e(it,As),p(o,ln,g),p(o,C,g),v(Eo,C,null),e(C,qs),e(C,de),e(de,Ls),e(de,yr),e(yr,Rs),e(de,Os),e(de,Mo),e(Mo,Ns),e(de,Ds),e(C,Ss),e(C,le),e(le,Ws),e(le,Br),e(Br,Vs),e(le,Us),e(le,xr),e(xr,Gs),e(le,Hs),e(C,Xs),v(Me,C,null),p(o,cn,g),p(o,ce,g),e(ce,je),e(je,dt),v(jo,dt,null),e(ce,Js),e(ce,lt),e(lt,Qs),p(o,mn,g),p(o,W,g),v(Co,W,null),e(W,Ys),e(W,ct),e(ct,Ks),e(W,Zs),e(W,Ce),v(Fo,Ce,null),e(Ce,ei),e(Ce,mt),e(mt,oi),p(o,gn,g),p(o,me,g),e(me,Fe),e(Fe,gt),v(Ao,gt,null),e(me,ri),e(me,pt),e(pt,ti),p(o,pn,g),p(o,F,g),v(qo,F,null),e(F,ni),e(F,ht),e(ht,ai),e(F,si),e(F,M),e(M,$r),e($r,ii),e(M,di),e(M,kr),e(kr,li),e(M,ci),e(M,Pr),e(Pr,mi),e(M,gi),e(M,Lo),e(Lo,ft),e(ft,pi),e(Lo,hi),e(M,fi),e(M,ut),e(ut,ui),e(M,_i),e(F,wi),e(F,J),v(Ro,J,null),e(J,Ti),e(J,ge),e(ge,bi),e(ge,Ae),e(Ae,vi),e(Ae,_t),e(_t,yi),e(Ae,Bi),e(ge,xi),e(ge,qe),e(qe,$i),e(qe,wt),e(wt,ki),e(qe,Pi),e(ge,zi),e(J,Ii),e(J,Tt),e(Tt,Ei),p(o,hn,g),p(o,pe,g),e(pe,Le),e(Le,bt),v(Oo,bt,null),e(pe,Mi),e(pe,vt),e(vt,ji),p(o,fn,g),p(o,V,g),v(No,V,null),e(V,Ci),e(V,Do),e(Do,Fi),e(Do,yt),e(yt,Ai),e(Do,qi),e(V,Li),e(V,O),v(So,O,null),e(O,Ri),e(O,he),e(he,Oi),e(he,zr),e(zr,Ni),e(he,Di),e(he,Bt),e(Bt,Si),e(he,Wi),e(O,Vi),v(Re,O,null),e(O,Ui),v(Oe,O,null),p(o,un,g),p(o,fe,g),e(fe,Ne),e(Ne,xt),v(Wo,xt,null),e(fe,Gi),e(fe,$t),e($t,Hi),p(o,_n,g),p(o,A,g),v(Vo,A,null),e(A,Xi),e(A,kt),e(kt,Ji),e(A,Qi),e(A,Uo),e(Uo,Yi),e(Uo,Pt),e(Pt,Ki),e(Uo,Zi),e(A,ed),e(A,N),v(Go,N,null),e(N,od),e(N,ue),e(ue,rd),e(ue,Ir),e(Ir,td),e(ue,nd),e(ue,zt),e(zt,ad),e(ue,sd),e(N,id),v(De,N,null),e(N,dd),v(Se,N,null),p(o,wn,g),p(o,_e,g),e(_e,We),e(We,It),v(Ho,It,null),e(_e,ld),e(_e,Et),e(Et,cd),p(o,Tn,g),p(o,q,g),v(Xo,q,null),e(q,md),e(q,Mt),e(Mt,gd),e(q,pd),e(q,Jo),e(Jo,hd),e(Jo,jt),e(jt,fd),e(Jo,ud),e(q,_d),e(q,D),v(Qo,D,null),e(D,wd),e(D,we),e(we,Td),e(we,Er),e(Er,bd),e(we,vd),e(we,Ct),e(Ct,yd),e(we,Bd),e(D,xd),v(Ve,D,null),e(D,$d),v(Ue,D,null),bn=!0},p(o,[g]){const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:o}),$e.$set(Yo);const Ft={};g&2&&(Ft.$$scope={dirty:g,ctx:o}),Ie.$set(Ft);const At={};g&2&&(At.$$scope={dirty:g,ctx:o}),Me.$set(At);const qt={};g&2&&(qt.$$scope={dirty:g,ctx:o}),Re.$set(qt);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:o}),Oe.$set(Ko);const Lt={};g&2&&(Lt.$$scope={dirty:g,ctx:o}),De.$set(Lt);const Rt={};g&2&&(Rt.$$scope={dirty:g,ctx:o}),Se.$set(Rt);const Ot={};g&2&&(Ot.$$scope={dirty:g,ctx:o}),Ve.$set(Ot);const Zo={};g&2&&(Zo.$$scope={dirty:g,ctx:o}),Ue.$set(Zo)},i(o){bn||(y(d.$$.fragment,o),y(to.$$.fragment,o),y(io.$$.fragment,o),y(lo.$$.fragment,o),y(co.$$.fragment,o),y(bo.$$.fragment,o),y(vo.$$.fragment,o),y($e.$$.fragment,o),y(Bo.$$.fragment,o),y(xo.$$.fragment,o),y(ko.$$.fragment,o),y(Po.$$.fragment,o),y(Ie.$$.fragment,o),y(Io.$$.fragment,o),y(Eo.$$.fragment,o),y(Me.$$.fragment,o),y(jo.$$.fragment,o),y(Co.$$.fragment,o),y(Fo.$$.fragment,o),y(Ao.$$.fragment,o),y(qo.$$.fragment,o),y(Ro.$$.fragment,o),y(Oo.$$.fragment,o),y(No.$$.fragment,o),y(So.$$.fragment,o),y(Re.$$.fragment,o),y(Oe.$$.fragment,o),y(Wo.$$.fragment,o),y(Vo.$$.fragment,o),y(Go.$$.fragment,o),y(De.$$.fragment,o),y(Se.$$.fragment,o),y(Ho.$$.fragment,o),y(Xo.$$.fragment,o),y(Qo.$$.fragment,o),y(Ve.$$.fragment,o),y(Ue.$$.fragment,o),bn=!0)},o(o){B(d.$$.fragment,o),B(to.$$.fragment,o),B(io.$$.fragment,o),B(lo.$$.fragment,o),B(co.$$.fragment,o),B(bo.$$.fragment,o),B(vo.$$.fragment,o),B($e.$$.fragment,o),B(Bo.$$.fragment,o),B(xo.$$.fragment,o),B(ko.$$.fragment,o),B(Po.$$.fragment,o),B(Ie.$$.fragment,o),B(Io.$$.fragment,o),B(Eo.$$.fragment,o),B(Me.$$.fragment,o),B(jo.$$.fragment,o),B(Co.$$.fragment,o),B(Fo.$$.fragment,o),B(Ao.$$.fragment,o),B(qo.$$.fragment,o),B(Ro.$$.fragment,o),B(Oo.$$.fragment,o),B(No.$$.fragment,o),B(So.$$.fragment,o),B(Re.$$.fragment,o),B(Oe.$$.fragment,o),B(Wo.$$.fragment,o),B(Vo.$$.fragment,o),B(Go.$$.fragment,o),B(De.$$.fragment,o),B(Se.$$.fragment,o),B(Ho.$$.fragment,o),B(Xo.$$.fragment,o),B(Qo.$$.fragment,o),B(Ve.$$.fragment,o),B(Ue.$$.fragment,o),bn=!1},d(o){r(h),o&&r($),o&&r(_),x(d),o&&r(Nt),o&&r(Y),x(to),o&&r(Dt),o&&r(be),o&&r(St),o&&r(ve),o&&r(Wt),o&&r(er),o&&r(Vt),o&&r(or),o&&r(Ut),o&&r(ye),o&&r(Gt),o&&r(so),o&&r(Ht),o&&r(K),x(io),o&&r(Xt),o&&r(tr),o&&r(Jt),o&&r(L),o&&r(Qt),o&&r(H),o&&r(Yt),x(lo,o),o&&r(Kt),o&&r(X),o&&r(Zt),x(co,o),o&&r(en),o&&r(E),o&&r(on),o&&r(mr),o&&r(rn),o&&r(R),o&&r(tn),o&&r(ee),x(bo),o&&r(nn),o&&r(P),x(vo),x($e),x(Bo),x(xo),o&&r(an),o&&r(ne),x(ko),o&&r(sn),o&&r(j),x(Po),x(Ie),o&&r(dn),o&&r(ie),x(Io),o&&r(ln),o&&r(C),x(Eo),x(Me),o&&r(cn),o&&r(ce),x(jo),o&&r(mn),o&&r(W),x(Co),x(Fo),o&&r(gn),o&&r(me),x(Ao),o&&r(pn),o&&r(F),x(qo),x(Ro),o&&r(hn),o&&r(pe),x(Oo),o&&r(fn),o&&r(V),x(No),x(So),x(Re),x(Oe),o&&r(un),o&&r(fe),x(Wo),o&&r(_n),o&&r(A),x(Vo),x(Go),x(De),x(Se),o&&r(wn),o&&r(_e),x(Ho),o&&r(Tn),o&&r(q),x(Xo),x(Qo),x(Ve),x(Ue)}}}const kc={local:"bridgetower",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"transformers.BridgeTowerConfig",title:"BridgeTowerConfig"},{local:"transformers.BridgeTowerTextConfig",title:"BridgeTowerTextConfig"},{local:"transformers.BridgeTowerVisionConfig",title:"BridgeTowerVisionConfig"},{local:"transformers.BridgeTowerImageProcessor",title:"BridgeTowerImageProcessor"},{local:"transformers.BridgeTowerProcessor",title:"BridgeTowerProcessor"},{local:"transformers.BridgeTowerModel",title:"BridgeTowerModel"},{local:"transformers.BridgeTowerForMaskedLM",title:"BridgeTowerForMaskedLM"},{local:"transformers.BridgeTowerForImageAndTextRetrieval",title:"BridgeTowerForImageAndTextRetrieval"}],title:"BridgeTower"};function Pc(k){return fc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fc extends cc{constructor(h){super();mc(this,h,Pc,$c,gc,{})}}export{Fc as default,kc as metadata};
