import{S as $f,i as wf,s as zf,e as a,k as c,w as b,t as s,M as If,c as r,d as t,m,a as n,x as k,h as i,b as d,G as e,g as u,y as F,q as y,o as x,B as T,v as Mf,L as Po}from"../../chunks/vendor-hf-doc-builder.js";import{T as da}from"../../chunks/Tip-hf-doc-builder.js";import{D as w}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Co}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as E}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Mo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Pf(z){let p,$,_,h,v;return h=new Co({props:{code:`from transformers import FlavaConfig, FlavaModel, FlavaForPreTraining

# Initializing a FlavaConfig with style configuration
configuration = FlavaConfig()

# Initializing a FlavaModel and FlavaForPreTraining model (with random weights) from the style configuration
model = FlavaModel(configuration)
model_pre = FlavaForPreTraining(configuration)

# Accessing the model configuration
configuration = model.config
configuration_pre = model_pre.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaConfig, FlavaModel, FlavaForPreTraining

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaModel and FlavaForPreTraining model (with random weights) from the style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaModel(configuration)
<span class="hljs-meta">&gt;&gt;&gt; </span>model_pre = FlavaForPreTraining(configuration)

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

# Initializing a FlavaTextModel with  style configuration
configuration = FlavaTextConfig()

# Initializing a FlavaTextModel model (with random weights) from the style configuration
model = FlavaTextModel(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> FlavaTextConfig, FlavaTextModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaTextModel model (with random weights) from the style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaTextModel(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=a("p"),$=s("Example:"),_=c(),b(h.$$.fragment)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Example:"),f.forEach(t),_=m(l),k(h.$$.fragment,l)},m(l,f){u(l,p,f),e(p,$),u(l,_,f),F(h,l,f),v=!0},p:Po,i(l){v||(y(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(_),T(h,l)}}}function Ef(z){let p,$,_,h,v;return h=new Co({props:{code:`from transformers import FlavaImageConfig, FlavaImageModel

# Initializing a FlavaImageModel with  style configuration
configuration = FlavaImageConfig()

# Initializing a FlavaImageModel model (with random weights) from the style configuration
model = FlavaImageModel(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> FlavaImageConfig, FlavaImageModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaImageModel model (with random weights) from the style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaImageModel(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=a("p"),$=s("Example:"),_=c(),b(h.$$.fragment)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Example:"),f.forEach(t),_=m(l),k(h.$$.fragment,l)},m(l,f){u(l,p,f),e(p,$),u(l,_,f),F(h,l,f),v=!0},p:Po,i(l){v||(y(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(_),T(h,l)}}}function Af(z){let p,$,_,h,v;return h=new Co({props:{code:`from transformers import FlavaMultimodalConfig, FlavaMultimodalModel

# Initializing a FlavaMultimodalModel with  style configuration
configuration = FlavaMultimodalConfig()

# Initializing a FlavaMultimodalModel model (with random weights) from the style configuration
model = FlavaMultimodalModel(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> FlavaMultimodalConfig, FlavaMultimodalModel

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

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

model = FlavaModel.from_pretrained("facebook/flava-full")
processor = FlavaProcessor.from_pretrained("facebook/flava-full")

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

inputs = processor(text=["a photo of a cat"], images=image, return_tensors="pt", padding=True)

outputs = model(**inputs)
logits_per_image = outputs.contrastive_logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaProcessor, FlavaModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = FlavaProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.contrastive_logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){p=a("p"),$=s("Examples:"),_=c(),b(h.$$.fragment)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Examples:"),f.forEach(t),_=m(l),k(h.$$.fragment,l)},m(l,f){u(l,p,f),e(p,$),u(l,_,f),F(h,l,f),v=!0},p:Po,i(l){v||(y(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(_),T(h,l)}}}function qf(z){let p,$,_,h,v;return{c(){p=a("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var I=n(_);h=i(I,"Module"),I.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){u(l,p,f),e(p,$),e(p,_),e(_,h),e(p,v)},d(l){l&&t(p)}}}function Lf(z){let p,$,_,h,v;return{c(){p=a("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var I=n(_);h=i(I,"Module"),I.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){u(l,p,f),e(p,$),e(p,_),e(_,h),e(p,v)},d(l){l&&t(p)}}}function jf(z){let p,$,_,h,v;return{c(){p=a("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var I=n(_);h=i(I,"Module"),I.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){u(l,p,f),e(p,$),e(p,_),e(_,h),e(p,v)},d(l){l&&t(p)}}}function Wf(z){let p,$,_,h,v;return h=new Co({props:{code:`from transformers import BertTokenizer, FlavaTextModel
import torch

tokenizer = BertTokenizer.from_pretrained("facebook/flava-full")
model = FlavaTextModel.from_pretrained("facebook/flava-full")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, FlavaTextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaTextModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){p=a("p"),$=s("Example:"),_=c(),b(h.$$.fragment)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Example:"),f.forEach(t),_=m(l),k(h.$$.fragment,l)},m(l,f){u(l,p,f),e(p,$),u(l,_,f),F(h,l,f),v=!0},p:Po,i(l){v||(y(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(_),T(h,l)}}}function Sf(z){let p,$,_,h,v;return{c(){p=a("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var I=n(_);h=i(I,"Module"),I.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){u(l,p,f),e(p,$),e(p,_),e(_,h),e(p,v)},d(l){l&&t(p)}}}function Rf(z){let p,$,_,h,v;return h=new Co({props:{code:`from transformers import FlavaFeatureExtractor, FlavaImageModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = FlavaFeatureExtractor.from_pretrained("facebook/flava-full")
model = FlavaImageModel.from_pretrained("facebook/flava-full")

inputs = feature_extractor(image, return_tensors="pt")

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

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaFeatureExtractor, FlavaImageModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = FlavaFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaImageModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">197</span>, <span class="hljs-number">768</span>]`}}),{c(){p=a("p"),$=s("Example:"),_=c(),b(h.$$.fragment)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Example:"),f.forEach(t),_=m(l),k(h.$$.fragment,l)},m(l,f){u(l,p,f),e(p,$),u(l,_,f),F(h,l,f),v=!0},p:Po,i(l){v||(y(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(_),T(h,l)}}}function Bf(z){let p,$,_,h,v;return{c(){p=a("p"),$=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var I=n(_);h=i(I,"Module"),I.forEach(t),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(l,f){u(l,p,f),e(p,$),e(p,_),e(_,h),e(p,v)},d(l){l&&t(p)}}}function Vf(z){let p,$,_,h,v;return h=new Co({props:{code:`from transformers import BertTokenizer, FlavaMultimodalModel
import torch

tokenizer = BertTokenizer.from_pretrained("facebook/flava-full")
model = FlavaMultimodalModel.from_pretrained("facebook/flava-full")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, FlavaMultimodalModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaMultimodalModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){p=a("p"),$=s("Example:"),_=c(),b(h.$$.fragment)},l(l){p=r(l,"P",{});var f=n(p);$=i(f,"Example:"),f.forEach(t),_=m(l),k(h.$$.fragment,l)},m(l,f){u(l,p,f),e(p,$),u(l,_,f),F(h,l,f),v=!0},p:Po,i(l){v||(y(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&t(p),l&&t(_),T(h,l)}}}function Uf(z){let p,$,_,h,v,l,f,I,Ss,vn,le,De,dr,Eo,Rs,cr,Bs,bn,qe,Vs,Ao,Us,Hs,kn,ca,Gs,Fn,ma,Ys,yn,pa,mr,Zs,xn,X,Js,No,Ks,Xs,Oo,Qs,ei,Tn,de,Le,pr,Do,oi,fr,ti,$n,P,qo,ai,Q,fa,ri,ni,ga,si,ii,Lo,li,di,ci,ce,mi,ha,pi,fi,ua,gi,hi,ui,je,_i,We,jo,vi,Wo,bi,_a,ki,Fi,yi,Se,So,xi,Ro,Ti,va,$i,wi,wn,me,Re,gr,Bo,zi,hr,Ii,zn,A,Vo,Mi,Uo,Pi,ba,Ci,Ei,Ai,Ho,Ni,Go,Oi,Di,qi,pe,Li,ka,ji,Wi,Fa,Si,Ri,Bi,Be,In,fe,Ve,ur,Yo,Vi,_r,Ui,Mn,N,Zo,Hi,Jo,Gi,ya,Yi,Zi,Ji,Ko,Ki,Xo,Xi,Qi,el,ge,ol,xa,tl,al,Ta,rl,nl,sl,Ue,Pn,he,He,vr,Qo,il,br,ll,Cn,O,et,dl,ot,cl,$a,ml,pl,fl,tt,gl,at,hl,ul,_l,ue,vl,wa,bl,kl,za,Fl,yl,xl,Ge,En,_e,Ye,kr,rt,Tl,Fr,$l,An,nt,st,Nn,ve,Ze,yr,it,wl,xr,zl,On,D,lt,Il,Tr,Ml,Pl,L,Ia,Cl,El,Ma,Al,Nl,Pa,Ol,Dl,$r,ql,Ll,Ca,jl,Wl,Sl,Je,dt,Rl,ct,Bl,Ea,Vl,Ul,Hl,Ke,mt,Gl,pt,Yl,Aa,Zl,Jl,Dn,be,Xe,wr,ft,Kl,zr,Xl,qn,M,gt,Ql,Ir,ed,od,Qe,ht,td,ke,ad,Mr,rd,nd,Pr,sd,id,ld,eo,ut,dd,Cr,cd,md,oo,_t,pd,Er,fd,gd,to,vt,hd,Ar,ud,_d,ao,bt,vd,kt,bd,Nr,kd,Fd,Ln,Fe,ro,Or,Ft,yd,Dr,xd,jn,G,yt,Td,qr,$d,wd,no,xt,zd,Lr,Id,Wn,ye,so,jr,Tt,Md,Wr,Pd,Sn,W,$t,Cd,Sr,Ed,Ad,wt,Nd,zt,Od,Dd,qd,ee,It,Ld,xe,jd,Na,Wd,Sd,Rr,Rd,Bd,Vd,io,Rn,Te,lo,Br,Mt,Ud,Vr,Hd,Bn,q,Pt,Gd,Ct,Yd,Et,Zd,Jd,Kd,S,At,Xd,$e,Qd,Oa,ec,oc,Ur,tc,ac,rc,co,nc,mo,sc,oe,Nt,ic,we,lc,Da,dc,cc,Hr,mc,pc,fc,po,gc,te,Ot,hc,ze,uc,qa,_c,vc,Gr,bc,kc,Fc,fo,Vn,Ie,go,Yr,Dt,yc,Zr,xc,Un,C,qt,Tc,Lt,$c,Jr,wc,zc,Ic,jt,Mc,Wt,Pc,Cc,Ec,La,St,Ac,ja,Rt,Nc,Wa,Bt,Hn,Me,ho,Kr,Vt,Oc,Xr,Dc,Gn,Y,Ut,qc,Ht,Lc,Gt,jc,Wc,Sc,R,Yt,Rc,Pe,Bc,Sa,Vc,Uc,Qr,Hc,Gc,Yc,uo,Zc,_o,Yn,Ce,vo,en,Zt,Jc,on,Kc,Zn,Z,Jt,Xc,Kt,Qc,Xt,em,om,tm,B,Qt,am,Ee,rm,Ra,nm,sm,tn,im,lm,dm,bo,cm,ko,Jn,Ae,Fo,an,ea,mm,rn,pm,Kn,J,oa,fm,ta,gm,aa,hm,um,_m,V,ra,vm,Ne,bm,Ba,km,Fm,nn,ym,xm,Tm,yo,$m,xo,Xn;return l=new E({}),Eo=new E({}),Do=new E({}),qo=new w({props:{name:"class transformers.FlavaConfig",anchor:"transformers.FlavaConfig",parameters:[{name:"image_config",val:": typing.Dict[str, typing.Any] = None"},{name:"text_config",val:": typing.Dict[str, typing.Any] = None"},{name:"multimodal_config",val:": typing.Dict[str, typing.Any] = None"},{name:"image_codebook_config",val:": typing.Dict[str, typing.Any] = None"},{name:"hidden_size",val:": int = 768"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"projection_dim",val:": int = 768"},{name:"init_codebook",val:": bool = True"},{name:"logit_scale_init_value",val:": float = 2.6592"},{name:"initializer_range",val:": float = 0.02"},{name:"ce_ignore_index",val:": int = -100"},{name:"mim_weight",val:": float = 1.0"},{name:"mlm_weight",val:": float = 1.0"},{name:"global_contrastive_weight",val:": float = 1.0"},{name:"itm_weight",val:": float = 1.0"},{name:"mmm_image_weight",val:": float = 1.0"},{name:"mmm_text_weight",val:": float = 1.0"},{name:"global_backprop_contrastive",val:": bool = True"},{name:"skip_unmasked_multimodal_encoder",val:": bool = True"},{name:"return_loss",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaConfig.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.25.1/en/model_doc/flava#transformers.FlavaTextConfig">FlavaTextConfig</a>.`,name:"text_config"},{anchor:"transformers.FlavaConfig.image_config",description:`<strong>image_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageConfig">FlavaImageConfig</a>.`,name:"image_config"},{anchor:"transformers.FlavaConfig.multimodal_config",description:`<strong>multimodal_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalConfig">FlavaMultimodalConfig</a>.`,name:"multimodal_config"},{anchor:"transformers.FlavaConfig.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.FlavaConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.FlavaConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and image projection layers.`,name:"projection_dim"},{anchor:"transformers.FlavaConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original FLAVA/CLIP
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.FlavaConfig.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.FlavaConfig.ce_ignore_index",description:`<strong>ce_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
Cross entropy index to ignore.`,name:"ce_ignore_index"},{anchor:"transformers.FlavaConfig.mim_weight",description:`<strong>mim_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MIM (Masked Image Modeling) unimodal loss`,name:"mim_weight"},{anchor:"transformers.FlavaConfig.mlm_weight",description:`<strong>mlm_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MLM (Masked Language Modeling) unimodal loss`,name:"mlm_weight"},{anchor:"transformers.FlavaConfig.global_contrastive_weight",description:`<strong>global_contrastive_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to global contrastive cross-alignment loss.`,name:"global_contrastive_weight"},{anchor:"transformers.FlavaConfig.itm_weight",description:`<strong>itm_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to image-text matching multimodal loss.`,name:"itm_weight"},{anchor:"transformers.FlavaConfig.mmm_image_weight",description:`<strong>mmm_image_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MMM loss&#x2019;s image part.`,name:"mmm_image_weight"},{anchor:"transformers.FlavaConfig.mmm_text_weight",description:`<strong>mmm_text_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MMM loss&#x2019;s text part.`,name:"mmm_text_weight"},{anchor:"transformers.FlavaConfig.global_backprop_contrastive",description:`<strong>global_backprop_contrastive</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use global backpropgation through all workers in contrastive loss.`,name:"global_backprop_contrastive"},{anchor:"transformers.FlavaConfig.skip_unmasked_multimodal_encoder",description:`<strong>skip_unmasked_multimodal_encoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to skip running unmasked multimodal encoder whose outputs are not used by FLAVA losses.`,name:"skip_unmasked_multimodal_encoder"},{anchor:"transformers.FlavaConfig.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return loss or not`,name:"return_loss"},{anchor:"transformers.FlavaConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L463"}}),je=new Mo({props:{anchor:"transformers.FlavaConfig.example",$$slots:{default:[Pf]},$$scope:{ctx:z}}}),jo=new w({props:{name:"from_configs",anchor:"transformers.FlavaConfig.from_configs",parameters:[{name:"image_config",val:": FlavaImageConfig"},{name:"text_config",val:": FlavaTextConfig"},{name:"multimodal_config",val:": FlavaMultimodalConfig"},{name:"image_codebook_config",val:": FlavaImageCodebookConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L617",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaConfig"
>FlavaConfig</a></p>
`}}),So=new w({props:{name:"to_dict",anchor:"transformers.FlavaConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L642",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),Bo=new E({}),Vo=new w({props:{name:"class transformers.FlavaTextConfig",anchor:"transformers.FlavaTextConfig",parameters:[{name:"vocab_size",val:": int = 30522"},{name:"type_vocab_size",val:": int = 2"},{name:"max_position_embeddings",val:": int = 512"},{name:"position_embedding_type",val:": str = 'absolute'"},{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": str = 'gelu'"},{name:"hidden_dropout_prob",val:": float = 0.0"},{name:"attention_probs_dropout_prob",val:": float = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"pad_token_id",val:": int = 0"},{name:"qkv_bias",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the BERT 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.25.1/en/model_doc/flava#transformers.FlavaTextModel">FlavaTextModel</a>.`,name:"vocab_size"},{anchor:"transformers.FlavaTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel">FlavaTextModel</a>. Note that even though
text encoder allows <code>token_type_ids</code>&#x2019;s value as 2, for text-only pretraining and fine-tuning, only 1 is
used similar to RoBERTa.`,name:"type_vocab_size"},{anchor:"transformers.FlavaTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048). For VL, max_length passed to model is 77.`,name:"max_position_embeddings"},{anchor:"transformers.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.FlavaTextConfig.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. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.FlavaTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.FlavaTextConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.FlavaTextConfig.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.FlavaTextConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.FlavaTextConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L150"}}),Be=new Mo({props:{anchor:"transformers.FlavaTextConfig.example",$$slots:{default:[Cf]},$$scope:{ctx:z}}}),Yo=new E({}),Zo=new w({props:{name:"class transformers.FlavaImageConfig",anchor:"transformers.FlavaImageConfig",parameters:[{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": int = 'gelu'"},{name:"hidden_dropout_prob",val:": float = 0.0"},{name:"attention_probs_dropout_prob",val:": float = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"image_size",val:": int = 224"},{name:"patch_size",val:": int = 16"},{name:"num_channels",val:": int = 3"},{name:"qkv_bias",val:": bool = True"},{name:"mask_token",val:": bool = True"},{name:"vocab_size",val:": int = 8192"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.FlavaImageConfig.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. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.FlavaImageConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.FlavaImageConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.FlavaImageConfig.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.FlavaImageConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.FlavaImageConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.FlavaImageConfig.mask_token",description:`<strong>mask_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use a mask token or not. Used in MIM (Masked Image Modeling) loss for FLAVA.`,name:"mask_token"},{anchor:"transformers.FlavaImageConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Vocabulary size of the <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a> used in conjunction with <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel">FlavaImageModel</a> for MIM (Masked
Image Modeling) loss for FLAVA.`,name:"vocab_size"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L32"}}),Ue=new Mo({props:{anchor:"transformers.FlavaImageConfig.example",$$slots:{default:[Ef]},$$scope:{ctx:z}}}),Qo=new E({}),et=new w({props:{name:"class transformers.FlavaMultimodalConfig",anchor:"transformers.FlavaMultimodalConfig",parameters:[{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 6"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": int = 'gelu'"},{name:"hidden_dropout_prob",val:": int = 0.0"},{name:"attention_probs_dropout_prob",val:": int = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"qkv_bias",val:": bool = True"},{name:"use_cls_token",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.FlavaMultimodalConfig.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. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.FlavaMultimodalConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.FlavaMultimodalConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.FlavaMultimodalConfig.use_cls_token",description:`<strong>use_cls_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use an extra CLS token for multimodal settings. Usually needed by the FLAVA model.`,name:"use_cls_token"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L278"}}),Ge=new Mo({props:{anchor:"transformers.FlavaMultimodalConfig.example",$$slots:{default:[Af]},$$scope:{ctx:z}}}),rt=new E({}),st=new w({props:{name:"class transformers.FlavaImageCodebookConfig",anchor:"transformers.FlavaImageCodebookConfig",parameters:[{name:"num_groups",val:": int = 4"},{name:"input_channels",val:": int = 3"},{name:"num_blocks_per_group",val:": int = 2"},{name:"hidden_size",val:": int = 256"},{name:"vocab_size",val:": int = 8192"},{name:"freeze",val:": int = True"},{name:"initializer_range",val:": float = 0.02"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/configuration_flava.py#L379"}}),it=new E({}),lt=new w({props:{name:"class transformers.FlavaProcessor",anchor:"transformers.FlavaProcessor",parameters:[{name:"feature_extractor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.FlavaProcessor.feature_extractor",description:'<strong>feature_extractor</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaFeatureExtractor</a>) &#x2014; The feature extractor is a required input.',name:"feature_extractor"},{anchor:"transformers.FlavaProcessor.tokenizer",description:'<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>) &#x2014; The tokenizer is a required input.',name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/processing_flava.py#L26"}}),dt=new w({props:{name:"batch_decode",anchor:"transformers.FlavaProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/processing_flava.py#L112"}}),mt=new w({props:{name:"decode",anchor:"transformers.FlavaProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/processing_flava.py#L119"}}),ft=new E({}),gt=new w({props:{name:"class transformers.FlavaImageProcessor",anchor:"transformers.FlavaImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{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.Iterable[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"return_image_mask",val:": bool = False"},{name:"input_size_patches",val:": int = 14"},{name:"total_mask_patches",val:": int = 75"},{name:"mask_group_min_patches",val:": int = 16"},{name:"mask_group_max_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_aspect_ratio",val:": float = 0.3"},{name:"mask_group_max_aspect_ratio",val:": typing.Optional[float] = None"},{name:"return_codebook_pixels",val:": bool = False"},{name:"codebook_do_resize",val:": bool = True"},{name:"codebook_size",val:": bool = None"},{name:"codebook_resample",val:": int = <Resampling.LANCZOS: 1>"},{name:"codebook_do_center_crop",val:": bool = True"},{name:"codebook_crop_size",val:": int = None"},{name:"codebook_do_rescale",val:": bool = True"},{name:"codebook_rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"codebook_do_map_pixels",val:": bool = True"},{name:"codebook_do_normalize",val:": bool = True"},{name:"codebook_image_mean",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"codebook_image_std",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.FlavaImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the image after resizing. Can be overridden by the <code>size</code> parameter in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.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. Can be overridden by the <code>resample</code> parameter in
<code>preprocess</code>.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.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 images. Can be overridden by the <code>do_center_crop</code> parameter in <code>preprocess</code>.`,name:"do_center_crop"},{anchor:"transformers.FlavaImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of image after the center crop <code>(crop_size[&quot;height&quot;], crop_size[&quot;width&quot;])</code>. Can be overridden by the
<code>crop_size</code> parameter in <code>preprocess</code>.`,name:"crop_size"},{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_rescale"},{anchor:"transformers.FlavaImageProcessor.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. Can be overridden by the <code>rescale_factor</code> parameter in
<code>preprocess</code>.`,name:"rescale_factor"},{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_normalize"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.return_image_mask",description:`<strong>return_image_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to return the image mask. Can be overridden by the <code>return_image_mask</code> parameter in <code>preprocess</code>.`,name:"return_image_mask"},{anchor:"transformers.FlavaImageProcessor.input_size_patches",description:`<strong>input_size_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 14) &#x2014;
Number of patches in the image in height and width direction. 14x14 = 196 total patches. Can be overridden
by the <code>input_size_patches</code> parameter in <code>preprocess</code>.`,name:"input_size_patches"},{anchor:"transformers.FlavaImageProcessor.total_mask_patches",description:`<strong>total_mask_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 75) &#x2014;
Total number of patches that should be masked. Can be overridden by the <code>total_mask_patches</code> parameter in
<code>preprocess</code>.`,name:"total_mask_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_min_patches",description:`<strong>mask_group_min_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Minimum number of patches that should be masked. Can be overridden by the <code>mask_group_min_patches</code>
parameter in <code>preprocess</code>.`,name:"mask_group_min_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_max_patches",description:`<strong>mask_group_max_patches</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum number of patches that should be masked. Can be overridden by the <code>mask_group_max_patches</code>
parameter in <code>preprocess</code>.`,name:"mask_group_max_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_min_aspect_ratio",description:`<strong>mask_group_min_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
Minimum aspect ratio of the mask window. Can be overridden by the <code>mask_group_min_aspect_ratio</code> parameter
in <code>preprocess</code>.`,name:"mask_group_min_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.mask_group_max_aspect_ratio",description:`<strong>mask_group_max_aspect_ratio</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Maximum aspect ratio of the mask window. Can be overridden by the <code>mask_group_max_aspect_ratio</code> parameter
in <code>preprocess</code>.`,name:"mask_group_max_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.codebook_do_resize",description:`<strong>codebook_do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input for codebook to a certain. Can be overridden by the <code>codebook_do_resize</code>
parameter in <code>preprocess</code>. <code>codebook_size</code>.`,name:"codebook_do_resize"},{anchor:"transformers.FlavaImageProcessor.codebook_size",description:`<strong>codebook_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Resize the input for codebook to the given size. Can be overridden by the <code>codebook_size</code> parameter in
<code>preprocess</code>.`,name:"codebook_size"},{anchor:"transformers.FlavaImageProcessor.codebook_resample",description:`<strong>codebook_resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.LANCZOS</code>) &#x2014;
Resampling filter to use if resizing the codebook image. Can be overridden by the <code>codebook_resample</code>
parameter in <code>preprocess</code>.`,name:"codebook_resample"},{anchor:"transformers.FlavaImageProcessor.codebook_do_center_crop",description:`<strong>codebook_do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input for codebook at the center. If the input size is smaller than
<code>codebook_crop_size</code> along any edge, the image is padded with 0&#x2019;s and then center cropped. Can be
overridden by the <code>codebook_do_center_crop</code> parameter in <code>preprocess</code>.`,name:"codebook_do_center_crop"},{anchor:"transformers.FlavaImageProcessor.codebook_crop_size",description:`<strong>codebook_crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size for codebook input when applying center-cropping. Can be overridden by the
<code>codebook_crop_size</code> parameter in <code>preprocess</code>.`,name:"codebook_crop_size"},{anchor:"transformers.FlavaImageProcessor.codebook_do_rescale",description:`<strong>codebook_do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the input for codebook by the specified scale <code>codebook_rescale_factor</code>. Can be
overridden by the <code>codebook_do_rescale</code> parameter in <code>preprocess</code>.`,name:"codebook_do_rescale"},{anchor:"transformers.FlavaImageProcessor.codebook_rescale_factor",description:`<strong>codebook_rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Defines the scale factor to use if rescaling the codebook image. Can be overridden by the
<code>codebook_rescale_factor</code> parameter in <code>preprocess</code>.`,name:"codebook_rescale_factor"},{anchor:"transformers.FlavaImageProcessor.codebook_do_map_pixels",description:`<strong>codebook_do_map_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to map the pixel values of the codebook input to (1 - 2e)x + e. Can be overridden by the
<code>codebook_do_map_pixels</code> parameter in <code>preprocess</code>.`,name:"codebook_do_map_pixels"},{anchor:"transformers.FlavaImageProcessor.codebook_do_normalize",description:`<strong>codebook_do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input for codebook with <code>codebook_image_mean</code> and <code>codebook_image_std</code>. Can
be overridden by the <code>codebook_do_normalize</code> parameter in <code>preprocess</code>.`,name:"codebook_do_normalize"},{anchor:"transformers.FlavaImageProcessor.codebook_image_mean",description:`<strong>codebook_image_mean</strong> (<code>Optional[Union[float, Iterable[float]]]</code>, <em>optional</em>, defaults to <code>[0, 0, 0]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images for codebook. Can be overridden
by the <code>codebook_image_mean</code> parameter in <code>preprocess</code>.`,name:"codebook_image_mean"},{anchor:"transformers.FlavaImageProcessor.codebook_image_std",description:`<strong>codebook_image_std</strong> (<code>Optional[Union[float, Iterable[float]]]</code>, <em>optional</em>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images for codebook. Can
be overridden by the <code>codebook_image_std</code> parameter in <code>preprocess</code>.`,name:"codebook_image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/image_processing_flava.py#L127"}}),ht=new w({props:{name:"center_crop",anchor:"transformers.FlavaImageProcessor.center_crop",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Dict[str, int]"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.center_crop.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to center crop.`,name:"image"},{anchor:"transformers.FlavaImageProcessor.center_crop.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>) &#x2014;
Size of the output image.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.center_crop.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/image_processing_flava.py#L343"}}),ut=new w({props:{name:"normalize",anchor:"transformers.FlavaImageProcessor.normalize",parameters:[{name:"image",val:": ndarray"},{name:"mean",val:": typing.Union[float, typing.List[float]]"},{name:"std",val:": typing.Union[float, typing.List[float]]"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.normalize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to normalize.`,name:"image"},{anchor:"transformers.FlavaImageProcessor.normalize.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.normalize.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.normalize.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/image_processing_flava.py#L387"}}),_t=new w({props:{name:"preprocess",anchor:"transformers.FlavaImageProcessor.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.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = 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:"return_image_mask",val:": typing.Optional[bool] = None"},{name:"input_size_patches",val:": typing.Optional[int] = None"},{name:"total_mask_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_patches",val:": typing.Optional[int] = None"},{name:"mask_group_max_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_aspect_ratio",val:": typing.Optional[float] = None"},{name:"mask_group_max_aspect_ratio",val:": typing.Optional[float] = None"},{name:"return_codebook_pixels",val:": typing.Optional[bool] = None"},{name:"codebook_do_resize",val:": typing.Optional[bool] = None"},{name:"codebook_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"codebook_resample",val:": typing.Optional[int] = None"},{name:"codebook_do_center_crop",val:": typing.Optional[bool] = None"},{name:"codebook_crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"codebook_do_rescale",val:": typing.Optional[bool] = None"},{name:"codebook_rescale_factor",val:": typing.Optional[float] = None"},{name:"codebook_do_map_pixels",val:": typing.Optional[bool] = None"},{name:"codebook_do_normalize",val:": typing.Optional[bool] = None"},{name:"codebook_image_mean",val:": typing.Optional[typing.Iterable[float]] = None"},{name:"codebook_image_std",val:": typing.Optional[typing.Iterable[float]] = 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.FlavaImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"do_center_crop"},{anchor:"transformers.FlavaImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.preprocess.return_image_mask",description:`<strong>return_image_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.return_image_mask</code>) &#x2014;
Whether to return the image mask.`,name:"return_image_mask"},{anchor:"transformers.FlavaImageProcessor.preprocess.input_size_patches",description:`<strong>input_size_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.input_size_patches</code>) &#x2014;
Size of the patches to extract from the image.`,name:"input_size_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.total_mask_patches",description:`<strong>total_mask_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.total_mask_patches</code>) &#x2014;
Total number of patches to extract from the image.`,name:"total_mask_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_min_patches",description:`<strong>mask_group_min_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.mask_group_min_patches</code>) &#x2014;
Minimum number of patches to extract from the image.`,name:"mask_group_min_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_max_patches",description:`<strong>mask_group_max_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.mask_group_max_patches</code>) &#x2014;
Maximum number of patches to extract from the image.`,name:"mask_group_max_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_min_aspect_ratio",description:`<strong>mask_group_min_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.mask_group_min_aspect_ratio</code>) &#x2014;
Minimum aspect ratio of the patches to extract from the image.`,name:"mask_group_min_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_max_aspect_ratio",description:`<strong>mask_group_max_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.mask_group_max_aspect_ratio</code>) &#x2014;
Maximum aspect ratio of the patches to extract from the image.`,name:"mask_group_max_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.preprocess.return_codebook_pixels",description:`<strong>return_codebook_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.return_codebook_pixels</code>) &#x2014;
Whether to return the codebook pixels.`,name:"return_codebook_pixels"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_resize",description:`<strong>codebook_do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_resize</code>) &#x2014;
Whether to resize the codebook pixels.`,name:"codebook_do_resize"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_size",description:`<strong>codebook_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.codebook_size</code>) &#x2014;
Size of the codebook pixels.`,name:"codebook_size"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_resample",description:`<strong>codebook_resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.codebook_resample</code>) &#x2014;
Resampling filter to use if resizing the codebook pixels. This can be one of the enum
<code>PILImageResampling</code>, Only has an effect if <code>codebook_do_resize</code> is set to <code>True</code>.`,name:"codebook_resample"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_center_crop",description:`<strong>codebook_do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_center_crop</code>) &#x2014;
Whether to center crop the codebook pixels.`,name:"codebook_do_center_crop"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_crop_size",description:`<strong>codebook_crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.codebook_crop_size</code>) &#x2014;
Size of the center crop of the codebook pixels. Only has an effect if <code>codebook_do_center_crop</code> is set
to <code>True</code>.`,name:"codebook_crop_size"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_rescale",description:`<strong>codebook_do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_rescale</code>) &#x2014;
Whether to rescale the codebook pixels values between [0 - 1].`,name:"codebook_do_rescale"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_rescale_factor",description:`<strong>codebook_rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.codebook_rescale_factor</code>) &#x2014;
Rescale factor to rescale the codebook pixels by if <code>codebook_do_rescale</code> is set to <code>True</code>.`,name:"codebook_rescale_factor"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_map_pixels",description:`<strong>codebook_do_map_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_map_pixels</code>) &#x2014;
Whether to map the codebook pixels values.`,name:"codebook_do_map_pixels"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_normalize",description:`<strong>codebook_do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_normalize</code>) &#x2014;
Whether to normalize the codebook pixels.`,name:"codebook_do_normalize"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_image_mean",description:`<strong>codebook_image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.codebook_image_mean</code>) &#x2014;
Codebook pixels mean to normalize the codebook pixels by if <code>codebook_do_normalize</code> is set to <code>True</code>.`,name:"codebook_image_mean"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_image_std",description:`<strong>codebook_image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.codebook_image_std</code>) &#x2014;
Codebook pixels standard deviation to normalize the codebook pixels by if <code>codebook_do_normalize</code> is
set to <code>True</code>.`,name:"codebook_image_std"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.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.25.1/src/transformers/models/flava/image_processing_flava.py#L461"}}),vt=new w({props:{name:"rescale",anchor:"transformers.FlavaImageProcessor.rescale",parameters:[{name:"image",val:": ndarray"},{name:"scale",val:": typing.Union[int, float]"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.rescale.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to rescale.`,name:"image"},{anchor:"transformers.FlavaImageProcessor.rescale.scale",description:`<strong>scale</strong> (<code>int</code> or <code>float</code>) &#x2014;
Scale to apply to the image.`,name:"scale"},{anchor:"transformers.FlavaImageProcessor.rescale.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/image_processing_flava.py#L367"}}),bt=new w({props:{name:"resize",anchor:"transformers.FlavaImageProcessor.resize",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Dict[str, int]"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.resize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to resize.`,name:"image"},{anchor:"transformers.FlavaImageProcessor.resize.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>) &#x2014;
Size of the output image.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.resize.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use when resiizing the image.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.resize.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/image_processing_flava.py#L315"}}),Ft=new E({}),yt=new w({props:{name:"class transformers.FlavaImageProcessor",anchor:"transformers.FlavaImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{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.Iterable[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"return_image_mask",val:": bool = False"},{name:"input_size_patches",val:": int = 14"},{name:"total_mask_patches",val:": int = 75"},{name:"mask_group_min_patches",val:": int = 16"},{name:"mask_group_max_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_aspect_ratio",val:": float = 0.3"},{name:"mask_group_max_aspect_ratio",val:": typing.Optional[float] = None"},{name:"return_codebook_pixels",val:": bool = False"},{name:"codebook_do_resize",val:": bool = True"},{name:"codebook_size",val:": bool = None"},{name:"codebook_resample",val:": int = <Resampling.LANCZOS: 1>"},{name:"codebook_do_center_crop",val:": bool = True"},{name:"codebook_crop_size",val:": int = None"},{name:"codebook_do_rescale",val:": bool = True"},{name:"codebook_rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"codebook_do_map_pixels",val:": bool = True"},{name:"codebook_do_normalize",val:": bool = True"},{name:"codebook_image_mean",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"codebook_image_std",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.FlavaImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the image after resizing. Can be overridden by the <code>size</code> parameter in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.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. Can be overridden by the <code>resample</code> parameter in
<code>preprocess</code>.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.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 images. Can be overridden by the <code>do_center_crop</code> parameter in <code>preprocess</code>.`,name:"do_center_crop"},{anchor:"transformers.FlavaImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of image after the center crop <code>(crop_size[&quot;height&quot;], crop_size[&quot;width&quot;])</code>. Can be overridden by the
<code>crop_size</code> parameter in <code>preprocess</code>.`,name:"crop_size"},{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_rescale"},{anchor:"transformers.FlavaImageProcessor.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. Can be overridden by the <code>rescale_factor</code> parameter in
<code>preprocess</code>.`,name:"rescale_factor"},{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_normalize"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.return_image_mask",description:`<strong>return_image_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to return the image mask. Can be overridden by the <code>return_image_mask</code> parameter in <code>preprocess</code>.`,name:"return_image_mask"},{anchor:"transformers.FlavaImageProcessor.input_size_patches",description:`<strong>input_size_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 14) &#x2014;
Number of patches in the image in height and width direction. 14x14 = 196 total patches. Can be overridden
by the <code>input_size_patches</code> parameter in <code>preprocess</code>.`,name:"input_size_patches"},{anchor:"transformers.FlavaImageProcessor.total_mask_patches",description:`<strong>total_mask_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 75) &#x2014;
Total number of patches that should be masked. Can be overridden by the <code>total_mask_patches</code> parameter in
<code>preprocess</code>.`,name:"total_mask_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_min_patches",description:`<strong>mask_group_min_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Minimum number of patches that should be masked. Can be overridden by the <code>mask_group_min_patches</code>
parameter in <code>preprocess</code>.`,name:"mask_group_min_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_max_patches",description:`<strong>mask_group_max_patches</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum number of patches that should be masked. Can be overridden by the <code>mask_group_max_patches</code>
parameter in <code>preprocess</code>.`,name:"mask_group_max_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_min_aspect_ratio",description:`<strong>mask_group_min_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
Minimum aspect ratio of the mask window. Can be overridden by the <code>mask_group_min_aspect_ratio</code> parameter
in <code>preprocess</code>.`,name:"mask_group_min_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.mask_group_max_aspect_ratio",description:`<strong>mask_group_max_aspect_ratio</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Maximum aspect ratio of the mask window. Can be overridden by the <code>mask_group_max_aspect_ratio</code> parameter
in <code>preprocess</code>.`,name:"mask_group_max_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.codebook_do_resize",description:`<strong>codebook_do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input for codebook to a certain. Can be overridden by the <code>codebook_do_resize</code>
parameter in <code>preprocess</code>. <code>codebook_size</code>.`,name:"codebook_do_resize"},{anchor:"transformers.FlavaImageProcessor.codebook_size",description:`<strong>codebook_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Resize the input for codebook to the given size. Can be overridden by the <code>codebook_size</code> parameter in
<code>preprocess</code>.`,name:"codebook_size"},{anchor:"transformers.FlavaImageProcessor.codebook_resample",description:`<strong>codebook_resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.LANCZOS</code>) &#x2014;
Resampling filter to use if resizing the codebook image. Can be overridden by the <code>codebook_resample</code>
parameter in <code>preprocess</code>.`,name:"codebook_resample"},{anchor:"transformers.FlavaImageProcessor.codebook_do_center_crop",description:`<strong>codebook_do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input for codebook at the center. If the input size is smaller than
<code>codebook_crop_size</code> along any edge, the image is padded with 0&#x2019;s and then center cropped. Can be
overridden by the <code>codebook_do_center_crop</code> parameter in <code>preprocess</code>.`,name:"codebook_do_center_crop"},{anchor:"transformers.FlavaImageProcessor.codebook_crop_size",description:`<strong>codebook_crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size for codebook input when applying center-cropping. Can be overridden by the
<code>codebook_crop_size</code> parameter in <code>preprocess</code>.`,name:"codebook_crop_size"},{anchor:"transformers.FlavaImageProcessor.codebook_do_rescale",description:`<strong>codebook_do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the input for codebook by the specified scale <code>codebook_rescale_factor</code>. Can be
overridden by the <code>codebook_do_rescale</code> parameter in <code>preprocess</code>.`,name:"codebook_do_rescale"},{anchor:"transformers.FlavaImageProcessor.codebook_rescale_factor",description:`<strong>codebook_rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Defines the scale factor to use if rescaling the codebook image. Can be overridden by the
<code>codebook_rescale_factor</code> parameter in <code>preprocess</code>.`,name:"codebook_rescale_factor"},{anchor:"transformers.FlavaImageProcessor.codebook_do_map_pixels",description:`<strong>codebook_do_map_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to map the pixel values of the codebook input to (1 - 2e)x + e. Can be overridden by the
<code>codebook_do_map_pixels</code> parameter in <code>preprocess</code>.`,name:"codebook_do_map_pixels"},{anchor:"transformers.FlavaImageProcessor.codebook_do_normalize",description:`<strong>codebook_do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input for codebook with <code>codebook_image_mean</code> and <code>codebook_image_std</code>. Can
be overridden by the <code>codebook_do_normalize</code> parameter in <code>preprocess</code>.`,name:"codebook_do_normalize"},{anchor:"transformers.FlavaImageProcessor.codebook_image_mean",description:`<strong>codebook_image_mean</strong> (<code>Optional[Union[float, Iterable[float]]]</code>, <em>optional</em>, defaults to <code>[0, 0, 0]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images for codebook. Can be overridden
by the <code>codebook_image_mean</code> parameter in <code>preprocess</code>.`,name:"codebook_image_mean"},{anchor:"transformers.FlavaImageProcessor.codebook_image_std",description:`<strong>codebook_image_std</strong> (<code>Optional[Union[float, Iterable[float]]]</code>, <em>optional</em>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images for codebook. Can
be overridden by the <code>codebook_image_std</code> parameter in <code>preprocess</code>.`,name:"codebook_image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/image_processing_flava.py#L127"}}),xt=new w({props:{name:"preprocess",anchor:"transformers.FlavaImageProcessor.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.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = 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:"return_image_mask",val:": typing.Optional[bool] = None"},{name:"input_size_patches",val:": typing.Optional[int] = None"},{name:"total_mask_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_patches",val:": typing.Optional[int] = None"},{name:"mask_group_max_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_aspect_ratio",val:": typing.Optional[float] = None"},{name:"mask_group_max_aspect_ratio",val:": typing.Optional[float] = None"},{name:"return_codebook_pixels",val:": typing.Optional[bool] = None"},{name:"codebook_do_resize",val:": typing.Optional[bool] = None"},{name:"codebook_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"codebook_resample",val:": typing.Optional[int] = None"},{name:"codebook_do_center_crop",val:": typing.Optional[bool] = None"},{name:"codebook_crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"codebook_do_rescale",val:": typing.Optional[bool] = None"},{name:"codebook_rescale_factor",val:": typing.Optional[float] = None"},{name:"codebook_do_map_pixels",val:": typing.Optional[bool] = None"},{name:"codebook_do_normalize",val:": typing.Optional[bool] = None"},{name:"codebook_image_mean",val:": typing.Optional[typing.Iterable[float]] = None"},{name:"codebook_image_std",val:": typing.Optional[typing.Iterable[float]] = 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.FlavaImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"do_center_crop"},{anchor:"transformers.FlavaImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.preprocess.return_image_mask",description:`<strong>return_image_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.return_image_mask</code>) &#x2014;
Whether to return the image mask.`,name:"return_image_mask"},{anchor:"transformers.FlavaImageProcessor.preprocess.input_size_patches",description:`<strong>input_size_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.input_size_patches</code>) &#x2014;
Size of the patches to extract from the image.`,name:"input_size_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.total_mask_patches",description:`<strong>total_mask_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.total_mask_patches</code>) &#x2014;
Total number of patches to extract from the image.`,name:"total_mask_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_min_patches",description:`<strong>mask_group_min_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.mask_group_min_patches</code>) &#x2014;
Minimum number of patches to extract from the image.`,name:"mask_group_min_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_max_patches",description:`<strong>mask_group_max_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.mask_group_max_patches</code>) &#x2014;
Maximum number of patches to extract from the image.`,name:"mask_group_max_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_min_aspect_ratio",description:`<strong>mask_group_min_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.mask_group_min_aspect_ratio</code>) &#x2014;
Minimum aspect ratio of the patches to extract from the image.`,name:"mask_group_min_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_max_aspect_ratio",description:`<strong>mask_group_max_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.mask_group_max_aspect_ratio</code>) &#x2014;
Maximum aspect ratio of the patches to extract from the image.`,name:"mask_group_max_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.preprocess.return_codebook_pixels",description:`<strong>return_codebook_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.return_codebook_pixels</code>) &#x2014;
Whether to return the codebook pixels.`,name:"return_codebook_pixels"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_resize",description:`<strong>codebook_do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_resize</code>) &#x2014;
Whether to resize the codebook pixels.`,name:"codebook_do_resize"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_size",description:`<strong>codebook_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.codebook_size</code>) &#x2014;
Size of the codebook pixels.`,name:"codebook_size"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_resample",description:`<strong>codebook_resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.codebook_resample</code>) &#x2014;
Resampling filter to use if resizing the codebook pixels. This can be one of the enum
<code>PILImageResampling</code>, Only has an effect if <code>codebook_do_resize</code> is set to <code>True</code>.`,name:"codebook_resample"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_center_crop",description:`<strong>codebook_do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_center_crop</code>) &#x2014;
Whether to center crop the codebook pixels.`,name:"codebook_do_center_crop"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_crop_size",description:`<strong>codebook_crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.codebook_crop_size</code>) &#x2014;
Size of the center crop of the codebook pixels. Only has an effect if <code>codebook_do_center_crop</code> is set
to <code>True</code>.`,name:"codebook_crop_size"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_rescale",description:`<strong>codebook_do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_rescale</code>) &#x2014;
Whether to rescale the codebook pixels values between [0 - 1].`,name:"codebook_do_rescale"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_rescale_factor",description:`<strong>codebook_rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.codebook_rescale_factor</code>) &#x2014;
Rescale factor to rescale the codebook pixels by if <code>codebook_do_rescale</code> is set to <code>True</code>.`,name:"codebook_rescale_factor"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_map_pixels",description:`<strong>codebook_do_map_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_map_pixels</code>) &#x2014;
Whether to map the codebook pixels values.`,name:"codebook_do_map_pixels"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_normalize",description:`<strong>codebook_do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_normalize</code>) &#x2014;
Whether to normalize the codebook pixels.`,name:"codebook_do_normalize"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_image_mean",description:`<strong>codebook_image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.codebook_image_mean</code>) &#x2014;
Codebook pixels mean to normalize the codebook pixels by if <code>codebook_do_normalize</code> is set to <code>True</code>.`,name:"codebook_image_mean"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_image_std",description:`<strong>codebook_image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.codebook_image_std</code>) &#x2014;
Codebook pixels standard deviation to normalize the codebook pixels by if <code>codebook_do_normalize</code> is
set to <code>True</code>.`,name:"codebook_image_std"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.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.25.1/src/transformers/models/flava/image_processing_flava.py#L461"}}),Tt=new E({}),$t=new w({props:{name:"class transformers.FlavaForPreTraining",anchor:"transformers.FlavaForPreTraining",parameters:[{name:"config",val:": FlavaConfig"},{name:"image_codebook",val:": typing.Optional[torch.nn.modules.module.Module] = None"}],parametersDescription:[{anchor:"transformers.FlavaForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaConfig">FlavaConfig</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.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlavaForPreTraining.image_codebook",description:`<strong>image_codebook</strong> (<code>nn.Module</code>) &#x2014; If passed, the image codebook will be set to this. Otherwise. it will
be initialized using the image_codebook_config defined in the config first as the first parameter.`,name:"image_codebook"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1731"}}),It=new w({props:{name:"forward",anchor:"transformers.FlavaForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_ids_masked",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"codebook_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"skip_unmasked_multimodal_encoder",val:": bool = None"},{name:"mlm_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"mim_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"itm_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": bool = True"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaForPreTraining.forward.input_ids_masked",description:`<strong>input_ids_masked</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. These ones are the masked version of the original task
to be used with MLM. Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a> along with
<code>DataCollatorForMaskedLanguageModeling</code>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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_masked"},{anchor:"transformers.FlavaForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.25.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.FlavaForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</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.FlavaForPreTraining.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.25.1/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaFeatureExtractor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">FlavaFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaForPreTraining.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaForPreTraining.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaForPreTraining.forward.image_attention_mask",description:`<strong>image_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices specifically for images. 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:"image_attention_mask"},{anchor:"transformers.FlavaForPreTraining.forward.skip_unmasked_multimodal_encoder",description:`<strong>skip_unmasked_multimodal_encoder</strong> (<em>bool</em>, <em>optional</em>) &#x2014;
Skip any calculations for multimodal encoder for unmasked inputs. FLAVA pretraining doesn&#x2019;t need unmasked
multimodal embeddings or outputs as of now.`,name:"skip_unmasked_multimodal_encoder"},{anchor:"transformers.FlavaForPreTraining.forward.mlm_labels",description:`<strong>mlm_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language and multimodal masked modeling loss (next word prediction).
Indices should be in <code>[-100, 0, ..., text_config.vocab_size - 1]</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, ..., text_config.vocab_size - 1]</code>.`,name:"mlm_labels"},{anchor:"transformers.FlavaForPreTraining.forward.mim_labels",description:`<strong>mim_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, image_num_patches)</code>, <em>optional</em>) &#x2014;
Labels for computing the image and multimodal masked modeling loss. Indices should be in <code>[-100, 0, ..., image_config.vocab_size - 1]</code>. Tokens with indices set to <code>-100</code> are ignored (masked), the loss is only
computed for the tokens with labels in <code>[0, ..., image_config.vocab_size - 1]</code>. If not passed, they are
generated automatically using the image codebook assigned to the model. By default, it uses
<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a>. See <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a> to understand how to generate mim_labels.`,name:"mim_labels"},{anchor:"transformers.FlavaForPreTraining.forward.itm_labels",description:`<strong>itm_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 of MMM and global contrastive losses as well.`,name:"itm_labels"},{anchor:"transformers.FlavaForPreTraining.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>, default to None) &#x2014;
Whether to return calculated loss or not.`,name:"return_loss"},{anchor:"transformers.FlavaForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_len)</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.FlavaForPreTraining.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.FlavaForPreTraining.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.FlavaForPreTraining.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.FlavaForPreTraining.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Examples &#x2014;`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1775",returnDescription:`
<p>A <code>transformers.models.flava.modeling_flava.FlavaForPreTrainingOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.flava.configuration_flava.FlavaConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code>, <em>optional</em>, returned when <code>return_loss</code> is True) \u2014 Total loss calculated for this model.</p>
</li>
<li>
<p><strong>loss_info</strong> (<code>FlavaLosses</code>) \u2014 Detailed info for FLAVA Pretraining losses. Check <code>FlavaLosses</code> class description for the information on
the keys.</p>
</li>
<li>
<p><strong>image_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The image embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</p>
</li>
<li>
<p><strong>image_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</p>
</li>
<li>
<p><strong>text_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The text embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>text_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_unmasked_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The multimodal embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_output</strong> (<code>BaseModelOutputWithPooling</code>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_unmasked_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalModel"
>FlavaMultimodalModel</a>.</p>
</li>
<li>
<p><strong>image_masked_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The image embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>. Uses <code>bool_masked_pos</code>
to create masked images.</p>
</li>
<li>
<p><strong>image_masked_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>. Uses <code>bool_masked_pos</code> to create masked images.</p>
</li>
<li>
<p><strong>text_masked_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids_masked</code> are present) \u2014 The text embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>text_masked_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>input_ids_masked</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_masked_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> and <code>pixel_values</code> are present) \u2014 The multimodal embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_masked_output</strong> (<code>BaseModelOutputWithPooling</code>, returned when <code>input_ids_masked</code> and <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalModel"
>FlavaMultimodalModel</a>.</p>
</li>
<li>
<p><strong>mim_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_image_patches, image_vocab_size)</code> or of shape <code>(total_masked_patches, image_vocab_size)</code> , <em>optional</em>, returned when <code>pixel_values</code> are present and <code>input_ids_masked</code> are not) \u2014 The logits for MIM unimodal loss. Uses <code>book_masked_pos</code> to get masked patches. The flattened output is
returned when <code>bool_masked_pos</code> has some of the patches masked.</p>
</li>
<li>
<p><strong>mlm_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_length, text_vocab_size)</code> or of shape <code>(total_masked_seq_length, text_vocab_size)</code>, <em>optional</em>, returned when <code>input_ids_masked</code> are present and <code>pixel_values</code> are not) \u2014 The logits for MLM unimodal loss. The flattened output is returned when <code>input_ids_masked</code> has some of
the tokens masked.</p>
</li>
<li>
<p><strong>itm_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>, <em>optional</em>, returned when <code>input_ids_masked</code> and <code>pixel_values</code> are present) \u2014 The logits for ITM loss. Note that ITM loss is calculated on masked pairs in FLAVA.</p>
</li>
<li>
<p><strong>mmm_image_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_image_patches, image_vocab_size)</code> or of shape<code>(total_masked_patches, image_vocab_size)</code>, <em>optional</em>, returned when <code>pixel_values</code> and <code>input_ids_masked</code> are present) \u2014 The logits for MMM image multimodal loss. Uses <code>book_masked_pos</code> to get masked patches. The flattened
output is returned when <code>bool_masked_pos</code> has some of the patches masked.</p>
</li>
<li>
<p><strong>mmm_text_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_length, text_vocab_size)</code> or of shape <code>(</code>(total_masked_seq_length, text_vocab_size)<code>), *optional*, returned when </code>pixel_values<code>and</code>input_ids_masked<code>are present) -- The logits for MMM text multimodal loss. The flattened output is returned when</code>input_ids_masked\` has
some of the tokens masked.</p>
</li>
<li>
<p><strong>contrastive_logits_per_image</strong> (<code>torch.FloatTensor</code> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeddings</code> and <code>text_embeddings</code> but passed through FLAVA\u2019s
<code>image_projection</code> and <code>text_projection</code> layers respectively. This represents the image-text similarity
scores. This is calculated on unmasked images and texts.</p>
</li>
<li>
<p><strong>contrastive_logits_per_text</strong> (<code>torch.FloatTensor</code> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeddings</code> and <code>image_embeddings</code> but passed through FLAVA\u2019s
<code>text_projection</code> and <code>image_projection</code> layers respectively. This is calculated on unmasked images and
texts.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.flava.modeling_flava.FlavaForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),io=new da({props:{$$slots:{default:[Nf]},$$scope:{ctx:z}}}),Mt=new E({}),Pt=new w({props:{name:"class transformers.FlavaModel",anchor:"transformers.FlavaModel",parameters:[{name:"config",val:": FlavaConfig"}],parametersDescription:[{anchor:"transformers.FlavaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaConfig">FlavaConfig</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.25.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.25.1/src/transformers/models/flava/modeling_flava.py#L1199"}}),At=new w({props:{name:"forward",anchor:"transformers.FlavaModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"skip_multimodal_encoder",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": bool = True"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaModel.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.25.1/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaFeatureExtractor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">FlavaFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.25.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.FlavaModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</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.FlavaModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</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.FlavaModel.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.FlavaModel.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.FlavaModel.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.FlavaModel.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FlavaModel.forward.skip_multimodal_encoder",description:`<strong>skip_multimodal_encoder</strong> (<em>bool</em>, <em>optional</em>) &#x2014;
Skip any calculations for multimodal encoder. Useful if multimodal encoding is not going to be used.`,name:"skip_multimodal_encoder"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1343",returnDescription:`
<p>A <code>transformers.models.flava.modeling_flava.FlavaModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.flava.configuration_flava.FlavaConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>image_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The image embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</li>
<li><strong>image_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</li>
<li><strong>text_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The text embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</li>
<li><strong>text_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</li>
<li><strong>multimodal_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The multimodal embeddings which are basically the pooled output of <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</li>
<li><strong>multimodal_output</strong> (<code>BaseModelOutputWithPooling</code>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalModel"
>FlavaMultimodalModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.flava.modeling_flava.FlavaModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),co=new da({props:{$$slots:{default:[Of]},$$scope:{ctx:z}}}),mo=new Mo({props:{anchor:"transformers.FlavaModel.forward.example",$$slots:{default:[Df]},$$scope:{ctx:z}}}),Nt=new w({props:{name:"get_text_features",anchor:"transformers.FlavaModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.25.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.FlavaModel.get_text_features.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_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.FlavaModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_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.FlavaModel.get_text_features.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlavaModel.get_text_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlavaModel.get_text_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlavaModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1245"}}),po=new da({props:{$$slots:{default:[qf]},$$scope:{ctx:z}}}),Ot=new w({props:{name:"get_image_features",anchor:"transformers.FlavaModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaFeatureExtractor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">FlavaFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaModel.get_image_features.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaModel.get_image_features.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaModel.get_image_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches)</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.FlavaModel.get_image_features.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FlavaModel.get_image_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlavaModel.get_image_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlavaModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1291"}}),fo=new da({props:{$$slots:{default:[Lf]},$$scope:{ctx:z}}}),Dt=new E({}),qt=new w({props:{name:"class transformers.FlavaImageCodebook",anchor:"transformers.FlavaImageCodebook",parameters:[{name:"config",val:": FlavaImageCodebookConfig"},{name:"**kwargs",val:": typing.Any"}],parametersDescription:[{anchor:"transformers.FlavaImageCodebook.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageCodebookConfig">FlavaImageCodebookConfig</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.25.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.25.1/src/transformers/models/flava/modeling_flava.py#L1517"}}),St=new w({props:{name:"forward",anchor:"transformers.FlavaImageCodebook.forward",parameters:[{name:"pixel_values",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1601"}}),Rt=new w({props:{name:"get_codebook_indices",anchor:"transformers.FlavaImageCodebook.get_codebook_indices",parameters:[{name:"pixel_values",val:": Tensor"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1567"}}),Bt=new w({props:{name:"get_codebook_probs",anchor:"transformers.FlavaImageCodebook.get_codebook_probs",parameters:[{name:"pixel_values",val:": Tensor"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1597"}}),Vt=new E({}),Ut=new w({props:{name:"class transformers.FlavaTextModel",anchor:"transformers.FlavaTextModel",parameters:[{name:"config",val:": FlavaTextConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.FlavaTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextConfig">FlavaTextConfig</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.25.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.25.1/src/transformers/models/flava/modeling_flava.py#L994"}}),Yt=new w({props:{name:"forward",anchor:"transformers.FlavaTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.25.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.FlavaTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_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.FlavaTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_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.FlavaTextModel.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.FlavaTextModel.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.FlavaTextModel.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.FlavaTextModel.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1025",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextConfig"
>FlavaTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),uo=new da({props:{$$slots:{default:[jf]},$$scope:{ctx:z}}}),_o=new Mo({props:{anchor:"transformers.FlavaTextModel.forward.example",$$slots:{default:[Wf]},$$scope:{ctx:z}}}),Zt=new E({}),Jt=new w({props:{name:"class transformers.FlavaImageModel",anchor:"transformers.FlavaImageModel",parameters:[{name:"config",val:": FlavaImageConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.FlavaImageModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageConfig">FlavaImageConfig</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.25.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.25.1/src/transformers/models/flava/modeling_flava.py#L894"}}),Qt=new w({props:{name:"forward",anchor:"transformers.FlavaImageModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaImageModel.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.25.1/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaFeatureExtractor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">FlavaFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaImageModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaImageModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaImageModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches)</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.FlavaImageModel.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.FlavaImageModel.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.FlavaImageModel.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.FlavaImageModel.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L927",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageConfig"
>FlavaImageConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),bo=new da({props:{$$slots:{default:[Sf]},$$scope:{ctx:z}}}),ko=new Mo({props:{anchor:"transformers.FlavaImageModel.forward.example",$$slots:{default:[Rf]},$$scope:{ctx:z}}}),ea=new E({}),oa=new w({props:{name:"class transformers.FlavaMultimodalModel",anchor:"transformers.FlavaMultimodalModel",parameters:[{name:"config",val:": FlavaMultimodalConfig"},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.FlavaMultimodalModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalConfig">FlavaMultimodalConfig</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.25.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.25.1/src/transformers/models/flava/modeling_flava.py#L1100"}}),ra=new w({props:{name:"forward",anchor:"transformers.FlavaMultimodalModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaMultimodalModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len, hidden_size)</code>) &#x2014;
The concatenated hidden states of unimodal encoders.`,name:"hidden_states"},{anchor:"transformers.FlavaMultimodalModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</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.FlavaMultimodalModel.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.FlavaMultimodalModel.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.FlavaMultimodalModel.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.FlavaMultimodalModel.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.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/flava/modeling_flava.py#L1128",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalConfig"
>FlavaMultimodalConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yo=new da({props:{$$slots:{default:[Bf]},$$scope:{ctx:z}}}),xo=new Mo({props:{anchor:"transformers.FlavaMultimodalModel.forward.example",$$slots:{default:[Vf]},$$scope:{ctx:z}}}),{c(){p=a("meta"),$=c(),_=a("h1"),h=a("a"),v=a("span"),b(l.$$.fragment),f=c(),I=a("span"),Ss=s("FLAVA"),vn=c(),le=a("h2"),De=a("a"),dr=a("span"),b(Eo.$$.fragment),Rs=c(),cr=a("span"),Bs=s("Overview"),bn=c(),qe=a("p"),Vs=s("The FLAVA model was proposed in "),Ao=a("a"),Us=s("FLAVA: A Foundational Language And Vision Alignment Model"),Hs=s(" by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022."),kn=c(),ca=a("p"),Gs=s(`The paper aims at creating a single unified foundation model which can work across vision, language
as well as vision-and-language multimodal tasks.`),Fn=c(),ma=a("p"),Ys=s("The abstract from the paper is the following:"),yn=c(),pa=a("p"),mr=a("em"),Zs=s(`State-of-the-art vision and vision-and-language models rely on large-scale visio-linguistic pretraining for obtaining good performance on a variety
of downstream tasks. Generally, such models are often either cross-modal (contrastive) or multi-modal
(with earlier fusion) but not both; and they often only target specific modalities or tasks. A promising
direction would be to use a single holistic universal model, as a \u201Cfoundation\u201D, that targets all modalities
at once \u2014 a true vision and language foundation model should be good at vision tasks, language tasks, and
cross- and multi-modal vision and language tasks. We introduce FLAVA as such a model and demonstrate
impressive performance on a wide range of 35 tasks spanning these target modalities.`),xn=c(),X=a("p"),Js=s("This model was contributed by "),No=a("a"),Ks=s("aps"),Xs=s(". The original code can be found "),Oo=a("a"),Qs=s("here"),ei=s("."),Tn=c(),de=a("h2"),Le=a("a"),pr=a("span"),b(Do.$$.fragment),oi=c(),fr=a("span"),ti=s("FlavaConfig"),$n=c(),P=a("div"),b(qo.$$.fragment),ai=c(),Q=a("p"),fa=a("a"),ri=s("FlavaConfig"),ni=s(" is the configuration class to store the configuration of a "),ga=a("a"),si=s("FlavaModel"),ii=s(`. It is used to
instantiate FLAVA model according to the specified arguments, defining the text model, image model, image codebook
and multimodal model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the FLAVA `),Lo=a("a"),li=s("facebook/flava-full"),di=s(" architecture."),ci=c(),ce=a("p"),mi=s("Configuration objects inherit from "),ha=a("a"),pi=s("PretrainedConfig"),fi=s(` and can be used to control the model outputs. Read the
documentation from `),ua=a("a"),gi=s("PretrainedConfig"),hi=s(" for more information."),ui=c(),b(je.$$.fragment),_i=c(),We=a("div"),b(jo.$$.fragment),vi=c(),Wo=a("p"),bi=s("Instantiate a "),_a=a("a"),ki=s("FlavaConfig"),Fi=s(` (or a derived class) from flava text model configuration, flava image model
configuration, flava multimodal model and flava codebook model configuration.`),yi=c(),Se=a("div"),b(So.$$.fragment),xi=c(),Ro=a("p"),Ti=s("Serializes this instance to a Python dictionary. Override the default "),va=a("a"),$i=s("to_dict()"),wi=s("."),wn=c(),me=a("h2"),Re=a("a"),gr=a("span"),b(Bo.$$.fragment),zi=c(),hr=a("span"),Ii=s("FlavaTextConfig"),zn=c(),A=a("div"),b(Vo.$$.fragment),Mi=c(),Uo=a("p"),Pi=s("This is the configuration class to store the configuration of a "),ba=a("a"),Ci=s("FlavaTextModel"),Ei=s(`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Ai=c(),Ho=a("p"),Ni=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Go=a("a"),Oi=s("facebook/flava-full"),Di=s(" architecture."),qi=c(),pe=a("p"),Li=s("Configuration objects inherit from "),ka=a("a"),ji=s("PretrainedConfig"),Wi=s(` and can be used to control the model outputs. Read the
documentation from `),Fa=a("a"),Si=s("PretrainedConfig"),Ri=s(" for more information."),Bi=c(),b(Be.$$.fragment),In=c(),fe=a("h2"),Ve=a("a"),ur=a("span"),b(Yo.$$.fragment),Vi=c(),_r=a("span"),Ui=s("FlavaImageConfig"),Mn=c(),N=a("div"),b(Zo.$$.fragment),Hi=c(),Jo=a("p"),Gi=s("This is the configuration class to store the configuration of a "),ya=a("a"),Yi=s("FlavaImageModel"),Zi=s(`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Ji=c(),Ko=a("p"),Ki=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Xo=a("a"),Xi=s("facebook/flava-full"),Qi=s(" architecture."),el=c(),ge=a("p"),ol=s("Configuration objects inherit from "),xa=a("a"),tl=s("PretrainedConfig"),al=s(` and can be used to control the model outputs. Read the
documentation from `),Ta=a("a"),rl=s("PretrainedConfig"),nl=s(" for more information."),sl=c(),b(Ue.$$.fragment),Pn=c(),he=a("h2"),He=a("a"),vr=a("span"),b(Qo.$$.fragment),il=c(),br=a("span"),ll=s("FlavaMultimodalConfig"),Cn=c(),O=a("div"),b(et.$$.fragment),dl=c(),ot=a("p"),cl=s("This is the configuration class to store the configuration of a "),$a=a("a"),ml=s("FlavaMultimodalModel"),pl=s(`. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.`),fl=c(),tt=a("p"),gl=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),at=a("a"),hl=s("facebook/flava-full"),ul=s(" architecture."),_l=c(),ue=a("p"),vl=s("Configuration objects inherit from "),wa=a("a"),bl=s("PretrainedConfig"),kl=s(` and can be used to control the model outputs. Read the
documentation from `),za=a("a"),Fl=s("PretrainedConfig"),yl=s(" for more information."),xl=c(),b(Ge.$$.fragment),En=c(),_e=a("h2"),Ye=a("a"),kr=a("span"),b(rt.$$.fragment),Tl=c(),Fr=a("span"),$l=s("FlavaImageCodebookConfig"),An=c(),nt=a("div"),b(st.$$.fragment),Nn=c(),ve=a("h2"),Ze=a("a"),yr=a("span"),b(it.$$.fragment),wl=c(),xr=a("span"),zl=s("FlavaProcessor"),On=c(),D=a("div"),b(lt.$$.fragment),Il=c(),Tr=a("p"),Ml=s("Constructs a FLAVA processor which wraps a FLAVA feature extractor and a FLAVA tokenizer into a single processor."),Pl=c(),L=a("p"),Ia=a("a"),Cl=s("FlavaProcessor"),El=s(" offers all the functionalities of "),Ma=a("a"),Al=s("FlavaFeatureExtractor"),Nl=s(" and "),Pa=a("a"),Ol=s("BertTokenizerFast"),Dl=s(`. See the
`),$r=a("code"),ql=s("__call__()"),Ll=s(" and "),Ca=a("a"),jl=s("decode()"),Wl=s(" for more information."),Sl=c(),Je=a("div"),b(dt.$$.fragment),Rl=c(),ct=a("p"),Bl=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),Ea=a("a"),Vl=s("batch_decode()"),Ul=s(`. Please
refer to the docstring of this method for more information.`),Hl=c(),Ke=a("div"),b(mt.$$.fragment),Gl=c(),pt=a("p"),Yl=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),Aa=a("a"),Zl=s("decode()"),Jl=s(`. Please refer to
the docstring of this method for more information.`),Dn=c(),be=a("h2"),Xe=a("a"),wr=a("span"),b(ft.$$.fragment),Kl=c(),zr=a("span"),Xl=s("FlavaFeatureExtractor"),qn=c(),M=a("div"),b(gt.$$.fragment),Ql=c(),Ir=a("p"),ed=s("Constructs a Flava image processor."),od=c(),Qe=a("div"),b(ht.$$.fragment),td=c(),ke=a("p"),ad=s("Center crop an image to "),Mr=a("code"),rd=s('(size["height"], size["width"])'),nd=s(". If the input size is smaller than "),Pr=a("code"),sd=s("crop_size"),id=s(` along
any edge, the image is padded with 0\u2019s and then center cropped.`),ld=c(),eo=a("div"),b(ut.$$.fragment),dd=c(),Cr=a("p"),cd=s("Normalize an image. image = (image - image_mean) / image_std."),md=c(),oo=a("div"),b(_t.$$.fragment),pd=c(),Er=a("p"),fd=s("Preprocess an image or batch of images."),gd=c(),to=a("div"),b(vt.$$.fragment),hd=c(),Ar=a("p"),ud=s("Rescale an image by a scale factor. image = image * scale."),_d=c(),ao=a("div"),b(bt.$$.fragment),vd=c(),kt=a("p"),bd=s("Resize an image to "),Nr=a("code"),kd=s('(size["height"], size["width"])'),Fd=s("."),Ln=c(),Fe=a("h2"),ro=a("a"),Or=a("span"),b(Ft.$$.fragment),yd=c(),Dr=a("span"),xd=s("FlavaImageProcessor"),jn=c(),G=a("div"),b(yt.$$.fragment),Td=c(),qr=a("p"),$d=s("Constructs a Flava image processor."),wd=c(),no=a("div"),b(xt.$$.fragment),zd=c(),Lr=a("p"),Id=s("Preprocess an image or batch of images."),Wn=c(),ye=a("h2"),so=a("a"),jr=a("span"),b(Tt.$$.fragment),Md=c(),Wr=a("span"),Pd=s("FlavaForPreTraining"),Sn=c(),W=a("div"),b($t.$$.fragment),Cd=c(),Sr=a("p"),Ed=s("The FLAVA model for pretraining which outputs losses, embeddings, logits and transformer outputs."),Ad=c(),wt=a("p"),Nd=s("This model is a PyTorch "),zt=a("a"),Od=s("torch.nn.Module"),Dd=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qd=c(),ee=a("div"),b(It.$$.fragment),Ld=c(),xe=a("p"),jd=s("The "),Na=a("a"),Wd=s("FlavaForPreTraining"),Sd=s(" forward method, overrides the "),Rr=a("code"),Rd=s("__call__"),Bd=s(" special method."),Vd=c(),b(io.$$.fragment),Rn=c(),Te=a("h2"),lo=a("a"),Br=a("span"),b(Mt.$$.fragment),Ud=c(),Vr=a("span"),Hd=s("FlavaModel"),Bn=c(),q=a("div"),b(Pt.$$.fragment),Gd=c(),Ct=a("p"),Yd=s(`The bare FLAVA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Et=a("a"),Zd=s("torch.nn.Module"),Jd=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kd=c(),S=a("div"),b(At.$$.fragment),Xd=c(),$e=a("p"),Qd=s("The "),Oa=a("a"),ec=s("FlavaModel"),oc=s(" forward method, overrides the "),Ur=a("code"),tc=s("__call__"),ac=s(" special method."),rc=c(),b(co.$$.fragment),nc=c(),b(mo.$$.fragment),sc=c(),oe=a("div"),b(Nt.$$.fragment),ic=c(),we=a("p"),lc=s("The "),Da=a("a"),dc=s("FlavaModel"),cc=s(" forward method, overrides the "),Hr=a("code"),mc=s("__call__"),pc=s(" special method."),fc=c(),b(po.$$.fragment),gc=c(),te=a("div"),b(Ot.$$.fragment),hc=c(),ze=a("p"),uc=s("The "),qa=a("a"),_c=s("FlavaModel"),vc=s(" forward method, overrides the "),Gr=a("code"),bc=s("__call__"),kc=s(" special method."),Fc=c(),b(fo.$$.fragment),Vn=c(),Ie=a("h2"),go=a("a"),Yr=a("span"),b(Dt.$$.fragment),yc=c(),Zr=a("span"),xc=s("FlavaImageCodebook"),Un=c(),C=a("div"),b(qt.$$.fragment),Tc=c(),Lt=a("p"),$c=s(`The FLAVA\u2019s image codebook model inspired from DALL-E\u2019s original encoder. Outputs raw hidden states and can be used
to generate image tokens for an image based on DALL-E\u2019s vocab. Used to generate labels for MIM. Use
`),Jr=a("code"),wc=s("get_codebook_indices"),zc=s(" to get image tokens for an image."),Ic=c(),jt=a("p"),Mc=s("This model is a PyTorch "),Wt=a("a"),Pc=s("torch.nn.Module"),Cc=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ec=c(),La=a("div"),b(St.$$.fragment),Ac=c(),ja=a("div"),b(Rt.$$.fragment),Nc=c(),Wa=a("div"),b(Bt.$$.fragment),Hn=c(),Me=a("h2"),ho=a("a"),Kr=a("span"),b(Vt.$$.fragment),Oc=c(),Xr=a("span"),Dc=s("FlavaTextModel"),Gn=c(),Y=a("div"),b(Ut.$$.fragment),qc=c(),Ht=a("p"),Lc=s(`The bare FLAVA Text Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Gt=a("a"),jc=s("torch.nn.Module"),Wc=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sc=c(),R=a("div"),b(Yt.$$.fragment),Rc=c(),Pe=a("p"),Bc=s("The "),Sa=a("a"),Vc=s("FlavaTextModel"),Uc=s(" forward method, overrides the "),Qr=a("code"),Hc=s("__call__"),Gc=s(" special method."),Yc=c(),b(uo.$$.fragment),Zc=c(),b(_o.$$.fragment),Yn=c(),Ce=a("h2"),vo=a("a"),en=a("span"),b(Zt.$$.fragment),Jc=c(),on=a("span"),Kc=s("FlavaImageModel"),Zn=c(),Z=a("div"),b(Jt.$$.fragment),Xc=c(),Kt=a("p"),Qc=s(`The bare FLAVA Image Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Xt=a("a"),em=s("torch.nn.Module"),om=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tm=c(),B=a("div"),b(Qt.$$.fragment),am=c(),Ee=a("p"),rm=s("The "),Ra=a("a"),nm=s("FlavaImageModel"),sm=s(" forward method, overrides the "),tn=a("code"),im=s("__call__"),lm=s(" special method."),dm=c(),b(bo.$$.fragment),cm=c(),b(ko.$$.fragment),Jn=c(),Ae=a("h2"),Fo=a("a"),an=a("span"),b(ea.$$.fragment),mm=c(),rn=a("span"),pm=s("FlavaMultimodalModel"),Kn=c(),J=a("div"),b(oa.$$.fragment),fm=c(),ta=a("p"),gm=s(`The bare FLAVA Multimodal Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),aa=a("a"),hm=s("torch.nn.Module"),um=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_m=c(),V=a("div"),b(ra.$$.fragment),vm=c(),Ne=a("p"),bm=s("The "),Ba=a("a"),km=s("FlavaMultimodalModel"),Fm=s(" forward method, overrides the "),nn=a("code"),ym=s("__call__"),xm=s(" special method."),Tm=c(),b(yo.$$.fragment),$m=c(),b(xo.$$.fragment),this.h()},l(o){const g=If('[data-svelte="svelte-1phssyn"]',document.head);p=r(g,"META",{name:!0,content:!0}),g.forEach(t),$=m(o),_=r(o,"H1",{class:!0});var na=n(_);h=r(na,"A",{id:!0,class:!0,href:!0});var sn=n(h);v=r(sn,"SPAN",{});var ln=n(v);k(l.$$.fragment,ln),ln.forEach(t),sn.forEach(t),f=m(na),I=r(na,"SPAN",{});var dn=n(I);Ss=i(dn,"FLAVA"),dn.forEach(t),na.forEach(t),vn=m(o),le=r(o,"H2",{class:!0});var sa=n(le);De=r(sa,"A",{id:!0,class:!0,href:!0});var cn=n(De);dr=r(cn,"SPAN",{});var mn=n(dr);k(Eo.$$.fragment,mn),mn.forEach(t),cn.forEach(t),Rs=m(sa),cr=r(sa,"SPAN",{});var pn=n(cr);Bs=i(pn,"Overview"),pn.forEach(t),sa.forEach(t),bn=m(o),qe=r(o,"P",{});var ia=n(qe);Vs=i(ia,"The FLAVA model was proposed in "),Ao=r(ia,"A",{href:!0,rel:!0});var fn=n(Ao);Us=i(fn,"FLAVA: A Foundational Language And Vision Alignment Model"),fn.forEach(t),Hs=i(ia," by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022."),ia.forEach(t),kn=m(o),ca=r(o,"P",{});var gn=n(ca);Gs=i(gn,`The paper aims at creating a single unified foundation model which can work across vision, language
as well as vision-and-language multimodal tasks.`),gn.forEach(t),Fn=m(o),ma=r(o,"P",{});var hn=n(ma);Ys=i(hn,"The abstract from the paper is the following:"),hn.forEach(t),yn=m(o),pa=r(o,"P",{});var un=n(pa);mr=r(un,"EM",{});var _n=n(mr);Zs=i(_n,`State-of-the-art vision and vision-and-language models rely on large-scale visio-linguistic pretraining for obtaining good performance on a variety
of downstream tasks. Generally, such models are often either cross-modal (contrastive) or multi-modal
(with earlier fusion) but not both; and they often only target specific modalities or tasks. A promising
direction would be to use a single holistic universal model, as a \u201Cfoundation\u201D, that targets all modalities
at once \u2014 a true vision and language foundation model should be good at vision tasks, language tasks, and
cross- and multi-modal vision and language tasks. We introduce FLAVA as such a model and demonstrate
impressive performance on a wide range of 35 tasks spanning these target modalities.`),_n.forEach(t),un.forEach(t),xn=m(o),X=r(o,"P",{});var Oe=n(X);Js=i(Oe,"This model was contributed by "),No=r(Oe,"A",{href:!0,rel:!0});var wm=n(No);Ks=i(wm,"aps"),wm.forEach(t),Xs=i(Oe,". The original code can be found "),Oo=r(Oe,"A",{href:!0,rel:!0});var zm=n(Oo);Qs=i(zm,"here"),zm.forEach(t),ei=i(Oe,"."),Oe.forEach(t),Tn=m(o),de=r(o,"H2",{class:!0});var Qn=n(de);Le=r(Qn,"A",{id:!0,class:!0,href:!0});var Im=n(Le);pr=r(Im,"SPAN",{});var Mm=n(pr);k(Do.$$.fragment,Mm),Mm.forEach(t),Im.forEach(t),oi=m(Qn),fr=r(Qn,"SPAN",{});var Pm=n(fr);ti=i(Pm,"FlavaConfig"),Pm.forEach(t),Qn.forEach(t),$n=m(o),P=r(o,"DIV",{class:!0});var U=n(P);k(qo.$$.fragment,U),ai=m(U),Q=r(U,"P",{});var la=n(Q);fa=r(la,"A",{href:!0});var Cm=n(fa);ri=i(Cm,"FlavaConfig"),Cm.forEach(t),ni=i(la," is the configuration class to store the configuration of a "),ga=r(la,"A",{href:!0});var Em=n(ga);si=i(Em,"FlavaModel"),Em.forEach(t),ii=i(la,`. It is used to
instantiate FLAVA model according to the specified arguments, defining the text model, image model, image codebook
and multimodal model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the FLAVA `),Lo=r(la,"A",{href:!0,rel:!0});var Am=n(Lo);li=i(Am,"facebook/flava-full"),Am.forEach(t),di=i(la," architecture."),la.forEach(t),ci=m(U),ce=r(U,"P",{});var Va=n(ce);mi=i(Va,"Configuration objects inherit from "),ha=r(Va,"A",{href:!0});var Nm=n(ha);pi=i(Nm,"PretrainedConfig"),Nm.forEach(t),fi=i(Va,` and can be used to control the model outputs. Read the
documentation from `),ua=r(Va,"A",{href:!0});var Om=n(ua);gi=i(Om,"PretrainedConfig"),Om.forEach(t),hi=i(Va," for more information."),Va.forEach(t),ui=m(U),k(je.$$.fragment,U),_i=m(U),We=r(U,"DIV",{class:!0});var es=n(We);k(jo.$$.fragment,es),vi=m(es),Wo=r(es,"P",{});var os=n(Wo);bi=i(os,"Instantiate a "),_a=r(os,"A",{href:!0});var Dm=n(_a);ki=i(Dm,"FlavaConfig"),Dm.forEach(t),Fi=i(os,` (or a derived class) from flava text model configuration, flava image model
configuration, flava multimodal model and flava codebook model configuration.`),os.forEach(t),es.forEach(t),yi=m(U),Se=r(U,"DIV",{class:!0});var ts=n(Se);k(So.$$.fragment,ts),xi=m(ts),Ro=r(ts,"P",{});var as=n(Ro);Ti=i(as,"Serializes this instance to a Python dictionary. Override the default "),va=r(as,"A",{href:!0});var qm=n(va);$i=i(qm,"to_dict()"),qm.forEach(t),wi=i(as,"."),as.forEach(t),ts.forEach(t),U.forEach(t),wn=m(o),me=r(o,"H2",{class:!0});var rs=n(me);Re=r(rs,"A",{id:!0,class:!0,href:!0});var Lm=n(Re);gr=r(Lm,"SPAN",{});var jm=n(gr);k(Bo.$$.fragment,jm),jm.forEach(t),Lm.forEach(t),zi=m(rs),hr=r(rs,"SPAN",{});var Wm=n(hr);Ii=i(Wm,"FlavaTextConfig"),Wm.forEach(t),rs.forEach(t),zn=m(o),A=r(o,"DIV",{class:!0});var ae=n(A);k(Vo.$$.fragment,ae),Mi=m(ae),Uo=r(ae,"P",{});var ns=n(Uo);Pi=i(ns,"This is the configuration class to store the configuration of a "),ba=r(ns,"A",{href:!0});var Sm=n(ba);Ci=i(Sm,"FlavaTextModel"),Sm.forEach(t),Ei=i(ns,`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),ns.forEach(t),Ai=m(ae),Ho=r(ae,"P",{});var ss=n(Ho);Ni=i(ss,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Go=r(ss,"A",{href:!0,rel:!0});var Rm=n(Go);Oi=i(Rm,"facebook/flava-full"),Rm.forEach(t),Di=i(ss," architecture."),ss.forEach(t),qi=m(ae),pe=r(ae,"P",{});var Ua=n(pe);Li=i(Ua,"Configuration objects inherit from "),ka=r(Ua,"A",{href:!0});var Bm=n(ka);ji=i(Bm,"PretrainedConfig"),Bm.forEach(t),Wi=i(Ua,` and can be used to control the model outputs. Read the
documentation from `),Fa=r(Ua,"A",{href:!0});var Vm=n(Fa);Si=i(Vm,"PretrainedConfig"),Vm.forEach(t),Ri=i(Ua," for more information."),Ua.forEach(t),Bi=m(ae),k(Be.$$.fragment,ae),ae.forEach(t),In=m(o),fe=r(o,"H2",{class:!0});var is=n(fe);Ve=r(is,"A",{id:!0,class:!0,href:!0});var Um=n(Ve);ur=r(Um,"SPAN",{});var Hm=n(ur);k(Yo.$$.fragment,Hm),Hm.forEach(t),Um.forEach(t),Vi=m(is),_r=r(is,"SPAN",{});var Gm=n(_r);Ui=i(Gm,"FlavaImageConfig"),Gm.forEach(t),is.forEach(t),Mn=m(o),N=r(o,"DIV",{class:!0});var re=n(N);k(Zo.$$.fragment,re),Hi=m(re),Jo=r(re,"P",{});var ls=n(Jo);Gi=i(ls,"This is the configuration class to store the configuration of a "),ya=r(ls,"A",{href:!0});var Ym=n(ya);Yi=i(Ym,"FlavaImageModel"),Ym.forEach(t),Zi=i(ls,`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),ls.forEach(t),Ji=m(re),Ko=r(re,"P",{});var ds=n(Ko);Ki=i(ds,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Xo=r(ds,"A",{href:!0,rel:!0});var Zm=n(Xo);Xi=i(Zm,"facebook/flava-full"),Zm.forEach(t),Qi=i(ds," architecture."),ds.forEach(t),el=m(re),ge=r(re,"P",{});var Ha=n(ge);ol=i(Ha,"Configuration objects inherit from "),xa=r(Ha,"A",{href:!0});var Jm=n(xa);tl=i(Jm,"PretrainedConfig"),Jm.forEach(t),al=i(Ha,` and can be used to control the model outputs. Read the
documentation from `),Ta=r(Ha,"A",{href:!0});var Km=n(Ta);rl=i(Km,"PretrainedConfig"),Km.forEach(t),nl=i(Ha," for more information."),Ha.forEach(t),sl=m(re),k(Ue.$$.fragment,re),re.forEach(t),Pn=m(o),he=r(o,"H2",{class:!0});var cs=n(he);He=r(cs,"A",{id:!0,class:!0,href:!0});var Xm=n(He);vr=r(Xm,"SPAN",{});var Qm=n(vr);k(Qo.$$.fragment,Qm),Qm.forEach(t),Xm.forEach(t),il=m(cs),br=r(cs,"SPAN",{});var ep=n(br);ll=i(ep,"FlavaMultimodalConfig"),ep.forEach(t),cs.forEach(t),Cn=m(o),O=r(o,"DIV",{class:!0});var ne=n(O);k(et.$$.fragment,ne),dl=m(ne),ot=r(ne,"P",{});var ms=n(ot);cl=i(ms,"This is the configuration class to store the configuration of a "),$a=r(ms,"A",{href:!0});var op=n($a);ml=i(op,"FlavaMultimodalModel"),op.forEach(t),pl=i(ms,`. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.`),ms.forEach(t),fl=m(ne),tt=r(ne,"P",{});var ps=n(tt);gl=i(ps,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),at=r(ps,"A",{href:!0,rel:!0});var tp=n(at);hl=i(tp,"facebook/flava-full"),tp.forEach(t),ul=i(ps," architecture."),ps.forEach(t),_l=m(ne),ue=r(ne,"P",{});var Ga=n(ue);vl=i(Ga,"Configuration objects inherit from "),wa=r(Ga,"A",{href:!0});var ap=n(wa);bl=i(ap,"PretrainedConfig"),ap.forEach(t),kl=i(Ga,` and can be used to control the model outputs. Read the
documentation from `),za=r(Ga,"A",{href:!0});var rp=n(za);Fl=i(rp,"PretrainedConfig"),rp.forEach(t),yl=i(Ga," for more information."),Ga.forEach(t),xl=m(ne),k(Ge.$$.fragment,ne),ne.forEach(t),En=m(o),_e=r(o,"H2",{class:!0});var fs=n(_e);Ye=r(fs,"A",{id:!0,class:!0,href:!0});var np=n(Ye);kr=r(np,"SPAN",{});var sp=n(kr);k(rt.$$.fragment,sp),sp.forEach(t),np.forEach(t),Tl=m(fs),Fr=r(fs,"SPAN",{});var ip=n(Fr);$l=i(ip,"FlavaImageCodebookConfig"),ip.forEach(t),fs.forEach(t),An=m(o),nt=r(o,"DIV",{class:!0});var lp=n(nt);k(st.$$.fragment,lp),lp.forEach(t),Nn=m(o),ve=r(o,"H2",{class:!0});var gs=n(ve);Ze=r(gs,"A",{id:!0,class:!0,href:!0});var dp=n(Ze);yr=r(dp,"SPAN",{});var cp=n(yr);k(it.$$.fragment,cp),cp.forEach(t),dp.forEach(t),wl=m(gs),xr=r(gs,"SPAN",{});var mp=n(xr);zl=i(mp,"FlavaProcessor"),mp.forEach(t),gs.forEach(t),On=m(o),D=r(o,"DIV",{class:!0});var se=n(D);k(lt.$$.fragment,se),Il=m(se),Tr=r(se,"P",{});var pp=n(Tr);Ml=i(pp,"Constructs a FLAVA processor which wraps a FLAVA feature extractor and a FLAVA tokenizer into a single processor."),pp.forEach(t),Pl=m(se),L=r(se,"P",{});var K=n(L);Ia=r(K,"A",{href:!0});var fp=n(Ia);Cl=i(fp,"FlavaProcessor"),fp.forEach(t),El=i(K," offers all the functionalities of "),Ma=r(K,"A",{href:!0});var gp=n(Ma);Al=i(gp,"FlavaFeatureExtractor"),gp.forEach(t),Nl=i(K," and "),Pa=r(K,"A",{href:!0});var hp=n(Pa);Ol=i(hp,"BertTokenizerFast"),hp.forEach(t),Dl=i(K,`. See the
`),$r=r(K,"CODE",{});var up=n($r);ql=i(up,"__call__()"),up.forEach(t),Ll=i(K," and "),Ca=r(K,"A",{href:!0});var _p=n(Ca);jl=i(_p,"decode()"),_p.forEach(t),Wl=i(K," for more information."),K.forEach(t),Sl=m(se),Je=r(se,"DIV",{class:!0});var hs=n(Je);k(dt.$$.fragment,hs),Rl=m(hs),ct=r(hs,"P",{});var us=n(ct);Bl=i(us,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Ea=r(us,"A",{href:!0});var vp=n(Ea);Vl=i(vp,"batch_decode()"),vp.forEach(t),Ul=i(us,`. Please
refer to the docstring of this method for more information.`),us.forEach(t),hs.forEach(t),Hl=m(se),Ke=r(se,"DIV",{class:!0});var _s=n(Ke);k(mt.$$.fragment,_s),Gl=m(_s),pt=r(_s,"P",{});var vs=n(pt);Yl=i(vs,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Aa=r(vs,"A",{href:!0});var bp=n(Aa);Zl=i(bp,"decode()"),bp.forEach(t),Jl=i(vs,`. Please refer to
the docstring of this method for more information.`),vs.forEach(t),_s.forEach(t),se.forEach(t),Dn=m(o),be=r(o,"H2",{class:!0});var bs=n(be);Xe=r(bs,"A",{id:!0,class:!0,href:!0});var kp=n(Xe);wr=r(kp,"SPAN",{});var Fp=n(wr);k(ft.$$.fragment,Fp),Fp.forEach(t),kp.forEach(t),Kl=m(bs),zr=r(bs,"SPAN",{});var yp=n(zr);Xl=i(yp,"FlavaFeatureExtractor"),yp.forEach(t),bs.forEach(t),qn=m(o),M=r(o,"DIV",{class:!0});var j=n(M);k(gt.$$.fragment,j),Ql=m(j),Ir=r(j,"P",{});var xp=n(Ir);ed=i(xp,"Constructs a Flava image processor."),xp.forEach(t),od=m(j),Qe=r(j,"DIV",{class:!0});var ks=n(Qe);k(ht.$$.fragment,ks),td=m(ks),ke=r(ks,"P",{});var Ya=n(ke);ad=i(Ya,"Center crop an image to "),Mr=r(Ya,"CODE",{});var Tp=n(Mr);rd=i(Tp,'(size["height"], size["width"])'),Tp.forEach(t),nd=i(Ya,". If the input size is smaller than "),Pr=r(Ya,"CODE",{});var $p=n(Pr);sd=i($p,"crop_size"),$p.forEach(t),id=i(Ya,` along
any edge, the image is padded with 0\u2019s and then center cropped.`),Ya.forEach(t),ks.forEach(t),ld=m(j),eo=r(j,"DIV",{class:!0});var Fs=n(eo);k(ut.$$.fragment,Fs),dd=m(Fs),Cr=r(Fs,"P",{});var wp=n(Cr);cd=i(wp,"Normalize an image. image = (image - image_mean) / image_std."),wp.forEach(t),Fs.forEach(t),md=m(j),oo=r(j,"DIV",{class:!0});var ys=n(oo);k(_t.$$.fragment,ys),pd=m(ys),Er=r(ys,"P",{});var zp=n(Er);fd=i(zp,"Preprocess an image or batch of images."),zp.forEach(t),ys.forEach(t),gd=m(j),to=r(j,"DIV",{class:!0});var xs=n(to);k(vt.$$.fragment,xs),hd=m(xs),Ar=r(xs,"P",{});var Ip=n(Ar);ud=i(Ip,"Rescale an image by a scale factor. image = image * scale."),Ip.forEach(t),xs.forEach(t),_d=m(j),ao=r(j,"DIV",{class:!0});var Ts=n(ao);k(bt.$$.fragment,Ts),vd=m(Ts),kt=r(Ts,"P",{});var $s=n(kt);bd=i($s,"Resize an image to "),Nr=r($s,"CODE",{});var Mp=n(Nr);kd=i(Mp,'(size["height"], size["width"])'),Mp.forEach(t),Fd=i($s,"."),$s.forEach(t),Ts.forEach(t),j.forEach(t),Ln=m(o),Fe=r(o,"H2",{class:!0});var ws=n(Fe);ro=r(ws,"A",{id:!0,class:!0,href:!0});var Pp=n(ro);Or=r(Pp,"SPAN",{});var Cp=n(Or);k(Ft.$$.fragment,Cp),Cp.forEach(t),Pp.forEach(t),yd=m(ws),Dr=r(ws,"SPAN",{});var Ep=n(Dr);xd=i(Ep,"FlavaImageProcessor"),Ep.forEach(t),ws.forEach(t),jn=m(o),G=r(o,"DIV",{class:!0});var Za=n(G);k(yt.$$.fragment,Za),Td=m(Za),qr=r(Za,"P",{});var Ap=n(qr);$d=i(Ap,"Constructs a Flava image processor."),Ap.forEach(t),wd=m(Za),no=r(Za,"DIV",{class:!0});var zs=n(no);k(xt.$$.fragment,zs),zd=m(zs),Lr=r(zs,"P",{});var Np=n(Lr);Id=i(Np,"Preprocess an image or batch of images."),Np.forEach(t),zs.forEach(t),Za.forEach(t),Wn=m(o),ye=r(o,"H2",{class:!0});var Is=n(ye);so=r(Is,"A",{id:!0,class:!0,href:!0});var Op=n(so);jr=r(Op,"SPAN",{});var Dp=n(jr);k(Tt.$$.fragment,Dp),Dp.forEach(t),Op.forEach(t),Md=m(Is),Wr=r(Is,"SPAN",{});var qp=n(Wr);Pd=i(qp,"FlavaForPreTraining"),qp.forEach(t),Is.forEach(t),Sn=m(o),W=r(o,"DIV",{class:!0});var To=n(W);k($t.$$.fragment,To),Cd=m(To),Sr=r(To,"P",{});var Lp=n(Sr);Ed=i(Lp,"The FLAVA model for pretraining which outputs losses, embeddings, logits and transformer outputs."),Lp.forEach(t),Ad=m(To),wt=r(To,"P",{});var Ms=n(wt);Nd=i(Ms,"This model is a PyTorch "),zt=r(Ms,"A",{href:!0,rel:!0});var jp=n(zt);Od=i(jp,"torch.nn.Module"),jp.forEach(t),Dd=i(Ms,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ms.forEach(t),qd=m(To),ee=r(To,"DIV",{class:!0});var Ja=n(ee);k(It.$$.fragment,Ja),Ld=m(Ja),xe=r(Ja,"P",{});var Ka=n(xe);jd=i(Ka,"The "),Na=r(Ka,"A",{href:!0});var Wp=n(Na);Wd=i(Wp,"FlavaForPreTraining"),Wp.forEach(t),Sd=i(Ka," forward method, overrides the "),Rr=r(Ka,"CODE",{});var Sp=n(Rr);Rd=i(Sp,"__call__"),Sp.forEach(t),Bd=i(Ka," special method."),Ka.forEach(t),Vd=m(Ja),k(io.$$.fragment,Ja),Ja.forEach(t),To.forEach(t),Rn=m(o),Te=r(o,"H2",{class:!0});var Ps=n(Te);lo=r(Ps,"A",{id:!0,class:!0,href:!0});var Rp=n(lo);Br=r(Rp,"SPAN",{});var Bp=n(Br);k(Mt.$$.fragment,Bp),Bp.forEach(t),Rp.forEach(t),Ud=m(Ps),Vr=r(Ps,"SPAN",{});var Vp=n(Vr);Hd=i(Vp,"FlavaModel"),Vp.forEach(t),Ps.forEach(t),Bn=m(o),q=r(o,"DIV",{class:!0});var ie=n(q);k(Pt.$$.fragment,ie),Gd=m(ie),Ct=r(ie,"P",{});var Cs=n(Ct);Yd=i(Cs,`The bare FLAVA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Et=r(Cs,"A",{href:!0,rel:!0});var Up=n(Et);Zd=i(Up,"torch.nn.Module"),Up.forEach(t),Jd=i(Cs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cs.forEach(t),Kd=m(ie),S=r(ie,"DIV",{class:!0});var $o=n(S);k(At.$$.fragment,$o),Xd=m($o),$e=r($o,"P",{});var Xa=n($e);Qd=i(Xa,"The "),Oa=r(Xa,"A",{href:!0});var Hp=n(Oa);ec=i(Hp,"FlavaModel"),Hp.forEach(t),oc=i(Xa," forward method, overrides the "),Ur=r(Xa,"CODE",{});var Gp=n(Ur);tc=i(Gp,"__call__"),Gp.forEach(t),ac=i(Xa," special method."),Xa.forEach(t),rc=m($o),k(co.$$.fragment,$o),nc=m($o),k(mo.$$.fragment,$o),$o.forEach(t),sc=m(ie),oe=r(ie,"DIV",{class:!0});var Qa=n(oe);k(Nt.$$.fragment,Qa),ic=m(Qa),we=r(Qa,"P",{});var er=n(we);lc=i(er,"The "),Da=r(er,"A",{href:!0});var Yp=n(Da);dc=i(Yp,"FlavaModel"),Yp.forEach(t),cc=i(er," forward method, overrides the "),Hr=r(er,"CODE",{});var Zp=n(Hr);mc=i(Zp,"__call__"),Zp.forEach(t),pc=i(er," special method."),er.forEach(t),fc=m(Qa),k(po.$$.fragment,Qa),Qa.forEach(t),gc=m(ie),te=r(ie,"DIV",{class:!0});var or=n(te);k(Ot.$$.fragment,or),hc=m(or),ze=r(or,"P",{});var tr=n(ze);uc=i(tr,"The "),qa=r(tr,"A",{href:!0});var Jp=n(qa);_c=i(Jp,"FlavaModel"),Jp.forEach(t),vc=i(tr," forward method, overrides the "),Gr=r(tr,"CODE",{});var Kp=n(Gr);bc=i(Kp,"__call__"),Kp.forEach(t),kc=i(tr," special method."),tr.forEach(t),Fc=m(or),k(fo.$$.fragment,or),or.forEach(t),ie.forEach(t),Vn=m(o),Ie=r(o,"H2",{class:!0});var Es=n(Ie);go=r(Es,"A",{id:!0,class:!0,href:!0});var Xp=n(go);Yr=r(Xp,"SPAN",{});var Qp=n(Yr);k(Dt.$$.fragment,Qp),Qp.forEach(t),Xp.forEach(t),yc=m(Es),Zr=r(Es,"SPAN",{});var ef=n(Zr);xc=i(ef,"FlavaImageCodebook"),ef.forEach(t),Es.forEach(t),Un=m(o),C=r(o,"DIV",{class:!0});var H=n(C);k(qt.$$.fragment,H),Tc=m(H),Lt=r(H,"P",{});var As=n(Lt);$c=i(As,`The FLAVA\u2019s image codebook model inspired from DALL-E\u2019s original encoder. Outputs raw hidden states and can be used
to generate image tokens for an image based on DALL-E\u2019s vocab. Used to generate labels for MIM. Use
`),Jr=r(As,"CODE",{});var of=n(Jr);wc=i(of,"get_codebook_indices"),of.forEach(t),zc=i(As," to get image tokens for an image."),As.forEach(t),Ic=m(H),jt=r(H,"P",{});var Ns=n(jt);Mc=i(Ns,"This model is a PyTorch "),Wt=r(Ns,"A",{href:!0,rel:!0});var tf=n(Wt);Pc=i(tf,"torch.nn.Module"),tf.forEach(t),Cc=i(Ns,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ns.forEach(t),Ec=m(H),La=r(H,"DIV",{class:!0});var af=n(La);k(St.$$.fragment,af),af.forEach(t),Ac=m(H),ja=r(H,"DIV",{class:!0});var rf=n(ja);k(Rt.$$.fragment,rf),rf.forEach(t),Nc=m(H),Wa=r(H,"DIV",{class:!0});var nf=n(Wa);k(Bt.$$.fragment,nf),nf.forEach(t),H.forEach(t),Hn=m(o),Me=r(o,"H2",{class:!0});var Os=n(Me);ho=r(Os,"A",{id:!0,class:!0,href:!0});var sf=n(ho);Kr=r(sf,"SPAN",{});var lf=n(Kr);k(Vt.$$.fragment,lf),lf.forEach(t),sf.forEach(t),Oc=m(Os),Xr=r(Os,"SPAN",{});var df=n(Xr);Dc=i(df,"FlavaTextModel"),df.forEach(t),Os.forEach(t),Gn=m(o),Y=r(o,"DIV",{class:!0});var ar=n(Y);k(Ut.$$.fragment,ar),qc=m(ar),Ht=r(ar,"P",{});var Ds=n(Ht);Lc=i(Ds,`The bare FLAVA Text Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Gt=r(Ds,"A",{href:!0,rel:!0});var cf=n(Gt);jc=i(cf,"torch.nn.Module"),cf.forEach(t),Wc=i(Ds,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ds.forEach(t),Sc=m(ar),R=r(ar,"DIV",{class:!0});var wo=n(R);k(Yt.$$.fragment,wo),Rc=m(wo),Pe=r(wo,"P",{});var rr=n(Pe);Bc=i(rr,"The "),Sa=r(rr,"A",{href:!0});var mf=n(Sa);Vc=i(mf,"FlavaTextModel"),mf.forEach(t),Uc=i(rr," forward method, overrides the "),Qr=r(rr,"CODE",{});var pf=n(Qr);Hc=i(pf,"__call__"),pf.forEach(t),Gc=i(rr," special method."),rr.forEach(t),Yc=m(wo),k(uo.$$.fragment,wo),Zc=m(wo),k(_o.$$.fragment,wo),wo.forEach(t),ar.forEach(t),Yn=m(o),Ce=r(o,"H2",{class:!0});var qs=n(Ce);vo=r(qs,"A",{id:!0,class:!0,href:!0});var ff=n(vo);en=r(ff,"SPAN",{});var gf=n(en);k(Zt.$$.fragment,gf),gf.forEach(t),ff.forEach(t),Jc=m(qs),on=r(qs,"SPAN",{});var hf=n(on);Kc=i(hf,"FlavaImageModel"),hf.forEach(t),qs.forEach(t),Zn=m(o),Z=r(o,"DIV",{class:!0});var nr=n(Z);k(Jt.$$.fragment,nr),Xc=m(nr),Kt=r(nr,"P",{});var Ls=n(Kt);Qc=i(Ls,`The bare FLAVA Image Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Xt=r(Ls,"A",{href:!0,rel:!0});var uf=n(Xt);em=i(uf,"torch.nn.Module"),uf.forEach(t),om=i(Ls,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ls.forEach(t),tm=m(nr),B=r(nr,"DIV",{class:!0});var zo=n(B);k(Qt.$$.fragment,zo),am=m(zo),Ee=r(zo,"P",{});var sr=n(Ee);rm=i(sr,"The "),Ra=r(sr,"A",{href:!0});var _f=n(Ra);nm=i(_f,"FlavaImageModel"),_f.forEach(t),sm=i(sr," forward method, overrides the "),tn=r(sr,"CODE",{});var vf=n(tn);im=i(vf,"__call__"),vf.forEach(t),lm=i(sr," special method."),sr.forEach(t),dm=m(zo),k(bo.$$.fragment,zo),cm=m(zo),k(ko.$$.fragment,zo),zo.forEach(t),nr.forEach(t),Jn=m(o),Ae=r(o,"H2",{class:!0});var js=n(Ae);Fo=r(js,"A",{id:!0,class:!0,href:!0});var bf=n(Fo);an=r(bf,"SPAN",{});var kf=n(an);k(ea.$$.fragment,kf),kf.forEach(t),bf.forEach(t),mm=m(js),rn=r(js,"SPAN",{});var Ff=n(rn);pm=i(Ff,"FlavaMultimodalModel"),Ff.forEach(t),js.forEach(t),Kn=m(o),J=r(o,"DIV",{class:!0});var ir=n(J);k(oa.$$.fragment,ir),fm=m(ir),ta=r(ir,"P",{});var Ws=n(ta);gm=i(Ws,`The bare FLAVA Multimodal Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),aa=r(Ws,"A",{href:!0,rel:!0});var yf=n(aa);hm=i(yf,"torch.nn.Module"),yf.forEach(t),um=i(Ws,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ws.forEach(t),_m=m(ir),V=r(ir,"DIV",{class:!0});var Io=n(V);k(ra.$$.fragment,Io),vm=m(Io),Ne=r(Io,"P",{});var lr=n(Ne);bm=i(lr,"The "),Ba=r(lr,"A",{href:!0});var xf=n(Ba);km=i(xf,"FlavaMultimodalModel"),xf.forEach(t),Fm=i(lr," forward method, overrides the "),nn=r(lr,"CODE",{});var Tf=n(nn);ym=i(Tf,"__call__"),Tf.forEach(t),xm=i(lr," special method."),lr.forEach(t),Tm=m(Io),k(yo.$$.fragment,Io),$m=m(Io),k(xo.$$.fragment,Io),Io.forEach(t),ir.forEach(t),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(Hf)),d(h,"id","flava"),d(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(h,"href","#flava"),d(_,"class","relative group"),d(De,"id","overview"),d(De,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(De,"href","#overview"),d(le,"class","relative group"),d(Ao,"href","https://arxiv.org/abs/2112.04482"),d(Ao,"rel","nofollow"),d(No,"href","https://huggingface.co/aps"),d(No,"rel","nofollow"),d(Oo,"href","https://github.com/facebookresearch/multimodal/tree/main/examples/flava"),d(Oo,"rel","nofollow"),d(Le,"id","transformers.FlavaConfig"),d(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Le,"href","#transformers.FlavaConfig"),d(de,"class","relative group"),d(fa,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaConfig"),d(ga,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaModel"),d(Lo,"href","https://huggingface.co/facebook/flava-full"),d(Lo,"rel","nofollow"),d(ha,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(ua,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(_a,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaConfig"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(va,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.FlavaTextConfig"),d(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Re,"href","#transformers.FlavaTextConfig"),d(me,"class","relative group"),d(ba,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"),d(Go,"href","https://huggingface.co/facebook/flava-full"),d(Go,"rel","nofollow"),d(ka,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Fa,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ve,"id","transformers.FlavaImageConfig"),d(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ve,"href","#transformers.FlavaImageConfig"),d(fe,"class","relative group"),d(ya,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"),d(Xo,"href","https://huggingface.co/facebook/flava-full"),d(Xo,"rel","nofollow"),d(xa,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ta,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(He,"id","transformers.FlavaMultimodalConfig"),d(He,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(He,"href","#transformers.FlavaMultimodalConfig"),d(he,"class","relative group"),d($a,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalModel"),d(at,"href","https://huggingface.co/facebook/flava-full"),d(at,"rel","nofollow"),d(wa,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(za,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ye,"id","transformers.FlavaImageCodebookConfig"),d(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ye,"href","#transformers.FlavaImageCodebookConfig"),d(_e,"class","relative group"),d(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"id","transformers.FlavaProcessor"),d(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"),d(Ze,"href","#transformers.FlavaProcessor"),d(ve,"class","relative group"),d(Ia,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaProcessor"),d(Ma,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageProcessor"),d(Pa,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizerFast"),d(Ca,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaProcessor.decode"),d(Ea,"href","/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),d(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Aa,"href","/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),d(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xe,"id","transformers.FlavaImageProcessor"),d(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Xe,"href","#transformers.FlavaImageProcessor"),d(be,"class","relative group"),d(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(to,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ro,"id","transformers.FlavaImageProcessor"),d(ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ro,"href","#transformers.FlavaImageProcessor"),d(Fe,"class","relative group"),d(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(so,"id","transformers.FlavaForPreTraining"),d(so,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(so,"href","#transformers.FlavaForPreTraining"),d(ye,"class","relative group"),d(zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(zt,"rel","nofollow"),d(Na,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaForPreTraining"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lo,"id","transformers.FlavaModel"),d(lo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(lo,"href","#transformers.FlavaModel"),d(Te,"class","relative group"),d(Et,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Et,"rel","nofollow"),d(Oa,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaModel"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Da,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaModel"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qa,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaModel"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(go,"id","transformers.FlavaImageCodebook"),d(go,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(go,"href","#transformers.FlavaImageCodebook"),d(Ie,"class","relative group"),d(Wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Wt,"rel","nofollow"),d(La,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ja,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Wa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ho,"id","transformers.FlavaTextModel"),d(ho,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ho,"href","#transformers.FlavaTextModel"),d(Me,"class","relative group"),d(Gt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Gt,"rel","nofollow"),d(Sa,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaTextModel"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vo,"id","transformers.FlavaImageModel"),d(vo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(vo,"href","#transformers.FlavaImageModel"),d(Ce,"class","relative group"),d(Xt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Xt,"rel","nofollow"),d(Ra,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaImageModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fo,"id","transformers.FlavaMultimodalModel"),d(Fo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Fo,"href","#transformers.FlavaMultimodalModel"),d(Ae,"class","relative group"),d(aa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(aa,"rel","nofollow"),d(Ba,"href","/docs/transformers/v4.25.1/en/model_doc/flava#transformers.FlavaMultimodalModel"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"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),u(o,$,g),u(o,_,g),e(_,h),e(h,v),F(l,v,null),e(_,f),e(_,I),e(I,Ss),u(o,vn,g),u(o,le,g),e(le,De),e(De,dr),F(Eo,dr,null),e(le,Rs),e(le,cr),e(cr,Bs),u(o,bn,g),u(o,qe,g),e(qe,Vs),e(qe,Ao),e(Ao,Us),e(qe,Hs),u(o,kn,g),u(o,ca,g),e(ca,Gs),u(o,Fn,g),u(o,ma,g),e(ma,Ys),u(o,yn,g),u(o,pa,g),e(pa,mr),e(mr,Zs),u(o,xn,g),u(o,X,g),e(X,Js),e(X,No),e(No,Ks),e(X,Xs),e(X,Oo),e(Oo,Qs),e(X,ei),u(o,Tn,g),u(o,de,g),e(de,Le),e(Le,pr),F(Do,pr,null),e(de,oi),e(de,fr),e(fr,ti),u(o,$n,g),u(o,P,g),F(qo,P,null),e(P,ai),e(P,Q),e(Q,fa),e(fa,ri),e(Q,ni),e(Q,ga),e(ga,si),e(Q,ii),e(Q,Lo),e(Lo,li),e(Q,di),e(P,ci),e(P,ce),e(ce,mi),e(ce,ha),e(ha,pi),e(ce,fi),e(ce,ua),e(ua,gi),e(ce,hi),e(P,ui),F(je,P,null),e(P,_i),e(P,We),F(jo,We,null),e(We,vi),e(We,Wo),e(Wo,bi),e(Wo,_a),e(_a,ki),e(Wo,Fi),e(P,yi),e(P,Se),F(So,Se,null),e(Se,xi),e(Se,Ro),e(Ro,Ti),e(Ro,va),e(va,$i),e(Ro,wi),u(o,wn,g),u(o,me,g),e(me,Re),e(Re,gr),F(Bo,gr,null),e(me,zi),e(me,hr),e(hr,Ii),u(o,zn,g),u(o,A,g),F(Vo,A,null),e(A,Mi),e(A,Uo),e(Uo,Pi),e(Uo,ba),e(ba,Ci),e(Uo,Ei),e(A,Ai),e(A,Ho),e(Ho,Ni),e(Ho,Go),e(Go,Oi),e(Ho,Di),e(A,qi),e(A,pe),e(pe,Li),e(pe,ka),e(ka,ji),e(pe,Wi),e(pe,Fa),e(Fa,Si),e(pe,Ri),e(A,Bi),F(Be,A,null),u(o,In,g),u(o,fe,g),e(fe,Ve),e(Ve,ur),F(Yo,ur,null),e(fe,Vi),e(fe,_r),e(_r,Ui),u(o,Mn,g),u(o,N,g),F(Zo,N,null),e(N,Hi),e(N,Jo),e(Jo,Gi),e(Jo,ya),e(ya,Yi),e(Jo,Zi),e(N,Ji),e(N,Ko),e(Ko,Ki),e(Ko,Xo),e(Xo,Xi),e(Ko,Qi),e(N,el),e(N,ge),e(ge,ol),e(ge,xa),e(xa,tl),e(ge,al),e(ge,Ta),e(Ta,rl),e(ge,nl),e(N,sl),F(Ue,N,null),u(o,Pn,g),u(o,he,g),e(he,He),e(He,vr),F(Qo,vr,null),e(he,il),e(he,br),e(br,ll),u(o,Cn,g),u(o,O,g),F(et,O,null),e(O,dl),e(O,ot),e(ot,cl),e(ot,$a),e($a,ml),e(ot,pl),e(O,fl),e(O,tt),e(tt,gl),e(tt,at),e(at,hl),e(tt,ul),e(O,_l),e(O,ue),e(ue,vl),e(ue,wa),e(wa,bl),e(ue,kl),e(ue,za),e(za,Fl),e(ue,yl),e(O,xl),F(Ge,O,null),u(o,En,g),u(o,_e,g),e(_e,Ye),e(Ye,kr),F(rt,kr,null),e(_e,Tl),e(_e,Fr),e(Fr,$l),u(o,An,g),u(o,nt,g),F(st,nt,null),u(o,Nn,g),u(o,ve,g),e(ve,Ze),e(Ze,yr),F(it,yr,null),e(ve,wl),e(ve,xr),e(xr,zl),u(o,On,g),u(o,D,g),F(lt,D,null),e(D,Il),e(D,Tr),e(Tr,Ml),e(D,Pl),e(D,L),e(L,Ia),e(Ia,Cl),e(L,El),e(L,Ma),e(Ma,Al),e(L,Nl),e(L,Pa),e(Pa,Ol),e(L,Dl),e(L,$r),e($r,ql),e(L,Ll),e(L,Ca),e(Ca,jl),e(L,Wl),e(D,Sl),e(D,Je),F(dt,Je,null),e(Je,Rl),e(Je,ct),e(ct,Bl),e(ct,Ea),e(Ea,Vl),e(ct,Ul),e(D,Hl),e(D,Ke),F(mt,Ke,null),e(Ke,Gl),e(Ke,pt),e(pt,Yl),e(pt,Aa),e(Aa,Zl),e(pt,Jl),u(o,Dn,g),u(o,be,g),e(be,Xe),e(Xe,wr),F(ft,wr,null),e(be,Kl),e(be,zr),e(zr,Xl),u(o,qn,g),u(o,M,g),F(gt,M,null),e(M,Ql),e(M,Ir),e(Ir,ed),e(M,od),e(M,Qe),F(ht,Qe,null),e(Qe,td),e(Qe,ke),e(ke,ad),e(ke,Mr),e(Mr,rd),e(ke,nd),e(ke,Pr),e(Pr,sd),e(ke,id),e(M,ld),e(M,eo),F(ut,eo,null),e(eo,dd),e(eo,Cr),e(Cr,cd),e(M,md),e(M,oo),F(_t,oo,null),e(oo,pd),e(oo,Er),e(Er,fd),e(M,gd),e(M,to),F(vt,to,null),e(to,hd),e(to,Ar),e(Ar,ud),e(M,_d),e(M,ao),F(bt,ao,null),e(ao,vd),e(ao,kt),e(kt,bd),e(kt,Nr),e(Nr,kd),e(kt,Fd),u(o,Ln,g),u(o,Fe,g),e(Fe,ro),e(ro,Or),F(Ft,Or,null),e(Fe,yd),e(Fe,Dr),e(Dr,xd),u(o,jn,g),u(o,G,g),F(yt,G,null),e(G,Td),e(G,qr),e(qr,$d),e(G,wd),e(G,no),F(xt,no,null),e(no,zd),e(no,Lr),e(Lr,Id),u(o,Wn,g),u(o,ye,g),e(ye,so),e(so,jr),F(Tt,jr,null),e(ye,Md),e(ye,Wr),e(Wr,Pd),u(o,Sn,g),u(o,W,g),F($t,W,null),e(W,Cd),e(W,Sr),e(Sr,Ed),e(W,Ad),e(W,wt),e(wt,Nd),e(wt,zt),e(zt,Od),e(wt,Dd),e(W,qd),e(W,ee),F(It,ee,null),e(ee,Ld),e(ee,xe),e(xe,jd),e(xe,Na),e(Na,Wd),e(xe,Sd),e(xe,Rr),e(Rr,Rd),e(xe,Bd),e(ee,Vd),F(io,ee,null),u(o,Rn,g),u(o,Te,g),e(Te,lo),e(lo,Br),F(Mt,Br,null),e(Te,Ud),e(Te,Vr),e(Vr,Hd),u(o,Bn,g),u(o,q,g),F(Pt,q,null),e(q,Gd),e(q,Ct),e(Ct,Yd),e(Ct,Et),e(Et,Zd),e(Ct,Jd),e(q,Kd),e(q,S),F(At,S,null),e(S,Xd),e(S,$e),e($e,Qd),e($e,Oa),e(Oa,ec),e($e,oc),e($e,Ur),e(Ur,tc),e($e,ac),e(S,rc),F(co,S,null),e(S,nc),F(mo,S,null),e(q,sc),e(q,oe),F(Nt,oe,null),e(oe,ic),e(oe,we),e(we,lc),e(we,Da),e(Da,dc),e(we,cc),e(we,Hr),e(Hr,mc),e(we,pc),e(oe,fc),F(po,oe,null),e(q,gc),e(q,te),F(Ot,te,null),e(te,hc),e(te,ze),e(ze,uc),e(ze,qa),e(qa,_c),e(ze,vc),e(ze,Gr),e(Gr,bc),e(ze,kc),e(te,Fc),F(fo,te,null),u(o,Vn,g),u(o,Ie,g),e(Ie,go),e(go,Yr),F(Dt,Yr,null),e(Ie,yc),e(Ie,Zr),e(Zr,xc),u(o,Un,g),u(o,C,g),F(qt,C,null),e(C,Tc),e(C,Lt),e(Lt,$c),e(Lt,Jr),e(Jr,wc),e(Lt,zc),e(C,Ic),e(C,jt),e(jt,Mc),e(jt,Wt),e(Wt,Pc),e(jt,Cc),e(C,Ec),e(C,La),F(St,La,null),e(C,Ac),e(C,ja),F(Rt,ja,null),e(C,Nc),e(C,Wa),F(Bt,Wa,null),u(o,Hn,g),u(o,Me,g),e(Me,ho),e(ho,Kr),F(Vt,Kr,null),e(Me,Oc),e(Me,Xr),e(Xr,Dc),u(o,Gn,g),u(o,Y,g),F(Ut,Y,null),e(Y,qc),e(Y,Ht),e(Ht,Lc),e(Ht,Gt),e(Gt,jc),e(Ht,Wc),e(Y,Sc),e(Y,R),F(Yt,R,null),e(R,Rc),e(R,Pe),e(Pe,Bc),e(Pe,Sa),e(Sa,Vc),e(Pe,Uc),e(Pe,Qr),e(Qr,Hc),e(Pe,Gc),e(R,Yc),F(uo,R,null),e(R,Zc),F(_o,R,null),u(o,Yn,g),u(o,Ce,g),e(Ce,vo),e(vo,en),F(Zt,en,null),e(Ce,Jc),e(Ce,on),e(on,Kc),u(o,Zn,g),u(o,Z,g),F(Jt,Z,null),e(Z,Xc),e(Z,Kt),e(Kt,Qc),e(Kt,Xt),e(Xt,em),e(Kt,om),e(Z,tm),e(Z,B),F(Qt,B,null),e(B,am),e(B,Ee),e(Ee,rm),e(Ee,Ra),e(Ra,nm),e(Ee,sm),e(Ee,tn),e(tn,im),e(Ee,lm),e(B,dm),F(bo,B,null),e(B,cm),F(ko,B,null),u(o,Jn,g),u(o,Ae,g),e(Ae,Fo),e(Fo,an),F(ea,an,null),e(Ae,mm),e(Ae,rn),e(rn,pm),u(o,Kn,g),u(o,J,g),F(oa,J,null),e(J,fm),e(J,ta),e(ta,gm),e(ta,aa),e(aa,hm),e(ta,um),e(J,_m),e(J,V),F(ra,V,null),e(V,vm),e(V,Ne),e(Ne,bm),e(Ne,Ba),e(Ba,km),e(Ne,Fm),e(Ne,nn),e(nn,ym),e(Ne,xm),e(V,Tm),F(yo,V,null),e(V,$m),F(xo,V,null),Xn=!0},p(o,[g]){const na={};g&2&&(na.$$scope={dirty:g,ctx:o}),je.$set(na);const sn={};g&2&&(sn.$$scope={dirty:g,ctx:o}),Be.$set(sn);const ln={};g&2&&(ln.$$scope={dirty:g,ctx:o}),Ue.$set(ln);const dn={};g&2&&(dn.$$scope={dirty:g,ctx:o}),Ge.$set(dn);const sa={};g&2&&(sa.$$scope={dirty:g,ctx:o}),io.$set(sa);const cn={};g&2&&(cn.$$scope={dirty:g,ctx:o}),co.$set(cn);const mn={};g&2&&(mn.$$scope={dirty:g,ctx:o}),mo.$set(mn);const pn={};g&2&&(pn.$$scope={dirty:g,ctx:o}),po.$set(pn);const ia={};g&2&&(ia.$$scope={dirty:g,ctx:o}),fo.$set(ia);const fn={};g&2&&(fn.$$scope={dirty:g,ctx:o}),uo.$set(fn);const gn={};g&2&&(gn.$$scope={dirty:g,ctx:o}),_o.$set(gn);const hn={};g&2&&(hn.$$scope={dirty:g,ctx:o}),bo.$set(hn);const un={};g&2&&(un.$$scope={dirty:g,ctx:o}),ko.$set(un);const _n={};g&2&&(_n.$$scope={dirty:g,ctx:o}),yo.$set(_n);const Oe={};g&2&&(Oe.$$scope={dirty:g,ctx:o}),xo.$set(Oe)},i(o){Xn||(y(l.$$.fragment,o),y(Eo.$$.fragment,o),y(Do.$$.fragment,o),y(qo.$$.fragment,o),y(je.$$.fragment,o),y(jo.$$.fragment,o),y(So.$$.fragment,o),y(Bo.$$.fragment,o),y(Vo.$$.fragment,o),y(Be.$$.fragment,o),y(Yo.$$.fragment,o),y(Zo.$$.fragment,o),y(Ue.$$.fragment,o),y(Qo.$$.fragment,o),y(et.$$.fragment,o),y(Ge.$$.fragment,o),y(rt.$$.fragment,o),y(st.$$.fragment,o),y(it.$$.fragment,o),y(lt.$$.fragment,o),y(dt.$$.fragment,o),y(mt.$$.fragment,o),y(ft.$$.fragment,o),y(gt.$$.fragment,o),y(ht.$$.fragment,o),y(ut.$$.fragment,o),y(_t.$$.fragment,o),y(vt.$$.fragment,o),y(bt.$$.fragment,o),y(Ft.$$.fragment,o),y(yt.$$.fragment,o),y(xt.$$.fragment,o),y(Tt.$$.fragment,o),y($t.$$.fragment,o),y(It.$$.fragment,o),y(io.$$.fragment,o),y(Mt.$$.fragment,o),y(Pt.$$.fragment,o),y(At.$$.fragment,o),y(co.$$.fragment,o),y(mo.$$.fragment,o),y(Nt.$$.fragment,o),y(po.$$.fragment,o),y(Ot.$$.fragment,o),y(fo.$$.fragment,o),y(Dt.$$.fragment,o),y(qt.$$.fragment,o),y(St.$$.fragment,o),y(Rt.$$.fragment,o),y(Bt.$$.fragment,o),y(Vt.$$.fragment,o),y(Ut.$$.fragment,o),y(Yt.$$.fragment,o),y(uo.$$.fragment,o),y(_o.$$.fragment,o),y(Zt.$$.fragment,o),y(Jt.$$.fragment,o),y(Qt.$$.fragment,o),y(bo.$$.fragment,o),y(ko.$$.fragment,o),y(ea.$$.fragment,o),y(oa.$$.fragment,o),y(ra.$$.fragment,o),y(yo.$$.fragment,o),y(xo.$$.fragment,o),Xn=!0)},o(o){x(l.$$.fragment,o),x(Eo.$$.fragment,o),x(Do.$$.fragment,o),x(qo.$$.fragment,o),x(je.$$.fragment,o),x(jo.$$.fragment,o),x(So.$$.fragment,o),x(Bo.$$.fragment,o),x(Vo.$$.fragment,o),x(Be.$$.fragment,o),x(Yo.$$.fragment,o),x(Zo.$$.fragment,o),x(Ue.$$.fragment,o),x(Qo.$$.fragment,o),x(et.$$.fragment,o),x(Ge.$$.fragment,o),x(rt.$$.fragment,o),x(st.$$.fragment,o),x(it.$$.fragment,o),x(lt.$$.fragment,o),x(dt.$$.fragment,o),x(mt.$$.fragment,o),x(ft.$$.fragment,o),x(gt.$$.fragment,o),x(ht.$$.fragment,o),x(ut.$$.fragment,o),x(_t.$$.fragment,o),x(vt.$$.fragment,o),x(bt.$$.fragment,o),x(Ft.$$.fragment,o),x(yt.$$.fragment,o),x(xt.$$.fragment,o),x(Tt.$$.fragment,o),x($t.$$.fragment,o),x(It.$$.fragment,o),x(io.$$.fragment,o),x(Mt.$$.fragment,o),x(Pt.$$.fragment,o),x(At.$$.fragment,o),x(co.$$.fragment,o),x(mo.$$.fragment,o),x(Nt.$$.fragment,o),x(po.$$.fragment,o),x(Ot.$$.fragment,o),x(fo.$$.fragment,o),x(Dt.$$.fragment,o),x(qt.$$.fragment,o),x(St.$$.fragment,o),x(Rt.$$.fragment,o),x(Bt.$$.fragment,o),x(Vt.$$.fragment,o),x(Ut.$$.fragment,o),x(Yt.$$.fragment,o),x(uo.$$.fragment,o),x(_o.$$.fragment,o),x(Zt.$$.fragment,o),x(Jt.$$.fragment,o),x(Qt.$$.fragment,o),x(bo.$$.fragment,o),x(ko.$$.fragment,o),x(ea.$$.fragment,o),x(oa.$$.fragment,o),x(ra.$$.fragment,o),x(yo.$$.fragment,o),x(xo.$$.fragment,o),Xn=!1},d(o){t(p),o&&t($),o&&t(_),T(l),o&&t(vn),o&&t(le),T(Eo),o&&t(bn),o&&t(qe),o&&t(kn),o&&t(ca),o&&t(Fn),o&&t(ma),o&&t(yn),o&&t(pa),o&&t(xn),o&&t(X),o&&t(Tn),o&&t(de),T(Do),o&&t($n),o&&t(P),T(qo),T(je),T(jo),T(So),o&&t(wn),o&&t(me),T(Bo),o&&t(zn),o&&t(A),T(Vo),T(Be),o&&t(In),o&&t(fe),T(Yo),o&&t(Mn),o&&t(N),T(Zo),T(Ue),o&&t(Pn),o&&t(he),T(Qo),o&&t(Cn),o&&t(O),T(et),T(Ge),o&&t(En),o&&t(_e),T(rt),o&&t(An),o&&t(nt),T(st),o&&t(Nn),o&&t(ve),T(it),o&&t(On),o&&t(D),T(lt),T(dt),T(mt),o&&t(Dn),o&&t(be),T(ft),o&&t(qn),o&&t(M),T(gt),T(ht),T(ut),T(_t),T(vt),T(bt),o&&t(Ln),o&&t(Fe),T(Ft),o&&t(jn),o&&t(G),T(yt),T(xt),o&&t(Wn),o&&t(ye),T(Tt),o&&t(Sn),o&&t(W),T($t),T(It),T(io),o&&t(Rn),o&&t(Te),T(Mt),o&&t(Bn),o&&t(q),T(Pt),T(At),T(co),T(mo),T(Nt),T(po),T(Ot),T(fo),o&&t(Vn),o&&t(Ie),T(Dt),o&&t(Un),o&&t(C),T(qt),T(St),T(Rt),T(Bt),o&&t(Hn),o&&t(Me),T(Vt),o&&t(Gn),o&&t(Y),T(Ut),T(Yt),T(uo),T(_o),o&&t(Yn),o&&t(Ce),T(Zt),o&&t(Zn),o&&t(Z),T(Jt),T(Qt),T(bo),T(ko),o&&t(Jn),o&&t(Ae),T(ea),o&&t(Kn),o&&t(J),T(oa),T(ra),T(yo),T(xo)}}}const Hf={local:"flava",sections:[{local:"overview",title:"Overview"},{local:"transformers.FlavaConfig",title:"FlavaConfig"},{local:"transformers.FlavaTextConfig",title:"FlavaTextConfig"},{local:"transformers.FlavaImageConfig",title:"FlavaImageConfig"},{local:"transformers.FlavaMultimodalConfig",title:"FlavaMultimodalConfig"},{local:"transformers.FlavaImageCodebookConfig",title:"FlavaImageCodebookConfig"},{local:"transformers.FlavaProcessor",title:"FlavaProcessor"},{local:"transformers.FlavaImageProcessor",title:"FlavaFeatureExtractor"},{local:"transformers.FlavaImageProcessor",title:"FlavaImageProcessor"},{local:"transformers.FlavaForPreTraining",title:"FlavaForPreTraining"},{local:"transformers.FlavaModel",title:"FlavaModel"},{local:"transformers.FlavaImageCodebook",title:"FlavaImageCodebook"},{local:"transformers.FlavaTextModel",title:"FlavaTextModel"},{local:"transformers.FlavaImageModel",title:"FlavaImageModel"},{local:"transformers.FlavaMultimodalModel",title:"FlavaMultimodalModel"}],title:"FLAVA"};function Gf(z){return Mf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class eg extends $f{constructor(p){super();wf(this,p,Gf,Uf,zf,{})}}export{eg as default,Hf as metadata};
