import{S as wm,i as Tm,s as vm,e as s,k as c,w as T,t,M as bm,c as a,d as r,m,a as i,x as v,h as n,b as l,N as ym,G as e,g as h,y as b,q as y,o as B,B as x,v as Bm,L as _r}from"../../chunks/vendor-hf-doc-builder.js";import{T as vs}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ee}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as U}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ur}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xm($){let p,k,_,f,w;return f=new ee({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(){p=s("p"),k=t("Example:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Example:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function km($){let p,k,_,f,w;return f=new ee({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(){p=s("p"),k=t("Example:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Example:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function $m($){let p,k,_,f,w;return f=new ee({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(){p=s("p"),k=t("Example:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Example:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function Pm($){let p,k,_,f,w;return{c(){p=s("p"),k=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),f=t("Module"),w=t(`
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){p=a(d,"P",{});var u=i(p);k=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var P=i(_);f=n(P,"Module"),P.forEach(r),w=n(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){h(d,p,u),e(p,k),e(p,_),e(_,f),e(p,w)},d(d){d&&r(p)}}}function jm($){let p,k,_,f,w;return f=new ee({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(){p=s("p"),k=t("Examples:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Examples:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function zm($){let p,k,_,f,w;return{c(){p=s("p"),k=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),f=t("Module"),w=t(`
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){p=a(d,"P",{});var u=i(p);k=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var P=i(_);f=n(P,"Module"),P.forEach(r),w=n(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){h(d,p,u),e(p,k),e(p,_),e(_,f),e(p,w)},d(d){d&&r(p)}}}function Im($){let p,k,_,f,w;return f=new ee({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerForContrastiveLearning
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"

processor = BridgeTowerProcessor.from_pretrained("BridgeTower/bridgetower-large-itm-mlm-itc")
model = BridgeTowerForContrastiveLearning.from_pretrained("BridgeTower/bridgetower-large-itm-mlm-itc")
outputs = model(**inputs, output_hidden_states=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerForContrastiveLearning
<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-meta">&gt;&gt;&gt; </span>processor = BridgeTowerProcessor.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-large-itm-mlm-itc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerForContrastiveLearning.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-large-itm-mlm-itc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, output_hidden_states=<span class="hljs-literal">True</span>)`}}),{c(){p=s("p"),k=t("Examples:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Examples:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function Em($){let p,k,_,f,w;return{c(){p=s("p"),k=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),f=t("Module"),w=t(`
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){p=a(d,"P",{});var u=i(p);k=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var P=i(_);f=n(P,"Module"),P.forEach(r),w=n(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){h(d,p,u),e(p,k),e(p,_),e(_,f),e(p,w)},d(d){d&&r(p)}}}function Cm($){let p,k,_,f,w;return f=new ee({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(){p=s("p"),k=t("Examples:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Examples:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function Mm($){let p,k,_,f,w;return{c(){p=s("p"),k=t("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),f=t("Module"),w=t(`
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){p=a(d,"P",{});var u=i(p);k=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var P=i(_);f=n(P,"Module"),P.forEach(r),w=n(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){h(d,p,u),e(p,k),e(p,_),e(_,f),e(p,w)},d(d){d&&r(p)}}}function Fm($){let p,k,_,f,w;return f=new ee({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(){p=s("p"),k=t("Examples:"),_=c(),T(f.$$.fragment)},l(d){p=a(d,"P",{});var u=i(p);k=n(u,"Examples:"),u.forEach(r),_=m(d),v(f.$$.fragment,d)},m(d,u){h(d,p,u),e(p,k),h(d,_,u),b(f,d,u),w=!0},p:_r,i(d){w||(y(f.$$.fragment,d),w=!0)},o(d){B(f.$$.fragment,d),w=!1},d(d){d&&r(p),d&&r(_),x(f,d)}}}function Lm($){let p,k,_,f,w,d,u,P,bs,hn,oe,ke,_t,ho,ys,wt,Bs,fn,$e,xs,fo,ks,$s,un,Pe,Ps,uo,js,zs,_n,wr,Is,wn,Tr,Tt,Es,Tn,je,zl,vn,_o,Cs,vr,Ms,bn,re,ze,vt,wo,Fs,bt,Ls,yn,br,As,Bn,O,qs,yr,Os,Rs,Br,Ns,Ds,xr,Ss,Ws,xn,J,Vs,kr,Us,Gs,$r,Hs,Xs,kn,To,$n,Q,Js,Pr,Qs,Ys,jr,Ks,Zs,Pn,vo,jn,Y,ea,zr,oa,ra,Ir,ta,na,zn,bo,In,I,sa,yo,aa,ia,Bo,da,la,xo,ca,ma,ko,ga,pa,En,Er,ha,Cn,R,$o,fa,Cr,ua,_a,wa,te,Ta,Po,va,ba,jo,ya,Ba,xa,zo,ka,Io,$a,Pa,ja,yt,za,Mn,ne,Ie,Bt,Eo,Ia,xt,Ea,Fn,j,Co,Ca,se,Ma,Mr,Fa,La,Mo,Aa,qa,Oa,ae,Ra,Fr,Na,Da,Lr,Sa,Wa,Va,Ee,Ua,Ce,Fo,Ga,ie,Ha,Ar,Xa,Ja,qr,Qa,Ya,Ka,Me,Lo,Za,Ao,ei,Or,oi,ri,Ln,de,Fe,kt,qo,ti,$t,ni,An,C,Oo,si,le,ai,Rr,ii,di,Ro,li,ci,mi,ce,gi,Nr,pi,hi,Dr,fi,ui,_i,Le,qn,me,Ae,Pt,No,wi,jt,Ti,On,M,Do,vi,ge,bi,Sr,yi,Bi,So,xi,ki,$i,pe,Pi,Wr,ji,zi,Vr,Ii,Ei,Ci,qe,Rn,he,Oe,zt,Wo,Mi,It,Fi,Nn,G,Vo,Li,Et,Ai,qi,Re,Uo,Oi,Ct,Ri,Dn,fe,Ne,Mt,Go,Ni,Ft,Di,Sn,F,Ho,Si,Lt,Wi,Vi,E,Ur,Ui,Gi,Gr,Hi,Xi,Hr,Ji,Qi,Xo,At,Yi,Ki,Zi,qt,ed,od,rd,K,Jo,td,ue,nd,De,sd,Ot,ad,id,dd,Se,ld,Rt,cd,md,gd,pd,Nt,hd,Wn,_e,We,Dt,Qo,fd,St,ud,Vn,H,Yo,_d,Ko,wd,Wt,Td,vd,bd,N,Zo,yd,we,Bd,Xr,xd,kd,Vt,$d,Pd,jd,Ve,zd,Ue,Un,Te,Ge,Ut,er,Id,Gt,Ed,Gn,L,or,Cd,Ht,Md,Fd,rr,Ld,Xt,Ad,qd,Od,D,tr,Rd,ve,Nd,Jr,Dd,Sd,Jt,Wd,Vd,Ud,He,Gd,Xe,Hn,be,Je,Qt,nr,Hd,Yt,Xd,Xn,A,sr,Jd,Kt,Qd,Yd,ar,Kd,Zt,Zd,el,ol,S,ir,rl,ye,tl,Qr,nl,sl,en,al,il,dl,Qe,ll,Ye,Jn,Be,Ke,on,dr,cl,rn,ml,Qn,q,lr,gl,tn,pl,hl,cr,fl,nn,ul,_l,wl,W,mr,Tl,xe,vl,Yr,bl,yl,sn,Bl,xl,kl,Ze,$l,eo,Yn;return d=new U({}),ho=new U({}),wo=new U({}),To=new ee({props:{code:`from transformers import BridgeTowerProcessor, BridgeTowerForContrastiveLearning
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-large-itm-mlm-itc")
model = BridgeTowerForContrastiveLearning.from_pretrained("BridgeTower/bridgetower-large-itm-mlm-itc")

# forward pass
scores = dict()
for text in texts:
    # prepare inputs
    encoding = processor(image, text, return_tensors="pt")
    outputs = model(**encoding)
    scores[text] = outputs`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BridgeTowerProcessor, BridgeTowerForContrastiveLearning
<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-large-itm-mlm-itc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BridgeTowerForContrastiveLearning.from_pretrained(<span class="hljs-string">&quot;BridgeTower/bridgetower-large-itm-mlm-itc&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`}}),vo=new ee({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()`}}),bo=new ee({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.`}}),Eo=new U({}),Co=new z({props:{name:"class transformers.BridgeTowerConfig",anchor:"transformers.BridgeTowerConfig",parameters:[{name:"share_cross_modal_transformer_layers",val:" = True"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_size",val:" = 768"},{name:"initializer_factor",val:" = 1"},{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.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.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/v4.27.1/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/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerVisionConfig">BridgeTowerVisionConfig</a>.`,name:"vision_config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/configuration_bridgetower.py#L250"}}),Ee=new ur({props:{anchor:"transformers.BridgeTowerConfig.example",$$slots:{default:[xm]},$$scope:{ctx:$}}}),Fo=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/v4.27.1/src/transformers/models/bridgetower/configuration_bridgetower.py#L350"}}),Lo=new z({props:{name:"to_dict",anchor:"transformers.BridgeTowerConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/configuration_bridgetower.py#L361",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),qo=new U({}),Oo=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/v4.27.1/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/v4.27.1/src/transformers/models/bridgetower/configuration_bridgetower.py#L121"}}),Le=new ur({props:{anchor:"transformers.BridgeTowerTextConfig.example",$$slots:{default:[km]},$$scope:{ctx:$}}}),No=new U({}),Do=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/v4.27.1/src/transformers/models/bridgetower/configuration_bridgetower.py#L35"}}),qe=new ur({props:{anchor:"transformers.BridgeTowerVisionConfig.example",$$slots:{default:[$m]},$$scope:{ctx:$}}}),Wo=new U({}),Vo=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/v4.27.1/src/transformers/models/bridgetower/image_processing_bridgetower.py#L114"}}),Uo=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/v4.27.1/src/transformers/models/bridgetower/image_processing_bridgetower.py#L391"}}),Go=new U({}),Ho=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/v4.27.1/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/v4.27.1/src/transformers/models/bridgetower/processing_bridgetower.py#L26"}}),Jo=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/v4.27.1/src/transformers/models/bridgetower/processing_bridgetower.py#L48"}}),Qo=new U({}),Yo=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1210"}}),Zo=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/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <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/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1267",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/v4.27.1/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>. 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>
`}}),Ve=new vs({props:{$$slots:{default:[Pm]},$$scope:{ctx:$}}}),Ue=new ur({props:{anchor:"transformers.BridgeTowerModel.forward.example",$$slots:{default:[jm]},$$scope:{ctx:$}}}),er=new U({}),or=new z({props:{name:"class transformers.BridgeTowerForContrastiveLearning",anchor:"transformers.BridgeTowerForContrastiveLearning",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BridgeTowerForContrastiveLearning.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1763"}}),tr=new z({props:{name:"forward",anchor:"transformers.BridgeTowerForContrastiveLearning.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] = True"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.BridgeTowerForContrastiveLearning.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/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BridgeTowerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.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.BridgeTowerForContrastiveLearning.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BridgeTowerForContrastiveLearning.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 1)</code>, <em>optional</em>) &#x2014;
Labels for computing the image-text matching loss. 0 means the pairs don&#x2019;t match and 1 means they match.
The pairs with 0 will be skipped for calculation.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1777",returnDescription:`
<p>A <code>transformers.models.bridgetower.modeling_bridgetower.BridgeTowerContrastiveOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerConfig"
>BridgeTowerConfig</a>) and inputs.</p>
<ul>
<li><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).</li>
<li><strong>text_embeds</strong> (<code>torch.FloatTensor)</code>, <em>optional</em>, returned when model is initialized with <code>with_projection=True</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooler_output.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor)</code>, <em>optional</em>, returned when model is initialized with <code>with_projection=True</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooler_output.</li>
<li><strong>cross_embeds</strong>  (<code>torch.FloatTensor)</code>, <em>optional</em>, returned when model is initialized with <code>with_projection=True</code>) \u2014 The text-image cross-modal embeddings obtained by applying the projection layer to the pooler_output.</li>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Image-text contrastive loss.</li>
<li><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>.</li>
<li><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>. Hidden-states of
the model at the output of each layer plus the optional initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.models.bridgetower.modeling_bridgetower.BridgeTowerContrastiveOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new vs({props:{$$slots:{default:[zm]},$$scope:{ctx:$}}}),Xe=new ur({props:{anchor:"transformers.BridgeTowerForContrastiveLearning.forward.example",$$slots:{default:[Im]},$$scope:{ctx:$}}}),nr=new U({}),sr=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1549"}}),ir=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/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <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/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1565",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new vs({props:{$$slots:{default:[Em]},$$scope:{ctx:$}}}),Ye=new ur({props:{anchor:"transformers.BridgeTowerForMaskedLM.forward.example",$$slots:{default:[Cm]},$$scope:{ctx:$}}}),dr=new U({}),lr=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1654"}}),mr=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/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <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/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor">BridgeTowerImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__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/v4.27.1/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, 1)</code>, <em>optional</em>) &#x2014;
Labels for computing the image-text matching loss. 0 means the pairs don&#x2019;t match and 1 means they match.
The pairs with 0 will be skipped for calculation.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/bridgetower/modeling_bridgetower.py#L1665",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new vs({props:{$$slots:{default:[Mm]},$$scope:{ctx:$}}}),eo=new ur({props:{anchor:"transformers.BridgeTowerForImageAndTextRetrieval.forward.example",$$slots:{default:[Fm]},$$scope:{ctx:$}}}),{c(){p=s("meta"),k=c(),_=s("h1"),f=s("a"),w=s("span"),T(d.$$.fragment),u=c(),P=s("span"),bs=t("BridgeTower"),hn=c(),oe=s("h2"),ke=s("a"),_t=s("span"),T(ho.$$.fragment),ys=c(),wt=s("span"),Bs=t("Overview"),fn=c(),$e=s("p"),xs=t("The BridgeTower model was proposed in "),fo=s("a"),ks=t("BridgeTower: Building Bridges Between Encoders in Vision-Language Representative Learning"),$s=t(` 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.`),un=c(),Pe=s("p"),Ps=t("This paper has been accepted to the "),uo=s("a"),js=t("AAAI\u201923"),zs=t(" conference."),_n=c(),wr=s("p"),Is=t("The abstract from the paper is the following:"),wn=c(),Tr=s("p"),Tt=s("em"),Es=t(`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.`),Tn=c(),je=s("img"),vn=c(),_o=s("small"),Cs=t("BridgeTower architecture. Taken from the "),vr=s("a"),Ms=t("original paper."),bn=c(),re=s("h2"),ze=s("a"),vt=s("span"),T(wo.$$.fragment),Fs=c(),bt=s("span"),Ls=t("Usage"),yn=c(),br=s("p"),As=t(`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.`),Bn=c(),O=s("p"),qs=t("The "),yr=s("a"),Os=t("BridgeTowerProcessor"),Rs=t(" wraps "),Br=s("a"),Ns=t("RobertaTokenizer"),Ds=t(" and "),xr=s("a"),Ss=t("BridgeTowerImageProcessor"),Ws=t(` into a single instance to both
encode the text and prepare the images respectively.`),xn=c(),J=s("p"),Vs=t("The following example shows how to run contrastive learning using "),kr=s("a"),Us=t("BridgeTowerProcessor"),Gs=t(" and "),$r=s("a"),Hs=t("BridgeTowerForContrastiveLearning"),Xs=t("."),kn=c(),T(To.$$.fragment),$n=c(),Q=s("p"),Js=t("The following example shows how to run image-text retrieval using "),Pr=s("a"),Qs=t("BridgeTowerProcessor"),Ys=t(" and "),jr=s("a"),Ks=t("BridgeTowerForImageAndTextRetrieval"),Zs=t("."),Pn=c(),T(vo.$$.fragment),jn=c(),Y=s("p"),ea=t("The following example shows how to run masked language modeling using "),zr=s("a"),oa=t("BridgeTowerProcessor"),ra=t(" and "),Ir=s("a"),ta=t("BridgeTowerForMaskedLM"),na=t("."),zn=c(),T(bo.$$.fragment),In=c(),I=s("p"),sa=t("This model was contributed by "),yo=s("a"),aa=t("Anahita Bhiwandiwalla"),ia=t(", "),Bo=s("a"),da=t("Tiep Le"),la=t(" and "),xo=s("a"),ca=t("Shaoyen Tseng"),ma=t(". The original code can be found "),ko=s("a"),ga=t("here"),pa=t("."),En=c(),Er=s("p"),ha=t("Tips:"),Cn=c(),R=s("ul"),$o=s("li"),fa=t("This implementation of BridgeTower uses "),Cr=s("a"),ua=t("RobertaTokenizer"),_a=t(" to generate text embeddings and OpenAI\u2019s CLIP/ViT model to compute visual embeddings."),wa=c(),te=s("li"),Ta=t("Checkpoints for pre-trained "),Po=s("a"),va=t("bridgeTower-base"),ba=t(" and "),jo=s("a"),ya=t("bridgetower masked language modeling and image text matching"),Ba=t(" are released."),xa=c(),zo=s("li"),ka=t("Please refer to "),Io=s("a"),$a=t("Table 5"),Pa=t(" for BridgeTower\u2019s performance on Image Retrieval and other down stream tasks."),ja=c(),yt=s("li"),za=t("The PyTorch version of this model is only available in torch 1.10 and higher."),Mn=c(),ne=s("h2"),Ie=s("a"),Bt=s("span"),T(Eo.$$.fragment),Ia=c(),xt=s("span"),Ea=t("BridgeTowerConfig"),Fn=c(),j=s("div"),T(Co.$$.fragment),Ca=c(),se=s("p"),Ma=t("This is the configuration class to store the configuration of a "),Mr=s("a"),Fa=t("BridgeTowerModel"),La=t(`. 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
`),Mo=s("a"),Aa=t("BridgeTower/bridgetower-base"),qa=t(" architecture."),Oa=c(),ae=s("p"),Ra=t("Configuration objects inherit from "),Fr=s("a"),Na=t("PretrainedConfig"),Da=t(` and can be used to control the model outputs. Read the
documentation from `),Lr=s("a"),Sa=t("PretrainedConfig"),Wa=t(" for more information."),Va=c(),T(Ee.$$.fragment),Ua=c(),Ce=s("div"),T(Fo.$$.fragment),Ga=c(),ie=s("p"),Ha=t("Instantiate a "),Ar=s("a"),Xa=t("BridgeTowerConfig"),Ja=t(` (or a derived class) from BridgeTower text model configuration. Returns:
`),qr=s("a"),Qa=t("BridgeTowerConfig"),Ya=t(": An instance of a configuration object"),Ka=c(),Me=s("div"),T(Lo.$$.fragment),Za=c(),Ao=s("p"),ei=t("Serializes this instance to a Python dictionary. Override the default "),Or=s("a"),oi=t("to_dict()"),ri=t("."),Ln=c(),de=s("h2"),Fe=s("a"),kt=s("span"),T(qo.$$.fragment),ti=c(),$t=s("span"),ni=t("BridgeTowerTextConfig"),An=c(),C=s("div"),T(Oo.$$.fragment),si=c(),le=s("p"),ai=t("This is the configuration class to store the text configuration of a "),Rr=s("a"),ii=t("BridgeTowerModel"),di=t(`. 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 `),Ro=s("a"),li=t("BridegTower/bridgetower-base"),ci=t(`
architecture.`),mi=c(),ce=s("p"),gi=t("Configuration objects inherit from "),Nr=s("a"),pi=t("PretrainedConfig"),hi=t(` and can be used to control the model outputs. Read the
documentation from `),Dr=s("a"),fi=t("PretrainedConfig"),ui=t(" for more information."),_i=c(),T(Le.$$.fragment),qn=c(),me=s("h2"),Ae=s("a"),Pt=s("span"),T(No.$$.fragment),wi=c(),jt=s("span"),Ti=t("BridgeTowerVisionConfig"),On=c(),M=s("div"),T(Do.$$.fragment),vi=c(),ge=s("p"),bi=t("This is the configuration class to store the vision configuration of a "),Sr=s("a"),yi=t("BridgeTowerModel"),Bi=t(`. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
`),So=s("a"),xi=t("BridgeTower/bridgetower-base"),ki=t(" architecture."),$i=c(),pe=s("p"),Pi=t("Configuration objects inherit from "),Wr=s("a"),ji=t("PretrainedConfig"),zi=t(` and can be used to control the model outputs. Read the
documentation from `),Vr=s("a"),Ii=t("PretrainedConfig"),Ei=t(" for more information."),Ci=c(),T(qe.$$.fragment),Rn=c(),he=s("h2"),Oe=s("a"),zt=s("span"),T(Wo.$$.fragment),Mi=c(),It=s("span"),Fi=t("BridgeTowerImageProcessor"),Nn=c(),G=s("div"),T(Vo.$$.fragment),Li=c(),Et=s("p"),Ai=t("Constructs a BridgeTower image processor."),qi=c(),Re=s("div"),T(Uo.$$.fragment),Oi=c(),Ct=s("p"),Ri=t("Preprocess an image or batch of images."),Dn=c(),fe=s("h2"),Ne=s("a"),Mt=s("span"),T(Go.$$.fragment),Ni=c(),Ft=s("span"),Di=t("BridgeTowerProcessor"),Sn=c(),F=s("div"),T(Ho.$$.fragment),Si=c(),Lt=s("p"),Wi=t(`Constructs a BridgeTower processor which wraps a Roberta tokenizer and BridgeTower image processor into a single
processor.`),Vi=c(),E=s("p"),Ur=s("a"),Ui=t("BridgeTowerProcessor"),Gi=t(" offers all the functionalities of "),Gr=s("a"),Hi=t("BridgeTowerImageProcessor"),Xi=t(` and
`),Hr=s("a"),Ji=t("RobertaTokenizerFast"),Qi=t(". See the docstring of "),Xo=s("a"),At=s("strong"),Yi=t("call"),Ki=t("()"),Zi=t(` and
`),qt=s("code"),ed=t("decode()"),od=t(" for more information."),rd=c(),K=s("div"),T(Jo.$$.fragment),td=c(),ue=s("p"),nd=t("This method uses "),De=s("a"),sd=t("BridgeTowerImageProcessor."),Ot=s("strong"),ad=t("call"),id=t("()"),dd=t(` method to prepare image(s) for the model, and
`),Se=s("a"),ld=t("RobertaTokenizerFast."),Rt=s("strong"),cd=t("call"),md=t("()"),gd=t(" to prepare text for the model."),pd=c(),Nt=s("p"),hd=t("Please refer to the docstring of the above two methods for more information."),Wn=c(),_e=s("h2"),We=s("a"),Dt=s("span"),T(Qo.$$.fragment),fd=c(),St=s("span"),ud=t("BridgeTowerModel"),Vn=c(),H=s("div"),T(Yo.$$.fragment),_d=c(),Ko=s("p"),wd=t(`The bare BridgeTower Model transformer outputting BridgeTowerModelOutput object without any specific head on top.
This model is a PyTorch `),Wt=s("code"),Td=t("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),vd=t(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),bd=c(),N=s("div"),T(Zo.$$.fragment),yd=c(),we=s("p"),Bd=t("The "),Xr=s("a"),xd=t("BridgeTowerModel"),kd=t(" forward method, overrides the "),Vt=s("code"),$d=t("__call__"),Pd=t(" special method."),jd=c(),T(Ve.$$.fragment),zd=c(),T(Ue.$$.fragment),Un=c(),Te=s("h2"),Ge=s("a"),Ut=s("span"),T(er.$$.fragment),Id=c(),Gt=s("span"),Ed=t("BridgeTowerForContrastiveLearning"),Gn=c(),L=s("div"),T(or.$$.fragment),Cd=c(),Ht=s("p"),Md=t("BridgeTower Model with a image-text contrastive head on top computing image-text contrastive loss."),Fd=c(),rr=s("p"),Ld=t("This model is a PyTorch "),Xt=s("code"),Ad=t("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),qd=t(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Od=c(),D=s("div"),T(tr.$$.fragment),Rd=c(),ve=s("p"),Nd=t("The "),Jr=s("a"),Dd=t("BridgeTowerForContrastiveLearning"),Sd=t(" forward method, overrides the "),Jt=s("code"),Wd=t("__call__"),Vd=t(" special method."),Ud=c(),T(He.$$.fragment),Gd=c(),T(Xe.$$.fragment),Hn=c(),be=s("h2"),Je=s("a"),Qt=s("span"),T(nr.$$.fragment),Hd=c(),Yt=s("span"),Xd=t("BridgeTowerForMaskedLM"),Xn=c(),A=s("div"),T(sr.$$.fragment),Jd=c(),Kt=s("p"),Qd=t("BridgeTower Model with a language modeling head on top as done during pretraining."),Yd=c(),ar=s("p"),Kd=t("This model is a PyTorch "),Zt=s("code"),Zd=t("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),el=t(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ol=c(),S=s("div"),T(ir.$$.fragment),rl=c(),ye=s("p"),tl=t("The "),Qr=s("a"),nl=t("BridgeTowerForMaskedLM"),sl=t(" forward method, overrides the "),en=s("code"),al=t("__call__"),il=t(" special method."),dl=c(),T(Qe.$$.fragment),ll=c(),T(Ye.$$.fragment),Jn=c(),Be=s("h2"),Ke=s("a"),on=s("span"),T(dr.$$.fragment),cl=c(),rn=s("span"),ml=t("BridgeTowerForImageAndTextRetrieval"),Qn=c(),q=s("div"),T(lr.$$.fragment),gl=c(),tn=s("p"),pl=t(`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.`),hl=c(),cr=s("p"),fl=t("This model is a PyTorch "),nn=s("code"),ul=t("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),_l=t(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wl=c(),W=s("div"),T(mr.$$.fragment),Tl=c(),xe=s("p"),vl=t("The "),Yr=s("a"),bl=t("BridgeTowerForImageAndTextRetrieval"),yl=t(" forward method, overrides the "),sn=s("code"),Bl=t("__call__"),xl=t(" special method."),kl=c(),T(Ze.$$.fragment),$l=c(),T(eo.$$.fragment),this.h()},l(o){const g=bm('[data-svelte="svelte-1phssyn"]',document.head);p=a(g,"META",{name:!0,content:!0}),g.forEach(r),k=m(o),_=a(o,"H1",{class:!0});var gr=i(_);f=a(gr,"A",{id:!0,class:!0,href:!0});var an=i(f);w=a(an,"SPAN",{});var dn=i(w);v(d.$$.fragment,dn),dn.forEach(r),an.forEach(r),u=m(gr),P=a(gr,"SPAN",{});var ln=i(P);bs=n(ln,"BridgeTower"),ln.forEach(r),gr.forEach(r),hn=m(o),oe=a(o,"H2",{class:!0});var pr=i(oe);ke=a(pr,"A",{id:!0,class:!0,href:!0});var cn=i(ke);_t=a(cn,"SPAN",{});var mn=i(_t);v(ho.$$.fragment,mn),mn.forEach(r),cn.forEach(r),ys=m(pr),wt=a(pr,"SPAN",{});var gn=i(wt);Bs=n(gn,"Overview"),gn.forEach(r),pr.forEach(r),fn=m(o),$e=a(o,"P",{});var hr=i($e);xs=n(hr,"The BridgeTower model was proposed in "),fo=a(hr,"A",{href:!0,rel:!0});var pn=i(fo);ks=n(pn,"BridgeTower: Building Bridges Between Encoders in Vision-Language Representative Learning"),pn.forEach(r),$s=n(hr,` 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.`),hr.forEach(r),un=m(o),Pe=a(o,"P",{});var fr=i(Pe);Ps=n(fr,"This paper has been accepted to the "),uo=a(fr,"A",{href:!0,rel:!0});var Il=i(uo);js=n(Il,"AAAI\u201923"),Il.forEach(r),zs=n(fr," conference."),fr.forEach(r),_n=m(o),wr=a(o,"P",{});var El=i(wr);Is=n(El,"The abstract from the paper is the following:"),El.forEach(r),wn=m(o),Tr=a(o,"P",{});var Cl=i(Tr);Tt=a(Cl,"EM",{});var Ml=i(Tt);Es=n(Ml,`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.`),Ml.forEach(r),Cl.forEach(r),Tn=m(o),je=a(o,"IMG",{src:!0,alt:!0,width:!0}),vn=m(o),_o=a(o,"SMALL",{});var Pl=i(_o);Cs=n(Pl,"BridgeTower architecture. Taken from the "),vr=a(Pl,"A",{href:!0});var Fl=i(vr);Ms=n(Fl,"original paper."),Fl.forEach(r),Pl.forEach(r),bn=m(o),re=a(o,"H2",{class:!0});var Kn=i(re);ze=a(Kn,"A",{id:!0,class:!0,href:!0});var Ll=i(ze);vt=a(Ll,"SPAN",{});var Al=i(vt);v(wo.$$.fragment,Al),Al.forEach(r),Ll.forEach(r),Fs=m(Kn),bt=a(Kn,"SPAN",{});var ql=i(bt);Ls=n(ql,"Usage"),ql.forEach(r),Kn.forEach(r),yn=m(o),br=a(o,"P",{});var Ol=i(br);As=n(Ol,`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.`),Ol.forEach(r),Bn=m(o),O=a(o,"P",{});var oo=i(O);qs=n(oo,"The "),yr=a(oo,"A",{href:!0});var Rl=i(yr);Os=n(Rl,"BridgeTowerProcessor"),Rl.forEach(r),Rs=n(oo," wraps "),Br=a(oo,"A",{href:!0});var Nl=i(Br);Ns=n(Nl,"RobertaTokenizer"),Nl.forEach(r),Ds=n(oo," and "),xr=a(oo,"A",{href:!0});var Dl=i(xr);Ss=n(Dl,"BridgeTowerImageProcessor"),Dl.forEach(r),Ws=n(oo,` into a single instance to both
encode the text and prepare the images respectively.`),oo.forEach(r),xn=m(o),J=a(o,"P",{});var Kr=i(J);Vs=n(Kr,"The following example shows how to run contrastive learning using "),kr=a(Kr,"A",{href:!0});var Sl=i(kr);Us=n(Sl,"BridgeTowerProcessor"),Sl.forEach(r),Gs=n(Kr," and "),$r=a(Kr,"A",{href:!0});var Wl=i($r);Hs=n(Wl,"BridgeTowerForContrastiveLearning"),Wl.forEach(r),Xs=n(Kr,"."),Kr.forEach(r),kn=m(o),v(To.$$.fragment,o),$n=m(o),Q=a(o,"P",{});var Zr=i(Q);Js=n(Zr,"The following example shows how to run image-text retrieval using "),Pr=a(Zr,"A",{href:!0});var Vl=i(Pr);Qs=n(Vl,"BridgeTowerProcessor"),Vl.forEach(r),Ys=n(Zr," and "),jr=a(Zr,"A",{href:!0});var Ul=i(jr);Ks=n(Ul,"BridgeTowerForImageAndTextRetrieval"),Ul.forEach(r),Zs=n(Zr,"."),Zr.forEach(r),Pn=m(o),v(vo.$$.fragment,o),jn=m(o),Y=a(o,"P",{});var et=i(Y);ea=n(et,"The following example shows how to run masked language modeling using "),zr=a(et,"A",{href:!0});var Gl=i(zr);oa=n(Gl,"BridgeTowerProcessor"),Gl.forEach(r),ra=n(et," and "),Ir=a(et,"A",{href:!0});var Hl=i(Ir);ta=n(Hl,"BridgeTowerForMaskedLM"),Hl.forEach(r),na=n(et,"."),et.forEach(r),zn=m(o),v(bo.$$.fragment,o),In=m(o),I=a(o,"P",{});var Z=i(I);sa=n(Z,"This model was contributed by "),yo=a(Z,"A",{href:!0,rel:!0});var Xl=i(yo);aa=n(Xl,"Anahita Bhiwandiwalla"),Xl.forEach(r),ia=n(Z,", "),Bo=a(Z,"A",{href:!0,rel:!0});var Jl=i(Bo);da=n(Jl,"Tiep Le"),Jl.forEach(r),la=n(Z," and "),xo=a(Z,"A",{href:!0,rel:!0});var Ql=i(xo);ca=n(Ql,"Shaoyen Tseng"),Ql.forEach(r),ma=n(Z,". The original code can be found "),ko=a(Z,"A",{href:!0,rel:!0});var Yl=i(ko);ga=n(Yl,"here"),Yl.forEach(r),pa=n(Z,"."),Z.forEach(r),En=m(o),Er=a(o,"P",{});var Kl=i(Er);ha=n(Kl,"Tips:"),Kl.forEach(r),Cn=m(o),R=a(o,"UL",{});var ro=i(R);$o=a(ro,"LI",{});var Zn=i($o);fa=n(Zn,"This implementation of BridgeTower uses "),Cr=a(Zn,"A",{href:!0});var Zl=i(Cr);ua=n(Zl,"RobertaTokenizer"),Zl.forEach(r),_a=n(Zn," to generate text embeddings and OpenAI\u2019s CLIP/ViT model to compute visual embeddings."),Zn.forEach(r),wa=m(ro),te=a(ro,"LI",{});var ot=i(te);Ta=n(ot,"Checkpoints for pre-trained "),Po=a(ot,"A",{href:!0,rel:!0});var ec=i(Po);va=n(ec,"bridgeTower-base"),ec.forEach(r),ba=n(ot," and "),jo=a(ot,"A",{href:!0,rel:!0});var oc=i(jo);ya=n(oc,"bridgetower masked language modeling and image text matching"),oc.forEach(r),Ba=n(ot," are released."),ot.forEach(r),xa=m(ro),zo=a(ro,"LI",{});var es=i(zo);ka=n(es,"Please refer to "),Io=a(es,"A",{href:!0,rel:!0});var rc=i(Io);$a=n(rc,"Table 5"),rc.forEach(r),Pa=n(es," for BridgeTower\u2019s performance on Image Retrieval and other down stream tasks."),es.forEach(r),ja=m(ro),yt=a(ro,"LI",{});var tc=i(yt);za=n(tc,"The PyTorch version of this model is only available in torch 1.10 and higher."),tc.forEach(r),ro.forEach(r),Mn=m(o),ne=a(o,"H2",{class:!0});var os=i(ne);Ie=a(os,"A",{id:!0,class:!0,href:!0});var nc=i(Ie);Bt=a(nc,"SPAN",{});var sc=i(Bt);v(Eo.$$.fragment,sc),sc.forEach(r),nc.forEach(r),Ia=m(os),xt=a(os,"SPAN",{});var ac=i(xt);Ea=n(ac,"BridgeTowerConfig"),ac.forEach(r),os.forEach(r),Fn=m(o),j=a(o,"DIV",{class:!0});var V=i(j);v(Co.$$.fragment,V),Ca=m(V),se=a(V,"P",{});var rt=i(se);Ma=n(rt,"This is the configuration class to store the configuration of a "),Mr=a(rt,"A",{href:!0});var ic=i(Mr);Fa=n(ic,"BridgeTowerModel"),ic.forEach(r),La=n(rt,`. 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
`),Mo=a(rt,"A",{href:!0,rel:!0});var dc=i(Mo);Aa=n(dc,"BridgeTower/bridgetower-base"),dc.forEach(r),qa=n(rt," architecture."),rt.forEach(r),Oa=m(V),ae=a(V,"P",{});var tt=i(ae);Ra=n(tt,"Configuration objects inherit from "),Fr=a(tt,"A",{href:!0});var lc=i(Fr);Na=n(lc,"PretrainedConfig"),lc.forEach(r),Da=n(tt,` and can be used to control the model outputs. Read the
documentation from `),Lr=a(tt,"A",{href:!0});var cc=i(Lr);Sa=n(cc,"PretrainedConfig"),cc.forEach(r),Wa=n(tt," for more information."),tt.forEach(r),Va=m(V),v(Ee.$$.fragment,V),Ua=m(V),Ce=a(V,"DIV",{class:!0});var rs=i(Ce);v(Fo.$$.fragment,rs),Ga=m(rs),ie=a(rs,"P",{});var nt=i(ie);Ha=n(nt,"Instantiate a "),Ar=a(nt,"A",{href:!0});var mc=i(Ar);Xa=n(mc,"BridgeTowerConfig"),mc.forEach(r),Ja=n(nt,` (or a derived class) from BridgeTower text model configuration. Returns:
`),qr=a(nt,"A",{href:!0});var gc=i(qr);Qa=n(gc,"BridgeTowerConfig"),gc.forEach(r),Ya=n(nt,": An instance of a configuration object"),nt.forEach(r),rs.forEach(r),Ka=m(V),Me=a(V,"DIV",{class:!0});var ts=i(Me);v(Lo.$$.fragment,ts),Za=m(ts),Ao=a(ts,"P",{});var ns=i(Ao);ei=n(ns,"Serializes this instance to a Python dictionary. Override the default "),Or=a(ns,"A",{href:!0});var pc=i(Or);oi=n(pc,"to_dict()"),pc.forEach(r),ri=n(ns,"."),ns.forEach(r),ts.forEach(r),V.forEach(r),Ln=m(o),de=a(o,"H2",{class:!0});var ss=i(de);Fe=a(ss,"A",{id:!0,class:!0,href:!0});var hc=i(Fe);kt=a(hc,"SPAN",{});var fc=i(kt);v(qo.$$.fragment,fc),fc.forEach(r),hc.forEach(r),ti=m(ss),$t=a(ss,"SPAN",{});var uc=i($t);ni=n(uc,"BridgeTowerTextConfig"),uc.forEach(r),ss.forEach(r),An=m(o),C=a(o,"DIV",{class:!0});var to=i(C);v(Oo.$$.fragment,to),si=m(to),le=a(to,"P",{});var st=i(le);ai=n(st,"This is the configuration class to store the text configuration of a "),Rr=a(st,"A",{href:!0});var _c=i(Rr);ii=n(_c,"BridgeTowerModel"),_c.forEach(r),di=n(st,`. 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 `),Ro=a(st,"A",{href:!0,rel:!0});var wc=i(Ro);li=n(wc,"BridegTower/bridgetower-base"),wc.forEach(r),ci=n(st,`
architecture.`),st.forEach(r),mi=m(to),ce=a(to,"P",{});var at=i(ce);gi=n(at,"Configuration objects inherit from "),Nr=a(at,"A",{href:!0});var Tc=i(Nr);pi=n(Tc,"PretrainedConfig"),Tc.forEach(r),hi=n(at,` and can be used to control the model outputs. Read the
documentation from `),Dr=a(at,"A",{href:!0});var vc=i(Dr);fi=n(vc,"PretrainedConfig"),vc.forEach(r),ui=n(at," for more information."),at.forEach(r),_i=m(to),v(Le.$$.fragment,to),to.forEach(r),qn=m(o),me=a(o,"H2",{class:!0});var as=i(me);Ae=a(as,"A",{id:!0,class:!0,href:!0});var bc=i(Ae);Pt=a(bc,"SPAN",{});var yc=i(Pt);v(No.$$.fragment,yc),yc.forEach(r),bc.forEach(r),wi=m(as),jt=a(as,"SPAN",{});var Bc=i(jt);Ti=n(Bc,"BridgeTowerVisionConfig"),Bc.forEach(r),as.forEach(r),On=m(o),M=a(o,"DIV",{class:!0});var no=i(M);v(Do.$$.fragment,no),vi=m(no),ge=a(no,"P",{});var it=i(ge);bi=n(it,"This is the configuration class to store the vision configuration of a "),Sr=a(it,"A",{href:!0});var xc=i(Sr);yi=n(xc,"BridgeTowerModel"),xc.forEach(r),Bi=n(it,`. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
`),So=a(it,"A",{href:!0,rel:!0});var kc=i(So);xi=n(kc,"BridgeTower/bridgetower-base"),kc.forEach(r),ki=n(it," architecture."),it.forEach(r),$i=m(no),pe=a(no,"P",{});var dt=i(pe);Pi=n(dt,"Configuration objects inherit from "),Wr=a(dt,"A",{href:!0});var $c=i(Wr);ji=n($c,"PretrainedConfig"),$c.forEach(r),zi=n(dt,` and can be used to control the model outputs. Read the
documentation from `),Vr=a(dt,"A",{href:!0});var Pc=i(Vr);Ii=n(Pc,"PretrainedConfig"),Pc.forEach(r),Ei=n(dt," for more information."),dt.forEach(r),Ci=m(no),v(qe.$$.fragment,no),no.forEach(r),Rn=m(o),he=a(o,"H2",{class:!0});var is=i(he);Oe=a(is,"A",{id:!0,class:!0,href:!0});var jc=i(Oe);zt=a(jc,"SPAN",{});var zc=i(zt);v(Wo.$$.fragment,zc),zc.forEach(r),jc.forEach(r),Mi=m(is),It=a(is,"SPAN",{});var Ic=i(It);Fi=n(Ic,"BridgeTowerImageProcessor"),Ic.forEach(r),is.forEach(r),Nn=m(o),G=a(o,"DIV",{class:!0});var lt=i(G);v(Vo.$$.fragment,lt),Li=m(lt),Et=a(lt,"P",{});var Ec=i(Et);Ai=n(Ec,"Constructs a BridgeTower image processor."),Ec.forEach(r),qi=m(lt),Re=a(lt,"DIV",{class:!0});var ds=i(Re);v(Uo.$$.fragment,ds),Oi=m(ds),Ct=a(ds,"P",{});var Cc=i(Ct);Ri=n(Cc,"Preprocess an image or batch of images."),Cc.forEach(r),ds.forEach(r),lt.forEach(r),Dn=m(o),fe=a(o,"H2",{class:!0});var ls=i(fe);Ne=a(ls,"A",{id:!0,class:!0,href:!0});var Mc=i(Ne);Mt=a(Mc,"SPAN",{});var Fc=i(Mt);v(Go.$$.fragment,Fc),Fc.forEach(r),Mc.forEach(r),Ni=m(ls),Ft=a(ls,"SPAN",{});var Lc=i(Ft);Di=n(Lc,"BridgeTowerProcessor"),Lc.forEach(r),ls.forEach(r),Sn=m(o),F=a(o,"DIV",{class:!0});var so=i(F);v(Ho.$$.fragment,so),Si=m(so),Lt=a(so,"P",{});var Ac=i(Lt);Wi=n(Ac,`Constructs a BridgeTower processor which wraps a Roberta tokenizer and BridgeTower image processor into a single
processor.`),Ac.forEach(r),Vi=m(so),E=a(so,"P",{});var X=i(E);Ur=a(X,"A",{href:!0});var qc=i(Ur);Ui=n(qc,"BridgeTowerProcessor"),qc.forEach(r),Gi=n(X," offers all the functionalities of "),Gr=a(X,"A",{href:!0});var Oc=i(Gr);Hi=n(Oc,"BridgeTowerImageProcessor"),Oc.forEach(r),Xi=n(X,` and
`),Hr=a(X,"A",{href:!0});var Rc=i(Hr);Ji=n(Rc,"RobertaTokenizerFast"),Rc.forEach(r),Qi=n(X,". See the docstring of "),Xo=a(X,"A",{href:!0});var jl=i(Xo);At=a(jl,"STRONG",{});var Nc=i(At);Yi=n(Nc,"call"),Nc.forEach(r),Ki=n(jl,"()"),jl.forEach(r),Zi=n(X,` and
`),qt=a(X,"CODE",{});var Dc=i(qt);ed=n(Dc,"decode()"),Dc.forEach(r),od=n(X," for more information."),X.forEach(r),rd=m(so),K=a(so,"DIV",{class:!0});var ct=i(K);v(Jo.$$.fragment,ct),td=m(ct),ue=a(ct,"P",{});var mt=i(ue);nd=n(mt,"This method uses "),De=a(mt,"A",{href:!0});var cs=i(De);sd=n(cs,"BridgeTowerImageProcessor."),Ot=a(cs,"STRONG",{});var Sc=i(Ot);ad=n(Sc,"call"),Sc.forEach(r),id=n(cs,"()"),cs.forEach(r),dd=n(mt,` method to prepare image(s) for the model, and
`),Se=a(mt,"A",{href:!0});var ms=i(Se);ld=n(ms,"RobertaTokenizerFast."),Rt=a(ms,"STRONG",{});var Wc=i(Rt);cd=n(Wc,"call"),Wc.forEach(r),md=n(ms,"()"),ms.forEach(r),gd=n(mt," to prepare text for the model."),mt.forEach(r),pd=m(ct),Nt=a(ct,"P",{});var Vc=i(Nt);hd=n(Vc,"Please refer to the docstring of the above two methods for more information."),Vc.forEach(r),ct.forEach(r),so.forEach(r),Wn=m(o),_e=a(o,"H2",{class:!0});var gs=i(_e);We=a(gs,"A",{id:!0,class:!0,href:!0});var Uc=i(We);Dt=a(Uc,"SPAN",{});var Gc=i(Dt);v(Qo.$$.fragment,Gc),Gc.forEach(r),Uc.forEach(r),fd=m(gs),St=a(gs,"SPAN",{});var Hc=i(St);ud=n(Hc,"BridgeTowerModel"),Hc.forEach(r),gs.forEach(r),Vn=m(o),H=a(o,"DIV",{class:!0});var gt=i(H);v(Yo.$$.fragment,gt),_d=m(gt),Ko=a(gt,"P",{});var ps=i(Ko);wd=n(ps,`The bare BridgeTower Model transformer outputting BridgeTowerModelOutput object without any specific head on top.
This model is a PyTorch `),Wt=a(ps,"CODE",{});var Xc=i(Wt);Td=n(Xc,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Xc.forEach(r),vd=n(ps,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ps.forEach(r),bd=m(gt),N=a(gt,"DIV",{class:!0});var ao=i(N);v(Zo.$$.fragment,ao),yd=m(ao),we=a(ao,"P",{});var pt=i(we);Bd=n(pt,"The "),Xr=a(pt,"A",{href:!0});var Jc=i(Xr);xd=n(Jc,"BridgeTowerModel"),Jc.forEach(r),kd=n(pt," forward method, overrides the "),Vt=a(pt,"CODE",{});var Qc=i(Vt);$d=n(Qc,"__call__"),Qc.forEach(r),Pd=n(pt," special method."),pt.forEach(r),jd=m(ao),v(Ve.$$.fragment,ao),zd=m(ao),v(Ue.$$.fragment,ao),ao.forEach(r),gt.forEach(r),Un=m(o),Te=a(o,"H2",{class:!0});var hs=i(Te);Ge=a(hs,"A",{id:!0,class:!0,href:!0});var Yc=i(Ge);Ut=a(Yc,"SPAN",{});var Kc=i(Ut);v(er.$$.fragment,Kc),Kc.forEach(r),Yc.forEach(r),Id=m(hs),Gt=a(hs,"SPAN",{});var Zc=i(Gt);Ed=n(Zc,"BridgeTowerForContrastiveLearning"),Zc.forEach(r),hs.forEach(r),Gn=m(o),L=a(o,"DIV",{class:!0});var io=i(L);v(or.$$.fragment,io),Cd=m(io),Ht=a(io,"P",{});var em=i(Ht);Md=n(em,"BridgeTower Model with a image-text contrastive head on top computing image-text contrastive loss."),em.forEach(r),Fd=m(io),rr=a(io,"P",{});var fs=i(rr);Ld=n(fs,"This model is a PyTorch "),Xt=a(fs,"CODE",{});var om=i(Xt);Ad=n(om,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),om.forEach(r),qd=n(fs,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fs.forEach(r),Od=m(io),D=a(io,"DIV",{class:!0});var lo=i(D);v(tr.$$.fragment,lo),Rd=m(lo),ve=a(lo,"P",{});var ht=i(ve);Nd=n(ht,"The "),Jr=a(ht,"A",{href:!0});var rm=i(Jr);Dd=n(rm,"BridgeTowerForContrastiveLearning"),rm.forEach(r),Sd=n(ht," forward method, overrides the "),Jt=a(ht,"CODE",{});var tm=i(Jt);Wd=n(tm,"__call__"),tm.forEach(r),Vd=n(ht," special method."),ht.forEach(r),Ud=m(lo),v(He.$$.fragment,lo),Gd=m(lo),v(Xe.$$.fragment,lo),lo.forEach(r),io.forEach(r),Hn=m(o),be=a(o,"H2",{class:!0});var us=i(be);Je=a(us,"A",{id:!0,class:!0,href:!0});var nm=i(Je);Qt=a(nm,"SPAN",{});var sm=i(Qt);v(nr.$$.fragment,sm),sm.forEach(r),nm.forEach(r),Hd=m(us),Yt=a(us,"SPAN",{});var am=i(Yt);Xd=n(am,"BridgeTowerForMaskedLM"),am.forEach(r),us.forEach(r),Xn=m(o),A=a(o,"DIV",{class:!0});var co=i(A);v(sr.$$.fragment,co),Jd=m(co),Kt=a(co,"P",{});var im=i(Kt);Qd=n(im,"BridgeTower Model with a language modeling head on top as done during pretraining."),im.forEach(r),Yd=m(co),ar=a(co,"P",{});var _s=i(ar);Kd=n(_s,"This model is a PyTorch "),Zt=a(_s,"CODE",{});var dm=i(Zt);Zd=n(dm,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),dm.forEach(r),el=n(_s,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_s.forEach(r),ol=m(co),S=a(co,"DIV",{class:!0});var mo=i(S);v(ir.$$.fragment,mo),rl=m(mo),ye=a(mo,"P",{});var ft=i(ye);tl=n(ft,"The "),Qr=a(ft,"A",{href:!0});var lm=i(Qr);nl=n(lm,"BridgeTowerForMaskedLM"),lm.forEach(r),sl=n(ft," forward method, overrides the "),en=a(ft,"CODE",{});var cm=i(en);al=n(cm,"__call__"),cm.forEach(r),il=n(ft," special method."),ft.forEach(r),dl=m(mo),v(Qe.$$.fragment,mo),ll=m(mo),v(Ye.$$.fragment,mo),mo.forEach(r),co.forEach(r),Jn=m(o),Be=a(o,"H2",{class:!0});var ws=i(Be);Ke=a(ws,"A",{id:!0,class:!0,href:!0});var mm=i(Ke);on=a(mm,"SPAN",{});var gm=i(on);v(dr.$$.fragment,gm),gm.forEach(r),mm.forEach(r),cl=m(ws),rn=a(ws,"SPAN",{});var pm=i(rn);ml=n(pm,"BridgeTowerForImageAndTextRetrieval"),pm.forEach(r),ws.forEach(r),Qn=m(o),q=a(o,"DIV",{class:!0});var go=i(q);v(lr.$$.fragment,go),gl=m(go),tn=a(go,"P",{});var hm=i(tn);pl=n(hm,`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.`),hm.forEach(r),hl=m(go),cr=a(go,"P",{});var Ts=i(cr);fl=n(Ts,"This model is a PyTorch "),nn=a(Ts,"CODE",{});var fm=i(nn);ul=n(fm,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),fm.forEach(r),_l=n(Ts,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ts.forEach(r),wl=m(go),W=a(go,"DIV",{class:!0});var po=i(W);v(mr.$$.fragment,po),Tl=m(po),xe=a(po,"P",{});var ut=i(xe);vl=n(ut,"The "),Yr=a(ut,"A",{href:!0});var um=i(Yr);bl=n(um,"BridgeTowerForImageAndTextRetrieval"),um.forEach(r),yl=n(ut," forward method, overrides the "),sn=a(ut,"CODE",{});var _m=i(sn);Bl=n(_m,"__call__"),_m.forEach(r),xl=n(ut," special method."),ut.forEach(r),kl=m(po),v(Ze.$$.fragment,po),$l=m(po),v(eo.$$.fragment,po),po.forEach(r),go.forEach(r),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Am)),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(ke,"id","overview"),l(ke,"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(ke,"href","#overview"),l(oe,"class","relative group"),l(fo,"href","https://arxiv.org/abs/2206.08657"),l(fo,"rel","nofollow"),l(uo,"href","https://aaai.org/Conferences/AAAI-23/"),l(uo,"rel","nofollow"),ym(je.src,zl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/bridgetower_architecture%20.jpg")||l(je,"src",zl),l(je,"alt","drawing"),l(je,"width","600"),l(vr,"href","https://arxiv.org/abs/2206.08657"),l(ze,"id","usage"),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","#usage"),l(re,"class","relative group"),l(yr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(Br,"href","/docs/transformers/v4.27.1/en/model_doc/roberta#transformers.RobertaTokenizer"),l(xr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor"),l(kr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l($r,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerForContrastiveLearning"),l(Pr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(jr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerForImageAndTextRetrieval"),l(zr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(Ir,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerForMaskedLM"),l(yo,"href","https://huggingface.co/anahita-b"),l(yo,"rel","nofollow"),l(Bo,"href","https://huggingface.co/Tile"),l(Bo,"rel","nofollow"),l(xo,"href","https://huggingface.co/shaoyent"),l(xo,"rel","nofollow"),l(ko,"href","https://github.com/microsoft/BridgeTower"),l(ko,"rel","nofollow"),l(Cr,"href","/docs/transformers/v4.27.1/en/model_doc/roberta#transformers.RobertaTokenizer"),l(Po,"href","https://huggingface.co/BridgeTower/bridgetower-base"),l(Po,"rel","nofollow"),l(jo,"href","https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm"),l(jo,"rel","nofollow"),l(Io,"href","https://arxiv.org/pdf/2206.08657.pdf"),l(Io,"rel","nofollow"),l(Ie,"id","transformers.BridgeTowerConfig"),l(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ie,"href","#transformers.BridgeTowerConfig"),l(ne,"class","relative group"),l(Mr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(Mo,"href","https://huggingface.co/BridgeTower/bridgetower-base/"),l(Mo,"rel","nofollow"),l(Fr,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(Lr,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ar,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerConfig"),l(qr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerConfig"),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(Or,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),l(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Fe,"id","transformers.BridgeTowerTextConfig"),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.BridgeTowerTextConfig"),l(de,"class","relative group"),l(Rr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(Ro,"href","https://huggingface.co/BridgeTower/bridgetower-base/"),l(Ro,"rel","nofollow"),l(Nr,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(Dr,"href","/docs/transformers/v4.27.1/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(Ae,"id","transformers.BridgeTowerVisionConfig"),l(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ae,"href","#transformers.BridgeTowerVisionConfig"),l(me,"class","relative group"),l(Sr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerModel"),l(So,"href","https://huggingface.co/BridgeTower/bridgetower-base/"),l(So,"rel","nofollow"),l(Wr,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(Vr,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Oe,"id","transformers.BridgeTowerImageProcessor"),l(Oe,"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(Oe,"href","#transformers.BridgeTowerImageProcessor"),l(he,"class","relative group"),l(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(G,"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.BridgeTowerProcessor"),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.BridgeTowerProcessor"),l(fe,"class","relative group"),l(Ur,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerProcessor"),l(Gr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerImageProcessor"),l(Hr,"href","/docs/transformers/v4.27.1/en/model_doc/roberta#transformers.RobertaTokenizerFast"),l(Xo,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerProcessor.__call__"),l(De,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__"),l(Se,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),l(K,"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(We,"id","transformers.BridgeTowerModel"),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.BridgeTowerModel"),l(_e,"class","relative group"),l(Xr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerModel"),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(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ge,"id","transformers.BridgeTowerForContrastiveLearning"),l(Ge,"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(Ge,"href","#transformers.BridgeTowerForContrastiveLearning"),l(Te,"class","relative group"),l(Jr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerForContrastiveLearning"),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(L,"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.BridgeTowerForMaskedLM"),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.BridgeTowerForMaskedLM"),l(be,"class","relative group"),l(Qr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerForMaskedLM"),l(S,"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(Ke,"id","transformers.BridgeTowerForImageAndTextRetrieval"),l(Ke,"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(Ke,"href","#transformers.BridgeTowerForImageAndTextRetrieval"),l(Be,"class","relative group"),l(Yr,"href","/docs/transformers/v4.27.1/en/model_doc/bridgetower#transformers.BridgeTowerForImageAndTextRetrieval"),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(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,p),h(o,k,g),h(o,_,g),e(_,f),e(f,w),b(d,w,null),e(_,u),e(_,P),e(P,bs),h(o,hn,g),h(o,oe,g),e(oe,ke),e(ke,_t),b(ho,_t,null),e(oe,ys),e(oe,wt),e(wt,Bs),h(o,fn,g),h(o,$e,g),e($e,xs),e($e,fo),e(fo,ks),e($e,$s),h(o,un,g),h(o,Pe,g),e(Pe,Ps),e(Pe,uo),e(uo,js),e(Pe,zs),h(o,_n,g),h(o,wr,g),e(wr,Is),h(o,wn,g),h(o,Tr,g),e(Tr,Tt),e(Tt,Es),h(o,Tn,g),h(o,je,g),h(o,vn,g),h(o,_o,g),e(_o,Cs),e(_o,vr),e(vr,Ms),h(o,bn,g),h(o,re,g),e(re,ze),e(ze,vt),b(wo,vt,null),e(re,Fs),e(re,bt),e(bt,Ls),h(o,yn,g),h(o,br,g),e(br,As),h(o,Bn,g),h(o,O,g),e(O,qs),e(O,yr),e(yr,Os),e(O,Rs),e(O,Br),e(Br,Ns),e(O,Ds),e(O,xr),e(xr,Ss),e(O,Ws),h(o,xn,g),h(o,J,g),e(J,Vs),e(J,kr),e(kr,Us),e(J,Gs),e(J,$r),e($r,Hs),e(J,Xs),h(o,kn,g),b(To,o,g),h(o,$n,g),h(o,Q,g),e(Q,Js),e(Q,Pr),e(Pr,Qs),e(Q,Ys),e(Q,jr),e(jr,Ks),e(Q,Zs),h(o,Pn,g),b(vo,o,g),h(o,jn,g),h(o,Y,g),e(Y,ea),e(Y,zr),e(zr,oa),e(Y,ra),e(Y,Ir),e(Ir,ta),e(Y,na),h(o,zn,g),b(bo,o,g),h(o,In,g),h(o,I,g),e(I,sa),e(I,yo),e(yo,aa),e(I,ia),e(I,Bo),e(Bo,da),e(I,la),e(I,xo),e(xo,ca),e(I,ma),e(I,ko),e(ko,ga),e(I,pa),h(o,En,g),h(o,Er,g),e(Er,ha),h(o,Cn,g),h(o,R,g),e(R,$o),e($o,fa),e($o,Cr),e(Cr,ua),e($o,_a),e(R,wa),e(R,te),e(te,Ta),e(te,Po),e(Po,va),e(te,ba),e(te,jo),e(jo,ya),e(te,Ba),e(R,xa),e(R,zo),e(zo,ka),e(zo,Io),e(Io,$a),e(zo,Pa),e(R,ja),e(R,yt),e(yt,za),h(o,Mn,g),h(o,ne,g),e(ne,Ie),e(Ie,Bt),b(Eo,Bt,null),e(ne,Ia),e(ne,xt),e(xt,Ea),h(o,Fn,g),h(o,j,g),b(Co,j,null),e(j,Ca),e(j,se),e(se,Ma),e(se,Mr),e(Mr,Fa),e(se,La),e(se,Mo),e(Mo,Aa),e(se,qa),e(j,Oa),e(j,ae),e(ae,Ra),e(ae,Fr),e(Fr,Na),e(ae,Da),e(ae,Lr),e(Lr,Sa),e(ae,Wa),e(j,Va),b(Ee,j,null),e(j,Ua),e(j,Ce),b(Fo,Ce,null),e(Ce,Ga),e(Ce,ie),e(ie,Ha),e(ie,Ar),e(Ar,Xa),e(ie,Ja),e(ie,qr),e(qr,Qa),e(ie,Ya),e(j,Ka),e(j,Me),b(Lo,Me,null),e(Me,Za),e(Me,Ao),e(Ao,ei),e(Ao,Or),e(Or,oi),e(Ao,ri),h(o,Ln,g),h(o,de,g),e(de,Fe),e(Fe,kt),b(qo,kt,null),e(de,ti),e(de,$t),e($t,ni),h(o,An,g),h(o,C,g),b(Oo,C,null),e(C,si),e(C,le),e(le,ai),e(le,Rr),e(Rr,ii),e(le,di),e(le,Ro),e(Ro,li),e(le,ci),e(C,mi),e(C,ce),e(ce,gi),e(ce,Nr),e(Nr,pi),e(ce,hi),e(ce,Dr),e(Dr,fi),e(ce,ui),e(C,_i),b(Le,C,null),h(o,qn,g),h(o,me,g),e(me,Ae),e(Ae,Pt),b(No,Pt,null),e(me,wi),e(me,jt),e(jt,Ti),h(o,On,g),h(o,M,g),b(Do,M,null),e(M,vi),e(M,ge),e(ge,bi),e(ge,Sr),e(Sr,yi),e(ge,Bi),e(ge,So),e(So,xi),e(ge,ki),e(M,$i),e(M,pe),e(pe,Pi),e(pe,Wr),e(Wr,ji),e(pe,zi),e(pe,Vr),e(Vr,Ii),e(pe,Ei),e(M,Ci),b(qe,M,null),h(o,Rn,g),h(o,he,g),e(he,Oe),e(Oe,zt),b(Wo,zt,null),e(he,Mi),e(he,It),e(It,Fi),h(o,Nn,g),h(o,G,g),b(Vo,G,null),e(G,Li),e(G,Et),e(Et,Ai),e(G,qi),e(G,Re),b(Uo,Re,null),e(Re,Oi),e(Re,Ct),e(Ct,Ri),h(o,Dn,g),h(o,fe,g),e(fe,Ne),e(Ne,Mt),b(Go,Mt,null),e(fe,Ni),e(fe,Ft),e(Ft,Di),h(o,Sn,g),h(o,F,g),b(Ho,F,null),e(F,Si),e(F,Lt),e(Lt,Wi),e(F,Vi),e(F,E),e(E,Ur),e(Ur,Ui),e(E,Gi),e(E,Gr),e(Gr,Hi),e(E,Xi),e(E,Hr),e(Hr,Ji),e(E,Qi),e(E,Xo),e(Xo,At),e(At,Yi),e(Xo,Ki),e(E,Zi),e(E,qt),e(qt,ed),e(E,od),e(F,rd),e(F,K),b(Jo,K,null),e(K,td),e(K,ue),e(ue,nd),e(ue,De),e(De,sd),e(De,Ot),e(Ot,ad),e(De,id),e(ue,dd),e(ue,Se),e(Se,ld),e(Se,Rt),e(Rt,cd),e(Se,md),e(ue,gd),e(K,pd),e(K,Nt),e(Nt,hd),h(o,Wn,g),h(o,_e,g),e(_e,We),e(We,Dt),b(Qo,Dt,null),e(_e,fd),e(_e,St),e(St,ud),h(o,Vn,g),h(o,H,g),b(Yo,H,null),e(H,_d),e(H,Ko),e(Ko,wd),e(Ko,Wt),e(Wt,Td),e(Ko,vd),e(H,bd),e(H,N),b(Zo,N,null),e(N,yd),e(N,we),e(we,Bd),e(we,Xr),e(Xr,xd),e(we,kd),e(we,Vt),e(Vt,$d),e(we,Pd),e(N,jd),b(Ve,N,null),e(N,zd),b(Ue,N,null),h(o,Un,g),h(o,Te,g),e(Te,Ge),e(Ge,Ut),b(er,Ut,null),e(Te,Id),e(Te,Gt),e(Gt,Ed),h(o,Gn,g),h(o,L,g),b(or,L,null),e(L,Cd),e(L,Ht),e(Ht,Md),e(L,Fd),e(L,rr),e(rr,Ld),e(rr,Xt),e(Xt,Ad),e(rr,qd),e(L,Od),e(L,D),b(tr,D,null),e(D,Rd),e(D,ve),e(ve,Nd),e(ve,Jr),e(Jr,Dd),e(ve,Sd),e(ve,Jt),e(Jt,Wd),e(ve,Vd),e(D,Ud),b(He,D,null),e(D,Gd),b(Xe,D,null),h(o,Hn,g),h(o,be,g),e(be,Je),e(Je,Qt),b(nr,Qt,null),e(be,Hd),e(be,Yt),e(Yt,Xd),h(o,Xn,g),h(o,A,g),b(sr,A,null),e(A,Jd),e(A,Kt),e(Kt,Qd),e(A,Yd),e(A,ar),e(ar,Kd),e(ar,Zt),e(Zt,Zd),e(ar,el),e(A,ol),e(A,S),b(ir,S,null),e(S,rl),e(S,ye),e(ye,tl),e(ye,Qr),e(Qr,nl),e(ye,sl),e(ye,en),e(en,al),e(ye,il),e(S,dl),b(Qe,S,null),e(S,ll),b(Ye,S,null),h(o,Jn,g),h(o,Be,g),e(Be,Ke),e(Ke,on),b(dr,on,null),e(Be,cl),e(Be,rn),e(rn,ml),h(o,Qn,g),h(o,q,g),b(lr,q,null),e(q,gl),e(q,tn),e(tn,pl),e(q,hl),e(q,cr),e(cr,fl),e(cr,nn),e(nn,ul),e(cr,_l),e(q,wl),e(q,W),b(mr,W,null),e(W,Tl),e(W,xe),e(xe,vl),e(xe,Yr),e(Yr,bl),e(xe,yl),e(xe,sn),e(sn,Bl),e(xe,xl),e(W,kl),b(Ze,W,null),e(W,$l),b(eo,W,null),Yn=!0},p(o,[g]){const gr={};g&2&&(gr.$$scope={dirty:g,ctx:o}),Ee.$set(gr);const an={};g&2&&(an.$$scope={dirty:g,ctx:o}),Le.$set(an);const dn={};g&2&&(dn.$$scope={dirty:g,ctx:o}),qe.$set(dn);const ln={};g&2&&(ln.$$scope={dirty:g,ctx:o}),Ve.$set(ln);const pr={};g&2&&(pr.$$scope={dirty:g,ctx:o}),Ue.$set(pr);const cn={};g&2&&(cn.$$scope={dirty:g,ctx:o}),He.$set(cn);const mn={};g&2&&(mn.$$scope={dirty:g,ctx:o}),Xe.$set(mn);const gn={};g&2&&(gn.$$scope={dirty:g,ctx:o}),Qe.$set(gn);const hr={};g&2&&(hr.$$scope={dirty:g,ctx:o}),Ye.$set(hr);const pn={};g&2&&(pn.$$scope={dirty:g,ctx:o}),Ze.$set(pn);const fr={};g&2&&(fr.$$scope={dirty:g,ctx:o}),eo.$set(fr)},i(o){Yn||(y(d.$$.fragment,o),y(ho.$$.fragment,o),y(wo.$$.fragment,o),y(To.$$.fragment,o),y(vo.$$.fragment,o),y(bo.$$.fragment,o),y(Eo.$$.fragment,o),y(Co.$$.fragment,o),y(Ee.$$.fragment,o),y(Fo.$$.fragment,o),y(Lo.$$.fragment,o),y(qo.$$.fragment,o),y(Oo.$$.fragment,o),y(Le.$$.fragment,o),y(No.$$.fragment,o),y(Do.$$.fragment,o),y(qe.$$.fragment,o),y(Wo.$$.fragment,o),y(Vo.$$.fragment,o),y(Uo.$$.fragment,o),y(Go.$$.fragment,o),y(Ho.$$.fragment,o),y(Jo.$$.fragment,o),y(Qo.$$.fragment,o),y(Yo.$$.fragment,o),y(Zo.$$.fragment,o),y(Ve.$$.fragment,o),y(Ue.$$.fragment,o),y(er.$$.fragment,o),y(or.$$.fragment,o),y(tr.$$.fragment,o),y(He.$$.fragment,o),y(Xe.$$.fragment,o),y(nr.$$.fragment,o),y(sr.$$.fragment,o),y(ir.$$.fragment,o),y(Qe.$$.fragment,o),y(Ye.$$.fragment,o),y(dr.$$.fragment,o),y(lr.$$.fragment,o),y(mr.$$.fragment,o),y(Ze.$$.fragment,o),y(eo.$$.fragment,o),Yn=!0)},o(o){B(d.$$.fragment,o),B(ho.$$.fragment,o),B(wo.$$.fragment,o),B(To.$$.fragment,o),B(vo.$$.fragment,o),B(bo.$$.fragment,o),B(Eo.$$.fragment,o),B(Co.$$.fragment,o),B(Ee.$$.fragment,o),B(Fo.$$.fragment,o),B(Lo.$$.fragment,o),B(qo.$$.fragment,o),B(Oo.$$.fragment,o),B(Le.$$.fragment,o),B(No.$$.fragment,o),B(Do.$$.fragment,o),B(qe.$$.fragment,o),B(Wo.$$.fragment,o),B(Vo.$$.fragment,o),B(Uo.$$.fragment,o),B(Go.$$.fragment,o),B(Ho.$$.fragment,o),B(Jo.$$.fragment,o),B(Qo.$$.fragment,o),B(Yo.$$.fragment,o),B(Zo.$$.fragment,o),B(Ve.$$.fragment,o),B(Ue.$$.fragment,o),B(er.$$.fragment,o),B(or.$$.fragment,o),B(tr.$$.fragment,o),B(He.$$.fragment,o),B(Xe.$$.fragment,o),B(nr.$$.fragment,o),B(sr.$$.fragment,o),B(ir.$$.fragment,o),B(Qe.$$.fragment,o),B(Ye.$$.fragment,o),B(dr.$$.fragment,o),B(lr.$$.fragment,o),B(mr.$$.fragment,o),B(Ze.$$.fragment,o),B(eo.$$.fragment,o),Yn=!1},d(o){r(p),o&&r(k),o&&r(_),x(d),o&&r(hn),o&&r(oe),x(ho),o&&r(fn),o&&r($e),o&&r(un),o&&r(Pe),o&&r(_n),o&&r(wr),o&&r(wn),o&&r(Tr),o&&r(Tn),o&&r(je),o&&r(vn),o&&r(_o),o&&r(bn),o&&r(re),x(wo),o&&r(yn),o&&r(br),o&&r(Bn),o&&r(O),o&&r(xn),o&&r(J),o&&r(kn),x(To,o),o&&r($n),o&&r(Q),o&&r(Pn),x(vo,o),o&&r(jn),o&&r(Y),o&&r(zn),x(bo,o),o&&r(In),o&&r(I),o&&r(En),o&&r(Er),o&&r(Cn),o&&r(R),o&&r(Mn),o&&r(ne),x(Eo),o&&r(Fn),o&&r(j),x(Co),x(Ee),x(Fo),x(Lo),o&&r(Ln),o&&r(de),x(qo),o&&r(An),o&&r(C),x(Oo),x(Le),o&&r(qn),o&&r(me),x(No),o&&r(On),o&&r(M),x(Do),x(qe),o&&r(Rn),o&&r(he),x(Wo),o&&r(Nn),o&&r(G),x(Vo),x(Uo),o&&r(Dn),o&&r(fe),x(Go),o&&r(Sn),o&&r(F),x(Ho),x(Jo),o&&r(Wn),o&&r(_e),x(Qo),o&&r(Vn),o&&r(H),x(Yo),x(Zo),x(Ve),x(Ue),o&&r(Un),o&&r(Te),x(er),o&&r(Gn),o&&r(L),x(or),x(tr),x(He),x(Xe),o&&r(Hn),o&&r(be),x(nr),o&&r(Xn),o&&r(A),x(sr),x(ir),x(Qe),x(Ye),o&&r(Jn),o&&r(Be),x(dr),o&&r(Qn),o&&r(q),x(lr),x(mr),x(Ze),x(eo)}}}const Am={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.BridgeTowerForContrastiveLearning",title:"BridgeTowerForContrastiveLearning"},{local:"transformers.BridgeTowerForMaskedLM",title:"BridgeTowerForMaskedLM"},{local:"transformers.BridgeTowerForImageAndTextRetrieval",title:"BridgeTowerForImageAndTextRetrieval"}],title:"BridgeTower"};function qm($){return Bm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vm extends wm{constructor(p){super();Tm(this,p,qm,Lm,vm,{})}}export{Vm as default,Am as metadata};
