import{S as Fp,i as Tp,s as wp,e as a,k as m,w as b,t as s,M as Mp,c as n,d as t,m as p,a as r,x as y,h as l,b as d,G as e,g as u,y as k,q as F,o as T,B as w,v as $p,L as Fo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Yt}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as To}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as P}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xp($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhQ29uZmlnJTJDJTIwRmxhdmFNb2RlbCUyQyUyMEZsYXZhRm9yUHJlVHJhaW5pbmclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFDb25maWclMjB3aXRoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEZsYXZhQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFNb2RlbCUyMGFuZCUyMEZsYXZhRm9yUHJlVHJhaW5pbmclMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBGbGF2YU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBbW9kZWxfcHJlJTIwJTNEJTIwRmxhdmFGb3JQcmVUcmFpbmluZyhjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWclMEFjb25maWd1cmF0aW9uX3ByZSUyMCUzRCUyMG1vZGVsX3ByZS5jb25maWc=",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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Ip($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhVGV4dENvbmZpZyUyQyUyMEZsYXZhVGV4dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEZsYXZhVGV4dE1vZGVsJTIwd2l0aCUyMCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGbGF2YVRleHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBGbGF2YVRleHRNb2RlbCUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEZsYXZhVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function zp($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhSW1hZ2VDb25maWclMkMlMjBGbGF2YUltYWdlTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFJbWFnZU1vZGVsJTIwd2l0aCUyMCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGbGF2YUltYWdlQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFJbWFnZU1vZGVsJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRmxhdmFJbWFnZU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Cp($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhTXVsdGltb2RhbENvbmZpZyUyQyUyMEZsYXZhTXVsdGltb2RhbE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEZsYXZhTXVsdGltb2RhbE1vZGVsJTIwd2l0aCUyMCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGbGF2YU11bHRpbW9kYWxDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBGbGF2YU11bHRpbW9kYWxNb2RlbCUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEZsYXZhTXVsdGltb2RhbE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Pp($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function Ep($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function Ap($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXZhTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXZhTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZmxhdmEtZnVsbCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmZsYXZhLWZ1bGwlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTVEJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmNvbnRyYXN0aXZlX2xvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, 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 = AutoProcessor.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(){c=a("p"),M=s("Examples:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Examples:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Wp($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function jp($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function Up($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function Np($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF2YVRleHRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZmbGF2YS1mdWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxhdmFUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZmxhdmEtZnVsbCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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 = AutoTokenizer.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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Zp($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function Jp($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXZhSW1hZ2VNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZmbGF2YS1mdWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxhdmFJbWFnZU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmZsYXZhLWZ1bGwlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, 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>image_processor = AutoImageProcessor.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 = image_processor(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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Vp($){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=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(i){c=n(i,"P",{});var f=r(c);M=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=l(I,"Module"),I.forEach(t),v=l(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(i,f){u(i,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(i){i&&t(c)}}}function Bp($){let c,M,_,g,v;return g=new To({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF2YU11bHRpbW9kYWxNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZmbGF2YS1mdWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxhdmFNdWx0aW1vZGFsTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZmxhdmEtZnVsbCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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 = AutoTokenizer.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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(i){c=n(i,"P",{});var f=r(c);M=l(f,"Example:"),f.forEach(t),_=p(i),y(g.$$.fragment,i)},m(i,f){u(i,c,f),e(c,M),u(i,_,f),k(g,i,f),v=!0},p:Fo,i(i){v||(F(g.$$.fragment,i),v=!0)},o(i){T(g.$$.fragment,i),v=!1},d(i){i&&t(c),i&&t(_),w(g,i)}}}function Rp($){let c,M,_,g,v,i,f,I,hs,Hn,se,Ae,Xa,wo,gs,Ya,us,Qn,We,_s,Mo,vs,bs,Kn,Ht,ys,er,Qt,ks,or,Kt,Ha,Fs,tr,Y,Ts,$o,ws,Ms,xo,$s,xs,ar,le,je,Qa,Io,Is,Ka,zs,nr,z,zo,Cs,H,ea,Ps,Es,oa,As,Ws,Co,js,Us,Ns,ie,Zs,ta,Js,Vs,aa,Bs,Rs,Gs,Ue,qs,Ne,Po,Ss,Eo,Ls,na,Os,Ds,Xs,Ze,Ao,Ys,Wo,Hs,ra,Qs,Ks,rr,de,Je,en,jo,el,on,ol,sr,E,Uo,tl,No,al,sa,nl,rl,sl,Zo,ll,Jo,il,dl,cl,ce,ml,la,pl,fl,ia,hl,gl,ul,Ve,lr,me,Be,tn,Vo,_l,an,vl,ir,A,Bo,bl,Ro,yl,da,kl,Fl,Tl,Go,wl,qo,Ml,$l,xl,pe,Il,ca,zl,Cl,ma,Pl,El,Al,Re,dr,fe,Ge,nn,So,Wl,rn,jl,cr,W,Lo,Ul,Oo,Nl,pa,Zl,Jl,Vl,Do,Bl,Xo,Rl,Gl,ql,he,Sl,fa,Ll,Ol,ha,Dl,Xl,Yl,qe,mr,ge,Se,sn,Yo,Hl,ln,Ql,pr,Ho,Qo,fr,ue,Le,dn,Ko,Kl,cn,ei,hr,j,et,oi,mn,ti,ai,N,ga,ni,ri,ua,si,li,_a,ii,di,pn,ci,mi,va,pi,fi,hi,Oe,ot,gi,tt,ui,ba,_i,vi,bi,De,at,yi,nt,ki,ya,Fi,Ti,gr,_e,Xe,fn,rt,wi,hn,Mi,ur,st,lt,_r,ve,Ye,gn,it,$i,un,xi,vr,S,dt,Ii,_n,zi,Ci,He,ct,Pi,vn,Ei,br,be,Qe,bn,mt,Ai,yn,Wi,yr,Z,pt,ji,kn,Ui,Ni,ft,Zi,ht,Ji,Vi,Bi,Q,gt,Ri,ye,Gi,ka,qi,Si,Fn,Li,Oi,Di,Ke,kr,ke,eo,Tn,ut,Xi,wn,Yi,Fr,U,_t,Hi,vt,Qi,bt,Ki,ed,od,J,yt,td,Fe,ad,Fa,nd,rd,Mn,sd,ld,id,oo,dd,to,cd,K,kt,md,Te,pd,Ta,fd,hd,$n,gd,ud,_d,ao,vd,ee,Ft,bd,we,yd,wa,kd,Fd,xn,Td,wd,Md,no,Tr,Me,ro,In,Tt,$d,zn,xd,wr,C,wt,Id,Mt,zd,Cn,Cd,Pd,Ed,$t,Ad,xt,Wd,jd,Ud,Ma,It,Nd,$a,zt,Zd,xa,Ct,Mr,$e,so,Pn,Pt,Jd,En,Vd,$r,L,Et,Bd,At,Rd,Wt,Gd,qd,Sd,V,jt,Ld,xe,Od,Ia,Dd,Xd,An,Yd,Hd,Qd,lo,Kd,io,xr,Ie,co,Wn,Ut,ec,jn,oc,Ir,O,Nt,tc,Zt,ac,Jt,nc,rc,sc,B,Vt,lc,ze,ic,za,dc,cc,Un,mc,pc,fc,mo,hc,po,zr,Ce,fo,Nn,Bt,gc,Zn,uc,Cr,D,Rt,_c,Gt,vc,qt,bc,yc,kc,R,St,Fc,Pe,Tc,Ca,wc,Mc,Jn,$c,xc,Ic,ho,zc,go,Pr;return i=new P({}),wo=new P({}),Io=new P({}),zo=new x({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.30.0/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.30.0/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.30.0/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.30.0/src/transformers/models/flava/configuration_flava.py#L460"}}),Ue=new ko({props:{anchor:"transformers.FlavaConfig.example",$$slots:{default:[xp]},$$scope:{ctx:$}}}),Po=new x({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.30.0/src/transformers/models/flava/configuration_flava.py#L735",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaConfig"
>FlavaConfig</a></p>
`}}),Ao=new x({props:{name:"to_dict",anchor:"transformers.FlavaConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/flava/configuration_flava.py#L760",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),jo=new P({}),Uo=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/configuration_flava.py#L149"}}),Ve=new ko({props:{anchor:"transformers.FlavaTextConfig.example",$$slots:{default:[Ip]},$$scope:{ctx:$}}}),Vo=new P({}),Bo=new x({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.30.0/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a> used in conjunction with <a href="/docs/transformers/v4.30.0/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.30.0/src/transformers/models/flava/configuration_flava.py#L32"}}),Re=new ko({props:{anchor:"transformers.FlavaImageConfig.example",$$slots:{default:[zp]},$$scope:{ctx:$}}}),So=new P({}),Lo=new x({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.30.0/src/transformers/models/flava/configuration_flava.py#L276"}}),qe=new ko({props:{anchor:"transformers.FlavaMultimodalConfig.example",$$slots:{default:[Cp]},$$scope:{ctx:$}}}),Yo=new P({}),Qo=new x({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.30.0/src/transformers/models/flava/configuration_flava.py#L377"}}),Ko=new P({}),et=new x({props:{name:"class transformers.FlavaProcessor",anchor:"transformers.FlavaProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaProcessor.image_processor",description:'<strong>image_processor</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaImageProcessor</a>) &#x2014; The image processor is a required input.',name:"image_processor"},{anchor:"transformers.FlavaProcessor.tokenizer",description:'<strong>tokenizer</strong> (<a href="/docs/transformers/v4.30.0/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.30.0/src/transformers/models/flava/processing_flava.py#L28"}}),ot=new x({props:{name:"batch_decode",anchor:"transformers.FlavaProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/flava/processing_flava.py#L129"}}),at=new x({props:{name:"decode",anchor:"transformers.FlavaProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/flava/processing_flava.py#L136"}}),rt=new P({}),lt=new x({props:{name:"class transformers.FlavaFeatureExtractor",anchor:"transformers.FlavaFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/flava/feature_extraction_flava.py#L26"}}),it=new P({}),dt=new x({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.30.0/src/transformers/models/flava/image_processing_flava.py#L133"}}),ct=new x({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.30.0/src/transformers/models/flava/image_processing_flava.py#L480"}}),mt=new P({}),pt=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1725"}}),gt=new x({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> along with
<code>DataCollatorForMaskedLanguageModeling</code>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">FlavaImageProcessor.<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.30.0/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a>. See <a href="/docs/transformers/v4.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1769",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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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>
`}}),Ke=new Yt({props:{$$slots:{default:[Pp]},$$scope:{ctx:$}}}),ut=new P({}),_t=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1191"}}),yt=new x({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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">FlavaImageProcessor.<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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1335",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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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.30.0/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>
`}}),oo=new Yt({props:{$$slots:{default:[Ep]},$$scope:{ctx:$}}}),to=new ko({props:{anchor:"transformers.FlavaModel.forward.example",$$slots:{default:[Ap]},$$scope:{ctx:$}}}),kt=new x({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1237"}}),ao=new Yt({props:{$$slots:{default:[Wp]},$$scope:{ctx:$}}}),Ft=new x({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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">FlavaImageProcessor.<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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1283"}}),no=new Yt({props:{$$slots:{default:[jp]},$$scope:{ctx:$}}}),Tt=new P({}),wt=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1509"}}),It=new x({props:{name:"forward",anchor:"transformers.FlavaImageCodebook.forward",parameters:[{name:"pixel_values",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/flava/modeling_flava.py#L1593"}}),zt=new x({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.30.0/src/transformers/models/flava/modeling_flava.py#L1559"}}),Ct=new x({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.30.0/src/transformers/models/flava/modeling_flava.py#L1589"}}),Pt=new P({}),Et=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L988"}}),jt=new x({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1019",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lo=new Yt({props:{$$slots:{default:[Up]},$$scope:{ctx:$}}}),io=new ko({props:{anchor:"transformers.FlavaTextModel.forward.example",$$slots:{default:[Np]},$$scope:{ctx:$}}}),Ut=new P({}),Nt=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L889"}}),Vt=new x({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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">FlavaImageProcessor.<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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L922",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mo=new Yt({props:{$$slots:{default:[Zp]},$$scope:{ctx:$}}}),po=new ko({props:{anchor:"transformers.FlavaImageModel.forward.example",$$slots:{default:[Jp]},$$scope:{ctx:$}}}),Bt=new P({}),Rt=new x({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.30.0/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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1093"}}),St=new x({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.30.0/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.30.0/src/transformers/models/flava/modeling_flava.py#L1121",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ho=new Yt({props:{$$slots:{default:[Vp]},$$scope:{ctx:$}}}),go=new ko({props:{anchor:"transformers.FlavaMultimodalModel.forward.example",$$slots:{default:[Bp]},$$scope:{ctx:$}}}),{c(){c=a("meta"),M=m(),_=a("h1"),g=a("a"),v=a("span"),b(i.$$.fragment),f=m(),I=a("span"),hs=s("FLAVA"),Hn=m(),se=a("h2"),Ae=a("a"),Xa=a("span"),b(wo.$$.fragment),gs=m(),Ya=a("span"),us=s("Overview"),Qn=m(),We=a("p"),_s=s("The FLAVA model was proposed in "),Mo=a("a"),vs=s("FLAVA: A Foundational Language And Vision Alignment Model"),bs=s(" by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022."),Kn=m(),Ht=a("p"),ys=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.`),er=m(),Qt=a("p"),ks=s("The abstract from the paper is the following:"),or=m(),Kt=a("p"),Ha=a("em"),Fs=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.`),tr=m(),Y=a("p"),Ts=s("This model was contributed by "),$o=a("a"),ws=s("aps"),Ms=s(". The original code can be found "),xo=a("a"),$s=s("here"),xs=s("."),ar=m(),le=a("h2"),je=a("a"),Qa=a("span"),b(Io.$$.fragment),Is=m(),Ka=a("span"),zs=s("FlavaConfig"),nr=m(),z=a("div"),b(zo.$$.fragment),Cs=m(),H=a("p"),ea=a("a"),Ps=s("FlavaConfig"),Es=s(" is the configuration class to store the configuration of a "),oa=a("a"),As=s("FlavaModel"),Ws=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 `),Co=a("a"),js=s("facebook/flava-full"),Us=s(" architecture."),Ns=m(),ie=a("p"),Zs=s("Configuration objects inherit from "),ta=a("a"),Js=s("PretrainedConfig"),Vs=s(` and can be used to control the model outputs. Read the
documentation from `),aa=a("a"),Bs=s("PretrainedConfig"),Rs=s(" for more information."),Gs=m(),b(Ue.$$.fragment),qs=m(),Ne=a("div"),b(Po.$$.fragment),Ss=m(),Eo=a("p"),Ls=s("Instantiate a "),na=a("a"),Os=s("FlavaConfig"),Ds=s(` (or a derived class) from flava text model configuration, flava image model
configuration, flava multimodal model and flava codebook model configuration.`),Xs=m(),Ze=a("div"),b(Ao.$$.fragment),Ys=m(),Wo=a("p"),Hs=s("Serializes this instance to a Python dictionary. Override the default "),ra=a("a"),Qs=s("to_dict()"),Ks=s("."),rr=m(),de=a("h2"),Je=a("a"),en=a("span"),b(jo.$$.fragment),el=m(),on=a("span"),ol=s("FlavaTextConfig"),sr=m(),E=a("div"),b(Uo.$$.fragment),tl=m(),No=a("p"),al=s("This is the configuration class to store the configuration of a "),sa=a("a"),nl=s("FlavaTextModel"),rl=s(`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),sl=m(),Zo=a("p"),ll=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Jo=a("a"),il=s("facebook/flava-full"),dl=s(" architecture."),cl=m(),ce=a("p"),ml=s("Configuration objects inherit from "),la=a("a"),pl=s("PretrainedConfig"),fl=s(` and can be used to control the model outputs. Read the
documentation from `),ia=a("a"),hl=s("PretrainedConfig"),gl=s(" for more information."),ul=m(),b(Ve.$$.fragment),lr=m(),me=a("h2"),Be=a("a"),tn=a("span"),b(Vo.$$.fragment),_l=m(),an=a("span"),vl=s("FlavaImageConfig"),ir=m(),A=a("div"),b(Bo.$$.fragment),bl=m(),Ro=a("p"),yl=s("This is the configuration class to store the configuration of a "),da=a("a"),kl=s("FlavaImageModel"),Fl=s(`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Tl=m(),Go=a("p"),wl=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),qo=a("a"),Ml=s("facebook/flava-full"),$l=s(" architecture."),xl=m(),pe=a("p"),Il=s("Configuration objects inherit from "),ca=a("a"),zl=s("PretrainedConfig"),Cl=s(` and can be used to control the model outputs. Read the
documentation from `),ma=a("a"),Pl=s("PretrainedConfig"),El=s(" for more information."),Al=m(),b(Re.$$.fragment),dr=m(),fe=a("h2"),Ge=a("a"),nn=a("span"),b(So.$$.fragment),Wl=m(),rn=a("span"),jl=s("FlavaMultimodalConfig"),cr=m(),W=a("div"),b(Lo.$$.fragment),Ul=m(),Oo=a("p"),Nl=s("This is the configuration class to store the configuration of a "),pa=a("a"),Zl=s("FlavaMultimodalModel"),Jl=s(`. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.`),Vl=m(),Do=a("p"),Bl=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Xo=a("a"),Rl=s("facebook/flava-full"),Gl=s(" architecture."),ql=m(),he=a("p"),Sl=s("Configuration objects inherit from "),fa=a("a"),Ll=s("PretrainedConfig"),Ol=s(` and can be used to control the model outputs. Read the
documentation from `),ha=a("a"),Dl=s("PretrainedConfig"),Xl=s(" for more information."),Yl=m(),b(qe.$$.fragment),mr=m(),ge=a("h2"),Se=a("a"),sn=a("span"),b(Yo.$$.fragment),Hl=m(),ln=a("span"),Ql=s("FlavaImageCodebookConfig"),pr=m(),Ho=a("div"),b(Qo.$$.fragment),fr=m(),ue=a("h2"),Le=a("a"),dn=a("span"),b(Ko.$$.fragment),Kl=m(),cn=a("span"),ei=s("FlavaProcessor"),hr=m(),j=a("div"),b(et.$$.fragment),oi=m(),mn=a("p"),ti=s("Constructs a FLAVA processor which wraps a FLAVA image processor and a FLAVA tokenizer into a single processor."),ai=m(),N=a("p"),ga=a("a"),ni=s("FlavaProcessor"),ri=s(" offers all the functionalities of "),ua=a("a"),si=s("FlavaImageProcessor"),li=s(" and "),_a=a("a"),ii=s("BertTokenizerFast"),di=s(`. See the
`),pn=a("code"),ci=s("__call__()"),mi=s(" and "),va=a("a"),pi=s("decode()"),fi=s(" for more information."),hi=m(),Oe=a("div"),b(ot.$$.fragment),gi=m(),tt=a("p"),ui=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),ba=a("a"),_i=s("batch_decode()"),vi=s(`. Please
refer to the docstring of this method for more information.`),bi=m(),De=a("div"),b(at.$$.fragment),yi=m(),nt=a("p"),ki=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),ya=a("a"),Fi=s("decode()"),Ti=s(`. Please refer to
the docstring of this method for more information.`),gr=m(),_e=a("h2"),Xe=a("a"),fn=a("span"),b(rt.$$.fragment),wi=m(),hn=a("span"),Mi=s("FlavaFeatureExtractor"),ur=m(),st=a("div"),b(lt.$$.fragment),_r=m(),ve=a("h2"),Ye=a("a"),gn=a("span"),b(it.$$.fragment),$i=m(),un=a("span"),xi=s("FlavaImageProcessor"),vr=m(),S=a("div"),b(dt.$$.fragment),Ii=m(),_n=a("p"),zi=s("Constructs a Flava image processor."),Ci=m(),He=a("div"),b(ct.$$.fragment),Pi=m(),vn=a("p"),Ei=s("Preprocess an image or batch of images."),br=m(),be=a("h2"),Qe=a("a"),bn=a("span"),b(mt.$$.fragment),Ai=m(),yn=a("span"),Wi=s("FlavaForPreTraining"),yr=m(),Z=a("div"),b(pt.$$.fragment),ji=m(),kn=a("p"),Ui=s("The FLAVA model for pretraining which outputs losses, embeddings, logits and transformer outputs."),Ni=m(),ft=a("p"),Zi=s("This model is a PyTorch "),ht=a("a"),Ji=s("torch.nn.Module"),Vi=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bi=m(),Q=a("div"),b(gt.$$.fragment),Ri=m(),ye=a("p"),Gi=s("The "),ka=a("a"),qi=s("FlavaForPreTraining"),Si=s(" forward method, overrides the "),Fn=a("code"),Li=s("__call__"),Oi=s(" special method."),Di=m(),b(Ke.$$.fragment),kr=m(),ke=a("h2"),eo=a("a"),Tn=a("span"),b(ut.$$.fragment),Xi=m(),wn=a("span"),Yi=s("FlavaModel"),Fr=m(),U=a("div"),b(_t.$$.fragment),Hi=m(),vt=a("p"),Qi=s(`The bare FLAVA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),bt=a("a"),Ki=s("torch.nn.Module"),ed=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),od=m(),J=a("div"),b(yt.$$.fragment),td=m(),Fe=a("p"),ad=s("The "),Fa=a("a"),nd=s("FlavaModel"),rd=s(" forward method, overrides the "),Mn=a("code"),sd=s("__call__"),ld=s(" special method."),id=m(),b(oo.$$.fragment),dd=m(),b(to.$$.fragment),cd=m(),K=a("div"),b(kt.$$.fragment),md=m(),Te=a("p"),pd=s("The "),Ta=a("a"),fd=s("FlavaModel"),hd=s(" forward method, overrides the "),$n=a("code"),gd=s("__call__"),ud=s(" special method."),_d=m(),b(ao.$$.fragment),vd=m(),ee=a("div"),b(Ft.$$.fragment),bd=m(),we=a("p"),yd=s("The "),wa=a("a"),kd=s("FlavaModel"),Fd=s(" forward method, overrides the "),xn=a("code"),Td=s("__call__"),wd=s(" special method."),Md=m(),b(no.$$.fragment),Tr=m(),Me=a("h2"),ro=a("a"),In=a("span"),b(Tt.$$.fragment),$d=m(),zn=a("span"),xd=s("FlavaImageCodebook"),wr=m(),C=a("div"),b(wt.$$.fragment),Id=m(),Mt=a("p"),zd=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
`),Cn=a("code"),Cd=s("get_codebook_indices"),Pd=s(" to get image tokens for an image."),Ed=m(),$t=a("p"),Ad=s("This model is a PyTorch "),xt=a("a"),Wd=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.`),Ud=m(),Ma=a("div"),b(It.$$.fragment),Nd=m(),$a=a("div"),b(zt.$$.fragment),Zd=m(),xa=a("div"),b(Ct.$$.fragment),Mr=m(),$e=a("h2"),so=a("a"),Pn=a("span"),b(Pt.$$.fragment),Jd=m(),En=a("span"),Vd=s("FlavaTextModel"),$r=m(),L=a("div"),b(Et.$$.fragment),Bd=m(),At=a("p"),Rd=s(`The bare FLAVA Text Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Wt=a("a"),Gd=s("torch.nn.Module"),qd=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sd=m(),V=a("div"),b(jt.$$.fragment),Ld=m(),xe=a("p"),Od=s("The "),Ia=a("a"),Dd=s("FlavaTextModel"),Xd=s(" forward method, overrides the "),An=a("code"),Yd=s("__call__"),Hd=s(" special method."),Qd=m(),b(lo.$$.fragment),Kd=m(),b(io.$$.fragment),xr=m(),Ie=a("h2"),co=a("a"),Wn=a("span"),b(Ut.$$.fragment),ec=m(),jn=a("span"),oc=s("FlavaImageModel"),Ir=m(),O=a("div"),b(Nt.$$.fragment),tc=m(),Zt=a("p"),ac=s(`The bare FLAVA Image Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Jt=a("a"),nc=s("torch.nn.Module"),rc=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=m(),B=a("div"),b(Vt.$$.fragment),lc=m(),ze=a("p"),ic=s("The "),za=a("a"),dc=s("FlavaImageModel"),cc=s(" forward method, overrides the "),Un=a("code"),mc=s("__call__"),pc=s(" special method."),fc=m(),b(mo.$$.fragment),hc=m(),b(po.$$.fragment),zr=m(),Ce=a("h2"),fo=a("a"),Nn=a("span"),b(Bt.$$.fragment),gc=m(),Zn=a("span"),uc=s("FlavaMultimodalModel"),Cr=m(),D=a("div"),b(Rt.$$.fragment),_c=m(),Gt=a("p"),vc=s(`The bare FLAVA Multimodal Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),qt=a("a"),bc=s("torch.nn.Module"),yc=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),kc=m(),R=a("div"),b(St.$$.fragment),Fc=m(),Pe=a("p"),Tc=s("The "),Ca=a("a"),wc=s("FlavaMultimodalModel"),Mc=s(" forward method, overrides the "),Jn=a("code"),$c=s("__call__"),xc=s(" special method."),Ic=m(),b(ho.$$.fragment),zc=m(),b(go.$$.fragment),this.h()},l(o){const h=Mp('[data-svelte="svelte-1phssyn"]',document.head);c=n(h,"META",{name:!0,content:!0}),h.forEach(t),M=p(o),_=n(o,"H1",{class:!0});var Lt=r(_);g=n(Lt,"A",{id:!0,class:!0,href:!0});var Vn=r(g);v=n(Vn,"SPAN",{});var Bn=r(v);y(i.$$.fragment,Bn),Bn.forEach(t),Vn.forEach(t),f=p(Lt),I=n(Lt,"SPAN",{});var Rn=r(I);hs=l(Rn,"FLAVA"),Rn.forEach(t),Lt.forEach(t),Hn=p(o),se=n(o,"H2",{class:!0});var Ot=r(se);Ae=n(Ot,"A",{id:!0,class:!0,href:!0});var Gn=r(Ae);Xa=n(Gn,"SPAN",{});var qn=r(Xa);y(wo.$$.fragment,qn),qn.forEach(t),Gn.forEach(t),gs=p(Ot),Ya=n(Ot,"SPAN",{});var Sn=r(Ya);us=l(Sn,"Overview"),Sn.forEach(t),Ot.forEach(t),Qn=p(o),We=n(o,"P",{});var Dt=r(We);_s=l(Dt,"The FLAVA model was proposed in "),Mo=n(Dt,"A",{href:!0,rel:!0});var Ln=r(Mo);vs=l(Ln,"FLAVA: A Foundational Language And Vision Alignment Model"),Ln.forEach(t),bs=l(Dt," by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022."),Dt.forEach(t),Kn=p(o),Ht=n(o,"P",{});var On=r(Ht);ys=l(On,`The paper aims at creating a single unified foundation model which can work across vision, language
as well as vision-and-language multimodal tasks.`),On.forEach(t),er=p(o),Qt=n(o,"P",{});var Dn=r(Qt);ks=l(Dn,"The abstract from the paper is the following:"),Dn.forEach(t),or=p(o),Kt=n(o,"P",{});var Xn=r(Kt);Ha=n(Xn,"EM",{});var Yn=r(Ha);Fs=l(Yn,`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.`),Yn.forEach(t),Xn.forEach(t),tr=p(o),Y=n(o,"P",{});var Ee=r(Y);Ts=l(Ee,"This model was contributed by "),$o=n(Ee,"A",{href:!0,rel:!0});var Cc=r($o);ws=l(Cc,"aps"),Cc.forEach(t),Ms=l(Ee,". The original code can be found "),xo=n(Ee,"A",{href:!0,rel:!0});var Pc=r(xo);$s=l(Pc,"here"),Pc.forEach(t),xs=l(Ee,"."),Ee.forEach(t),ar=p(o),le=n(o,"H2",{class:!0});var Er=r(le);je=n(Er,"A",{id:!0,class:!0,href:!0});var Ec=r(je);Qa=n(Ec,"SPAN",{});var Ac=r(Qa);y(Io.$$.fragment,Ac),Ac.forEach(t),Ec.forEach(t),Is=p(Er),Ka=n(Er,"SPAN",{});var Wc=r(Ka);zs=l(Wc,"FlavaConfig"),Wc.forEach(t),Er.forEach(t),nr=p(o),z=n(o,"DIV",{class:!0});var G=r(z);y(zo.$$.fragment,G),Cs=p(G),H=n(G,"P",{});var Xt=r(H);ea=n(Xt,"A",{href:!0});var jc=r(ea);Ps=l(jc,"FlavaConfig"),jc.forEach(t),Es=l(Xt," is the configuration class to store the configuration of a "),oa=n(Xt,"A",{href:!0});var Uc=r(oa);As=l(Uc,"FlavaModel"),Uc.forEach(t),Ws=l(Xt,`. 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 `),Co=n(Xt,"A",{href:!0,rel:!0});var Nc=r(Co);js=l(Nc,"facebook/flava-full"),Nc.forEach(t),Us=l(Xt," architecture."),Xt.forEach(t),Ns=p(G),ie=n(G,"P",{});var Pa=r(ie);Zs=l(Pa,"Configuration objects inherit from "),ta=n(Pa,"A",{href:!0});var Zc=r(ta);Js=l(Zc,"PretrainedConfig"),Zc.forEach(t),Vs=l(Pa,` and can be used to control the model outputs. Read the
documentation from `),aa=n(Pa,"A",{href:!0});var Jc=r(aa);Bs=l(Jc,"PretrainedConfig"),Jc.forEach(t),Rs=l(Pa," for more information."),Pa.forEach(t),Gs=p(G),y(Ue.$$.fragment,G),qs=p(G),Ne=n(G,"DIV",{class:!0});var Ar=r(Ne);y(Po.$$.fragment,Ar),Ss=p(Ar),Eo=n(Ar,"P",{});var Wr=r(Eo);Ls=l(Wr,"Instantiate a "),na=n(Wr,"A",{href:!0});var Vc=r(na);Os=l(Vc,"FlavaConfig"),Vc.forEach(t),Ds=l(Wr,` (or a derived class) from flava text model configuration, flava image model
configuration, flava multimodal model and flava codebook model configuration.`),Wr.forEach(t),Ar.forEach(t),Xs=p(G),Ze=n(G,"DIV",{class:!0});var jr=r(Ze);y(Ao.$$.fragment,jr),Ys=p(jr),Wo=n(jr,"P",{});var Ur=r(Wo);Hs=l(Ur,"Serializes this instance to a Python dictionary. Override the default "),ra=n(Ur,"A",{href:!0});var Bc=r(ra);Qs=l(Bc,"to_dict()"),Bc.forEach(t),Ks=l(Ur,"."),Ur.forEach(t),jr.forEach(t),G.forEach(t),rr=p(o),de=n(o,"H2",{class:!0});var Nr=r(de);Je=n(Nr,"A",{id:!0,class:!0,href:!0});var Rc=r(Je);en=n(Rc,"SPAN",{});var Gc=r(en);y(jo.$$.fragment,Gc),Gc.forEach(t),Rc.forEach(t),el=p(Nr),on=n(Nr,"SPAN",{});var qc=r(on);ol=l(qc,"FlavaTextConfig"),qc.forEach(t),Nr.forEach(t),sr=p(o),E=n(o,"DIV",{class:!0});var oe=r(E);y(Uo.$$.fragment,oe),tl=p(oe),No=n(oe,"P",{});var Zr=r(No);al=l(Zr,"This is the configuration class to store the configuration of a "),sa=n(Zr,"A",{href:!0});var Sc=r(sa);nl=l(Sc,"FlavaTextModel"),Sc.forEach(t),rl=l(Zr,`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Zr.forEach(t),sl=p(oe),Zo=n(oe,"P",{});var Jr=r(Zo);ll=l(Jr,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Jo=n(Jr,"A",{href:!0,rel:!0});var Lc=r(Jo);il=l(Lc,"facebook/flava-full"),Lc.forEach(t),dl=l(Jr," architecture."),Jr.forEach(t),cl=p(oe),ce=n(oe,"P",{});var Ea=r(ce);ml=l(Ea,"Configuration objects inherit from "),la=n(Ea,"A",{href:!0});var Oc=r(la);pl=l(Oc,"PretrainedConfig"),Oc.forEach(t),fl=l(Ea,` and can be used to control the model outputs. Read the
documentation from `),ia=n(Ea,"A",{href:!0});var Dc=r(ia);hl=l(Dc,"PretrainedConfig"),Dc.forEach(t),gl=l(Ea," for more information."),Ea.forEach(t),ul=p(oe),y(Ve.$$.fragment,oe),oe.forEach(t),lr=p(o),me=n(o,"H2",{class:!0});var Vr=r(me);Be=n(Vr,"A",{id:!0,class:!0,href:!0});var Xc=r(Be);tn=n(Xc,"SPAN",{});var Yc=r(tn);y(Vo.$$.fragment,Yc),Yc.forEach(t),Xc.forEach(t),_l=p(Vr),an=n(Vr,"SPAN",{});var Hc=r(an);vl=l(Hc,"FlavaImageConfig"),Hc.forEach(t),Vr.forEach(t),ir=p(o),A=n(o,"DIV",{class:!0});var te=r(A);y(Bo.$$.fragment,te),bl=p(te),Ro=n(te,"P",{});var Br=r(Ro);yl=l(Br,"This is the configuration class to store the configuration of a "),da=n(Br,"A",{href:!0});var Qc=r(da);kl=l(Qc,"FlavaImageModel"),Qc.forEach(t),Fl=l(Br,`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Br.forEach(t),Tl=p(te),Go=n(te,"P",{});var Rr=r(Go);wl=l(Rr,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),qo=n(Rr,"A",{href:!0,rel:!0});var Kc=r(qo);Ml=l(Kc,"facebook/flava-full"),Kc.forEach(t),$l=l(Rr," architecture."),Rr.forEach(t),xl=p(te),pe=n(te,"P",{});var Aa=r(pe);Il=l(Aa,"Configuration objects inherit from "),ca=n(Aa,"A",{href:!0});var em=r(ca);zl=l(em,"PretrainedConfig"),em.forEach(t),Cl=l(Aa,` and can be used to control the model outputs. Read the
documentation from `),ma=n(Aa,"A",{href:!0});var om=r(ma);Pl=l(om,"PretrainedConfig"),om.forEach(t),El=l(Aa," for more information."),Aa.forEach(t),Al=p(te),y(Re.$$.fragment,te),te.forEach(t),dr=p(o),fe=n(o,"H2",{class:!0});var Gr=r(fe);Ge=n(Gr,"A",{id:!0,class:!0,href:!0});var tm=r(Ge);nn=n(tm,"SPAN",{});var am=r(nn);y(So.$$.fragment,am),am.forEach(t),tm.forEach(t),Wl=p(Gr),rn=n(Gr,"SPAN",{});var nm=r(rn);jl=l(nm,"FlavaMultimodalConfig"),nm.forEach(t),Gr.forEach(t),cr=p(o),W=n(o,"DIV",{class:!0});var ae=r(W);y(Lo.$$.fragment,ae),Ul=p(ae),Oo=n(ae,"P",{});var qr=r(Oo);Nl=l(qr,"This is the configuration class to store the configuration of a "),pa=n(qr,"A",{href:!0});var rm=r(pa);Zl=l(rm,"FlavaMultimodalModel"),rm.forEach(t),Jl=l(qr,`. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.`),qr.forEach(t),Vl=p(ae),Do=n(ae,"P",{});var Sr=r(Do);Bl=l(Sr,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Xo=n(Sr,"A",{href:!0,rel:!0});var sm=r(Xo);Rl=l(sm,"facebook/flava-full"),sm.forEach(t),Gl=l(Sr," architecture."),Sr.forEach(t),ql=p(ae),he=n(ae,"P",{});var Wa=r(he);Sl=l(Wa,"Configuration objects inherit from "),fa=n(Wa,"A",{href:!0});var lm=r(fa);Ll=l(lm,"PretrainedConfig"),lm.forEach(t),Ol=l(Wa,` and can be used to control the model outputs. Read the
documentation from `),ha=n(Wa,"A",{href:!0});var im=r(ha);Dl=l(im,"PretrainedConfig"),im.forEach(t),Xl=l(Wa," for more information."),Wa.forEach(t),Yl=p(ae),y(qe.$$.fragment,ae),ae.forEach(t),mr=p(o),ge=n(o,"H2",{class:!0});var Lr=r(ge);Se=n(Lr,"A",{id:!0,class:!0,href:!0});var dm=r(Se);sn=n(dm,"SPAN",{});var cm=r(sn);y(Yo.$$.fragment,cm),cm.forEach(t),dm.forEach(t),Hl=p(Lr),ln=n(Lr,"SPAN",{});var mm=r(ln);Ql=l(mm,"FlavaImageCodebookConfig"),mm.forEach(t),Lr.forEach(t),pr=p(o),Ho=n(o,"DIV",{class:!0});var pm=r(Ho);y(Qo.$$.fragment,pm),pm.forEach(t),fr=p(o),ue=n(o,"H2",{class:!0});var Or=r(ue);Le=n(Or,"A",{id:!0,class:!0,href:!0});var fm=r(Le);dn=n(fm,"SPAN",{});var hm=r(dn);y(Ko.$$.fragment,hm),hm.forEach(t),fm.forEach(t),Kl=p(Or),cn=n(Or,"SPAN",{});var gm=r(cn);ei=l(gm,"FlavaProcessor"),gm.forEach(t),Or.forEach(t),hr=p(o),j=n(o,"DIV",{class:!0});var ne=r(j);y(et.$$.fragment,ne),oi=p(ne),mn=n(ne,"P",{});var um=r(mn);ti=l(um,"Constructs a FLAVA processor which wraps a FLAVA image processor and a FLAVA tokenizer into a single processor."),um.forEach(t),ai=p(ne),N=n(ne,"P",{});var X=r(N);ga=n(X,"A",{href:!0});var _m=r(ga);ni=l(_m,"FlavaProcessor"),_m.forEach(t),ri=l(X," offers all the functionalities of "),ua=n(X,"A",{href:!0});var vm=r(ua);si=l(vm,"FlavaImageProcessor"),vm.forEach(t),li=l(X," and "),_a=n(X,"A",{href:!0});var bm=r(_a);ii=l(bm,"BertTokenizerFast"),bm.forEach(t),di=l(X,`. See the
`),pn=n(X,"CODE",{});var ym=r(pn);ci=l(ym,"__call__()"),ym.forEach(t),mi=l(X," and "),va=n(X,"A",{href:!0});var km=r(va);pi=l(km,"decode()"),km.forEach(t),fi=l(X," for more information."),X.forEach(t),hi=p(ne),Oe=n(ne,"DIV",{class:!0});var Dr=r(Oe);y(ot.$$.fragment,Dr),gi=p(Dr),tt=n(Dr,"P",{});var Xr=r(tt);ui=l(Xr,"This method forwards all its arguments to BertTokenizerFast\u2019s "),ba=n(Xr,"A",{href:!0});var Fm=r(ba);_i=l(Fm,"batch_decode()"),Fm.forEach(t),vi=l(Xr,`. Please
refer to the docstring of this method for more information.`),Xr.forEach(t),Dr.forEach(t),bi=p(ne),De=n(ne,"DIV",{class:!0});var Yr=r(De);y(at.$$.fragment,Yr),yi=p(Yr),nt=n(Yr,"P",{});var Hr=r(nt);ki=l(Hr,"This method forwards all its arguments to BertTokenizerFast\u2019s "),ya=n(Hr,"A",{href:!0});var Tm=r(ya);Fi=l(Tm,"decode()"),Tm.forEach(t),Ti=l(Hr,`. Please refer to
the docstring of this method for more information.`),Hr.forEach(t),Yr.forEach(t),ne.forEach(t),gr=p(o),_e=n(o,"H2",{class:!0});var Qr=r(_e);Xe=n(Qr,"A",{id:!0,class:!0,href:!0});var wm=r(Xe);fn=n(wm,"SPAN",{});var Mm=r(fn);y(rt.$$.fragment,Mm),Mm.forEach(t),wm.forEach(t),wi=p(Qr),hn=n(Qr,"SPAN",{});var $m=r(hn);Mi=l($m,"FlavaFeatureExtractor"),$m.forEach(t),Qr.forEach(t),ur=p(o),st=n(o,"DIV",{class:!0});var xm=r(st);y(lt.$$.fragment,xm),xm.forEach(t),_r=p(o),ve=n(o,"H2",{class:!0});var Kr=r(ve);Ye=n(Kr,"A",{id:!0,class:!0,href:!0});var Im=r(Ye);gn=n(Im,"SPAN",{});var zm=r(gn);y(it.$$.fragment,zm),zm.forEach(t),Im.forEach(t),$i=p(Kr),un=n(Kr,"SPAN",{});var Cm=r(un);xi=l(Cm,"FlavaImageProcessor"),Cm.forEach(t),Kr.forEach(t),vr=p(o),S=n(o,"DIV",{class:!0});var ja=r(S);y(dt.$$.fragment,ja),Ii=p(ja),_n=n(ja,"P",{});var Pm=r(_n);zi=l(Pm,"Constructs a Flava image processor."),Pm.forEach(t),Ci=p(ja),He=n(ja,"DIV",{class:!0});var es=r(He);y(ct.$$.fragment,es),Pi=p(es),vn=n(es,"P",{});var Em=r(vn);Ei=l(Em,"Preprocess an image or batch of images."),Em.forEach(t),es.forEach(t),ja.forEach(t),br=p(o),be=n(o,"H2",{class:!0});var os=r(be);Qe=n(os,"A",{id:!0,class:!0,href:!0});var Am=r(Qe);bn=n(Am,"SPAN",{});var Wm=r(bn);y(mt.$$.fragment,Wm),Wm.forEach(t),Am.forEach(t),Ai=p(os),yn=n(os,"SPAN",{});var jm=r(yn);Wi=l(jm,"FlavaForPreTraining"),jm.forEach(t),os.forEach(t),yr=p(o),Z=n(o,"DIV",{class:!0});var uo=r(Z);y(pt.$$.fragment,uo),ji=p(uo),kn=n(uo,"P",{});var Um=r(kn);Ui=l(Um,"The FLAVA model for pretraining which outputs losses, embeddings, logits and transformer outputs."),Um.forEach(t),Ni=p(uo),ft=n(uo,"P",{});var ts=r(ft);Zi=l(ts,"This model is a PyTorch "),ht=n(ts,"A",{href:!0,rel:!0});var Nm=r(ht);Ji=l(Nm,"torch.nn.Module"),Nm.forEach(t),Vi=l(ts,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ts.forEach(t),Bi=p(uo),Q=n(uo,"DIV",{class:!0});var Ua=r(Q);y(gt.$$.fragment,Ua),Ri=p(Ua),ye=n(Ua,"P",{});var Na=r(ye);Gi=l(Na,"The "),ka=n(Na,"A",{href:!0});var Zm=r(ka);qi=l(Zm,"FlavaForPreTraining"),Zm.forEach(t),Si=l(Na," forward method, overrides the "),Fn=n(Na,"CODE",{});var Jm=r(Fn);Li=l(Jm,"__call__"),Jm.forEach(t),Oi=l(Na," special method."),Na.forEach(t),Di=p(Ua),y(Ke.$$.fragment,Ua),Ua.forEach(t),uo.forEach(t),kr=p(o),ke=n(o,"H2",{class:!0});var as=r(ke);eo=n(as,"A",{id:!0,class:!0,href:!0});var Vm=r(eo);Tn=n(Vm,"SPAN",{});var Bm=r(Tn);y(ut.$$.fragment,Bm),Bm.forEach(t),Vm.forEach(t),Xi=p(as),wn=n(as,"SPAN",{});var Rm=r(wn);Yi=l(Rm,"FlavaModel"),Rm.forEach(t),as.forEach(t),Fr=p(o),U=n(o,"DIV",{class:!0});var re=r(U);y(_t.$$.fragment,re),Hi=p(re),vt=n(re,"P",{});var ns=r(vt);Qi=l(ns,`The bare FLAVA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),bt=n(ns,"A",{href:!0,rel:!0});var Gm=r(bt);Ki=l(Gm,"torch.nn.Module"),Gm.forEach(t),ed=l(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),od=p(re),J=n(re,"DIV",{class:!0});var _o=r(J);y(yt.$$.fragment,_o),td=p(_o),Fe=n(_o,"P",{});var Za=r(Fe);ad=l(Za,"The "),Fa=n(Za,"A",{href:!0});var qm=r(Fa);nd=l(qm,"FlavaModel"),qm.forEach(t),rd=l(Za," forward method, overrides the "),Mn=n(Za,"CODE",{});var Sm=r(Mn);sd=l(Sm,"__call__"),Sm.forEach(t),ld=l(Za," special method."),Za.forEach(t),id=p(_o),y(oo.$$.fragment,_o),dd=p(_o),y(to.$$.fragment,_o),_o.forEach(t),cd=p(re),K=n(re,"DIV",{class:!0});var Ja=r(K);y(kt.$$.fragment,Ja),md=p(Ja),Te=n(Ja,"P",{});var Va=r(Te);pd=l(Va,"The "),Ta=n(Va,"A",{href:!0});var Lm=r(Ta);fd=l(Lm,"FlavaModel"),Lm.forEach(t),hd=l(Va," forward method, overrides the "),$n=n(Va,"CODE",{});var Om=r($n);gd=l(Om,"__call__"),Om.forEach(t),ud=l(Va," special method."),Va.forEach(t),_d=p(Ja),y(ao.$$.fragment,Ja),Ja.forEach(t),vd=p(re),ee=n(re,"DIV",{class:!0});var Ba=r(ee);y(Ft.$$.fragment,Ba),bd=p(Ba),we=n(Ba,"P",{});var Ra=r(we);yd=l(Ra,"The "),wa=n(Ra,"A",{href:!0});var Dm=r(wa);kd=l(Dm,"FlavaModel"),Dm.forEach(t),Fd=l(Ra," forward method, overrides the "),xn=n(Ra,"CODE",{});var Xm=r(xn);Td=l(Xm,"__call__"),Xm.forEach(t),wd=l(Ra," special method."),Ra.forEach(t),Md=p(Ba),y(no.$$.fragment,Ba),Ba.forEach(t),re.forEach(t),Tr=p(o),Me=n(o,"H2",{class:!0});var rs=r(Me);ro=n(rs,"A",{id:!0,class:!0,href:!0});var Ym=r(ro);In=n(Ym,"SPAN",{});var Hm=r(In);y(Tt.$$.fragment,Hm),Hm.forEach(t),Ym.forEach(t),$d=p(rs),zn=n(rs,"SPAN",{});var Qm=r(zn);xd=l(Qm,"FlavaImageCodebook"),Qm.forEach(t),rs.forEach(t),wr=p(o),C=n(o,"DIV",{class:!0});var q=r(C);y(wt.$$.fragment,q),Id=p(q),Mt=n(q,"P",{});var ss=r(Mt);zd=l(ss,`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
`),Cn=n(ss,"CODE",{});var Km=r(Cn);Cd=l(Km,"get_codebook_indices"),Km.forEach(t),Pd=l(ss," to get image tokens for an image."),ss.forEach(t),Ed=p(q),$t=n(q,"P",{});var ls=r($t);Ad=l(ls,"This model is a PyTorch "),xt=n(ls,"A",{href:!0,rel:!0});var ep=r(xt);Wd=l(ep,"torch.nn.Module"),ep.forEach(t),jd=l(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),Ud=p(q),Ma=n(q,"DIV",{class:!0});var op=r(Ma);y(It.$$.fragment,op),op.forEach(t),Nd=p(q),$a=n(q,"DIV",{class:!0});var tp=r($a);y(zt.$$.fragment,tp),tp.forEach(t),Zd=p(q),xa=n(q,"DIV",{class:!0});var ap=r(xa);y(Ct.$$.fragment,ap),ap.forEach(t),q.forEach(t),Mr=p(o),$e=n(o,"H2",{class:!0});var is=r($e);so=n(is,"A",{id:!0,class:!0,href:!0});var np=r(so);Pn=n(np,"SPAN",{});var rp=r(Pn);y(Pt.$$.fragment,rp),rp.forEach(t),np.forEach(t),Jd=p(is),En=n(is,"SPAN",{});var sp=r(En);Vd=l(sp,"FlavaTextModel"),sp.forEach(t),is.forEach(t),$r=p(o),L=n(o,"DIV",{class:!0});var Ga=r(L);y(Et.$$.fragment,Ga),Bd=p(Ga),At=n(Ga,"P",{});var ds=r(At);Rd=l(ds,`The bare FLAVA Text Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Wt=n(ds,"A",{href:!0,rel:!0});var lp=r(Wt);Gd=l(lp,"torch.nn.Module"),lp.forEach(t),qd=l(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),Sd=p(Ga),V=n(Ga,"DIV",{class:!0});var vo=r(V);y(jt.$$.fragment,vo),Ld=p(vo),xe=n(vo,"P",{});var qa=r(xe);Od=l(qa,"The "),Ia=n(qa,"A",{href:!0});var ip=r(Ia);Dd=l(ip,"FlavaTextModel"),ip.forEach(t),Xd=l(qa," forward method, overrides the "),An=n(qa,"CODE",{});var dp=r(An);Yd=l(dp,"__call__"),dp.forEach(t),Hd=l(qa," special method."),qa.forEach(t),Qd=p(vo),y(lo.$$.fragment,vo),Kd=p(vo),y(io.$$.fragment,vo),vo.forEach(t),Ga.forEach(t),xr=p(o),Ie=n(o,"H2",{class:!0});var cs=r(Ie);co=n(cs,"A",{id:!0,class:!0,href:!0});var cp=r(co);Wn=n(cp,"SPAN",{});var mp=r(Wn);y(Ut.$$.fragment,mp),mp.forEach(t),cp.forEach(t),ec=p(cs),jn=n(cs,"SPAN",{});var pp=r(jn);oc=l(pp,"FlavaImageModel"),pp.forEach(t),cs.forEach(t),Ir=p(o),O=n(o,"DIV",{class:!0});var Sa=r(O);y(Nt.$$.fragment,Sa),tc=p(Sa),Zt=n(Sa,"P",{});var ms=r(Zt);ac=l(ms,`The bare FLAVA Image Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Jt=n(ms,"A",{href:!0,rel:!0});var fp=r(Jt);nc=l(fp,"torch.nn.Module"),fp.forEach(t),rc=l(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),sc=p(Sa),B=n(Sa,"DIV",{class:!0});var bo=r(B);y(Vt.$$.fragment,bo),lc=p(bo),ze=n(bo,"P",{});var La=r(ze);ic=l(La,"The "),za=n(La,"A",{href:!0});var hp=r(za);dc=l(hp,"FlavaImageModel"),hp.forEach(t),cc=l(La," forward method, overrides the "),Un=n(La,"CODE",{});var gp=r(Un);mc=l(gp,"__call__"),gp.forEach(t),pc=l(La," special method."),La.forEach(t),fc=p(bo),y(mo.$$.fragment,bo),hc=p(bo),y(po.$$.fragment,bo),bo.forEach(t),Sa.forEach(t),zr=p(o),Ce=n(o,"H2",{class:!0});var ps=r(Ce);fo=n(ps,"A",{id:!0,class:!0,href:!0});var up=r(fo);Nn=n(up,"SPAN",{});var _p=r(Nn);y(Bt.$$.fragment,_p),_p.forEach(t),up.forEach(t),gc=p(ps),Zn=n(ps,"SPAN",{});var vp=r(Zn);uc=l(vp,"FlavaMultimodalModel"),vp.forEach(t),ps.forEach(t),Cr=p(o),D=n(o,"DIV",{class:!0});var Oa=r(D);y(Rt.$$.fragment,Oa),_c=p(Oa),Gt=n(Oa,"P",{});var fs=r(Gt);vc=l(fs,`The bare FLAVA Multimodal Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),qt=n(fs,"A",{href:!0,rel:!0});var bp=r(qt);bc=l(bp,"torch.nn.Module"),bp.forEach(t),yc=l(fs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fs.forEach(t),kc=p(Oa),R=n(Oa,"DIV",{class:!0});var yo=r(R);y(St.$$.fragment,yo),Fc=p(yo),Pe=n(yo,"P",{});var Da=r(Pe);Tc=l(Da,"The "),Ca=n(Da,"A",{href:!0});var yp=r(Ca);wc=l(yp,"FlavaMultimodalModel"),yp.forEach(t),Mc=l(Da," forward method, overrides the "),Jn=n(Da,"CODE",{});var kp=r(Jn);$c=l(kp,"__call__"),kp.forEach(t),xc=l(Da," special method."),Da.forEach(t),Ic=p(yo),y(ho.$$.fragment,yo),zc=p(yo),y(go.$$.fragment,yo),yo.forEach(t),Oa.forEach(t),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Gp)),d(g,"id","flava"),d(g,"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(g,"href","#flava"),d(_,"class","relative group"),d(Ae,"id","overview"),d(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ae,"href","#overview"),d(se,"class","relative group"),d(Mo,"href","https://arxiv.org/abs/2112.04482"),d(Mo,"rel","nofollow"),d($o,"href","https://huggingface.co/aps"),d($o,"rel","nofollow"),d(xo,"href","https://github.com/facebookresearch/multimodal/tree/main/examples/flava"),d(xo,"rel","nofollow"),d(je,"id","transformers.FlavaConfig"),d(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(je,"href","#transformers.FlavaConfig"),d(le,"class","relative group"),d(ea,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaConfig"),d(oa,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaModel"),d(Co,"href","https://huggingface.co/facebook/flava-full"),d(Co,"rel","nofollow"),d(ta,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(aa,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(na,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaConfig"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ra,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),d(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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(Je,"id","transformers.FlavaTextConfig"),d(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Je,"href","#transformers.FlavaTextConfig"),d(de,"class","relative group"),d(sa,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaTextModel"),d(Jo,"href","https://huggingface.co/facebook/flava-full"),d(Jo,"rel","nofollow"),d(la,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(ia,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Be,"id","transformers.FlavaImageConfig"),d(Be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Be,"href","#transformers.FlavaImageConfig"),d(me,"class","relative group"),d(da,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaImageModel"),d(qo,"href","https://huggingface.co/facebook/flava-full"),d(qo,"rel","nofollow"),d(ca,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(ma,"href","/docs/transformers/v4.30.0/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(Ge,"id","transformers.FlavaMultimodalConfig"),d(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ge,"href","#transformers.FlavaMultimodalConfig"),d(fe,"class","relative group"),d(pa,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaMultimodalModel"),d(Xo,"href","https://huggingface.co/facebook/flava-full"),d(Xo,"rel","nofollow"),d(fa,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(ha,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Se,"id","transformers.FlavaImageCodebookConfig"),d(Se,"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(Se,"href","#transformers.FlavaImageCodebookConfig"),d(ge,"class","relative group"),d(Ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Le,"id","transformers.FlavaProcessor"),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.FlavaProcessor"),d(ue,"class","relative group"),d(ga,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaProcessor"),d(ua,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaImageProcessor"),d(_a,"href","/docs/transformers/v4.30.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(va,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaProcessor.decode"),d(ba,"href","/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode"),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(ya,"href","/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode"),d(De,"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"),d(Xe,"id","transformers.FlavaFeatureExtractor"),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.FlavaFeatureExtractor"),d(_e,"class","relative group"),d(st,"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.FlavaImageProcessor"),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.FlavaImageProcessor"),d(ve,"class","relative group"),d(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Qe,"id","transformers.FlavaForPreTraining"),d(Qe,"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(Qe,"href","#transformers.FlavaForPreTraining"),d(be,"class","relative group"),d(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ht,"rel","nofollow"),d(ka,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaForPreTraining"),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(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(eo,"id","transformers.FlavaModel"),d(eo,"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(eo,"href","#transformers.FlavaModel"),d(ke,"class","relative group"),d(bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(bt,"rel","nofollow"),d(Fa,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaModel"),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"),d(Ta,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaModel"),d(K,"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,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaModel"),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(U,"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.FlavaImageCodebook"),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.FlavaImageCodebook"),d(Me,"class","relative group"),d(xt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(xt,"rel","nofollow"),d(Ma,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(xa,"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(so,"id","transformers.FlavaTextModel"),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.FlavaTextModel"),d($e,"class","relative group"),d(Wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Wt,"rel","nofollow"),d(Ia,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaTextModel"),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(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(co,"id","transformers.FlavaImageModel"),d(co,"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(co,"href","#transformers.FlavaImageModel"),d(Ie,"class","relative group"),d(Jt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Jt,"rel","nofollow"),d(za,"href","/docs/transformers/v4.30.0/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(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(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(Ce,"class","relative group"),d(qt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(qt,"rel","nofollow"),d(Ca,"href","/docs/transformers/v4.30.0/en/model_doc/flava#transformers.FlavaMultimodalModel"),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(D,"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,h){e(document.head,c),u(o,M,h),u(o,_,h),e(_,g),e(g,v),k(i,v,null),e(_,f),e(_,I),e(I,hs),u(o,Hn,h),u(o,se,h),e(se,Ae),e(Ae,Xa),k(wo,Xa,null),e(se,gs),e(se,Ya),e(Ya,us),u(o,Qn,h),u(o,We,h),e(We,_s),e(We,Mo),e(Mo,vs),e(We,bs),u(o,Kn,h),u(o,Ht,h),e(Ht,ys),u(o,er,h),u(o,Qt,h),e(Qt,ks),u(o,or,h),u(o,Kt,h),e(Kt,Ha),e(Ha,Fs),u(o,tr,h),u(o,Y,h),e(Y,Ts),e(Y,$o),e($o,ws),e(Y,Ms),e(Y,xo),e(xo,$s),e(Y,xs),u(o,ar,h),u(o,le,h),e(le,je),e(je,Qa),k(Io,Qa,null),e(le,Is),e(le,Ka),e(Ka,zs),u(o,nr,h),u(o,z,h),k(zo,z,null),e(z,Cs),e(z,H),e(H,ea),e(ea,Ps),e(H,Es),e(H,oa),e(oa,As),e(H,Ws),e(H,Co),e(Co,js),e(H,Us),e(z,Ns),e(z,ie),e(ie,Zs),e(ie,ta),e(ta,Js),e(ie,Vs),e(ie,aa),e(aa,Bs),e(ie,Rs),e(z,Gs),k(Ue,z,null),e(z,qs),e(z,Ne),k(Po,Ne,null),e(Ne,Ss),e(Ne,Eo),e(Eo,Ls),e(Eo,na),e(na,Os),e(Eo,Ds),e(z,Xs),e(z,Ze),k(Ao,Ze,null),e(Ze,Ys),e(Ze,Wo),e(Wo,Hs),e(Wo,ra),e(ra,Qs),e(Wo,Ks),u(o,rr,h),u(o,de,h),e(de,Je),e(Je,en),k(jo,en,null),e(de,el),e(de,on),e(on,ol),u(o,sr,h),u(o,E,h),k(Uo,E,null),e(E,tl),e(E,No),e(No,al),e(No,sa),e(sa,nl),e(No,rl),e(E,sl),e(E,Zo),e(Zo,ll),e(Zo,Jo),e(Jo,il),e(Zo,dl),e(E,cl),e(E,ce),e(ce,ml),e(ce,la),e(la,pl),e(ce,fl),e(ce,ia),e(ia,hl),e(ce,gl),e(E,ul),k(Ve,E,null),u(o,lr,h),u(o,me,h),e(me,Be),e(Be,tn),k(Vo,tn,null),e(me,_l),e(me,an),e(an,vl),u(o,ir,h),u(o,A,h),k(Bo,A,null),e(A,bl),e(A,Ro),e(Ro,yl),e(Ro,da),e(da,kl),e(Ro,Fl),e(A,Tl),e(A,Go),e(Go,wl),e(Go,qo),e(qo,Ml),e(Go,$l),e(A,xl),e(A,pe),e(pe,Il),e(pe,ca),e(ca,zl),e(pe,Cl),e(pe,ma),e(ma,Pl),e(pe,El),e(A,Al),k(Re,A,null),u(o,dr,h),u(o,fe,h),e(fe,Ge),e(Ge,nn),k(So,nn,null),e(fe,Wl),e(fe,rn),e(rn,jl),u(o,cr,h),u(o,W,h),k(Lo,W,null),e(W,Ul),e(W,Oo),e(Oo,Nl),e(Oo,pa),e(pa,Zl),e(Oo,Jl),e(W,Vl),e(W,Do),e(Do,Bl),e(Do,Xo),e(Xo,Rl),e(Do,Gl),e(W,ql),e(W,he),e(he,Sl),e(he,fa),e(fa,Ll),e(he,Ol),e(he,ha),e(ha,Dl),e(he,Xl),e(W,Yl),k(qe,W,null),u(o,mr,h),u(o,ge,h),e(ge,Se),e(Se,sn),k(Yo,sn,null),e(ge,Hl),e(ge,ln),e(ln,Ql),u(o,pr,h),u(o,Ho,h),k(Qo,Ho,null),u(o,fr,h),u(o,ue,h),e(ue,Le),e(Le,dn),k(Ko,dn,null),e(ue,Kl),e(ue,cn),e(cn,ei),u(o,hr,h),u(o,j,h),k(et,j,null),e(j,oi),e(j,mn),e(mn,ti),e(j,ai),e(j,N),e(N,ga),e(ga,ni),e(N,ri),e(N,ua),e(ua,si),e(N,li),e(N,_a),e(_a,ii),e(N,di),e(N,pn),e(pn,ci),e(N,mi),e(N,va),e(va,pi),e(N,fi),e(j,hi),e(j,Oe),k(ot,Oe,null),e(Oe,gi),e(Oe,tt),e(tt,ui),e(tt,ba),e(ba,_i),e(tt,vi),e(j,bi),e(j,De),k(at,De,null),e(De,yi),e(De,nt),e(nt,ki),e(nt,ya),e(ya,Fi),e(nt,Ti),u(o,gr,h),u(o,_e,h),e(_e,Xe),e(Xe,fn),k(rt,fn,null),e(_e,wi),e(_e,hn),e(hn,Mi),u(o,ur,h),u(o,st,h),k(lt,st,null),u(o,_r,h),u(o,ve,h),e(ve,Ye),e(Ye,gn),k(it,gn,null),e(ve,$i),e(ve,un),e(un,xi),u(o,vr,h),u(o,S,h),k(dt,S,null),e(S,Ii),e(S,_n),e(_n,zi),e(S,Ci),e(S,He),k(ct,He,null),e(He,Pi),e(He,vn),e(vn,Ei),u(o,br,h),u(o,be,h),e(be,Qe),e(Qe,bn),k(mt,bn,null),e(be,Ai),e(be,yn),e(yn,Wi),u(o,yr,h),u(o,Z,h),k(pt,Z,null),e(Z,ji),e(Z,kn),e(kn,Ui),e(Z,Ni),e(Z,ft),e(ft,Zi),e(ft,ht),e(ht,Ji),e(ft,Vi),e(Z,Bi),e(Z,Q),k(gt,Q,null),e(Q,Ri),e(Q,ye),e(ye,Gi),e(ye,ka),e(ka,qi),e(ye,Si),e(ye,Fn),e(Fn,Li),e(ye,Oi),e(Q,Di),k(Ke,Q,null),u(o,kr,h),u(o,ke,h),e(ke,eo),e(eo,Tn),k(ut,Tn,null),e(ke,Xi),e(ke,wn),e(wn,Yi),u(o,Fr,h),u(o,U,h),k(_t,U,null),e(U,Hi),e(U,vt),e(vt,Qi),e(vt,bt),e(bt,Ki),e(vt,ed),e(U,od),e(U,J),k(yt,J,null),e(J,td),e(J,Fe),e(Fe,ad),e(Fe,Fa),e(Fa,nd),e(Fe,rd),e(Fe,Mn),e(Mn,sd),e(Fe,ld),e(J,id),k(oo,J,null),e(J,dd),k(to,J,null),e(U,cd),e(U,K),k(kt,K,null),e(K,md),e(K,Te),e(Te,pd),e(Te,Ta),e(Ta,fd),e(Te,hd),e(Te,$n),e($n,gd),e(Te,ud),e(K,_d),k(ao,K,null),e(U,vd),e(U,ee),k(Ft,ee,null),e(ee,bd),e(ee,we),e(we,yd),e(we,wa),e(wa,kd),e(we,Fd),e(we,xn),e(xn,Td),e(we,wd),e(ee,Md),k(no,ee,null),u(o,Tr,h),u(o,Me,h),e(Me,ro),e(ro,In),k(Tt,In,null),e(Me,$d),e(Me,zn),e(zn,xd),u(o,wr,h),u(o,C,h),k(wt,C,null),e(C,Id),e(C,Mt),e(Mt,zd),e(Mt,Cn),e(Cn,Cd),e(Mt,Pd),e(C,Ed),e(C,$t),e($t,Ad),e($t,xt),e(xt,Wd),e($t,jd),e(C,Ud),e(C,Ma),k(It,Ma,null),e(C,Nd),e(C,$a),k(zt,$a,null),e(C,Zd),e(C,xa),k(Ct,xa,null),u(o,Mr,h),u(o,$e,h),e($e,so),e(so,Pn),k(Pt,Pn,null),e($e,Jd),e($e,En),e(En,Vd),u(o,$r,h),u(o,L,h),k(Et,L,null),e(L,Bd),e(L,At),e(At,Rd),e(At,Wt),e(Wt,Gd),e(At,qd),e(L,Sd),e(L,V),k(jt,V,null),e(V,Ld),e(V,xe),e(xe,Od),e(xe,Ia),e(Ia,Dd),e(xe,Xd),e(xe,An),e(An,Yd),e(xe,Hd),e(V,Qd),k(lo,V,null),e(V,Kd),k(io,V,null),u(o,xr,h),u(o,Ie,h),e(Ie,co),e(co,Wn),k(Ut,Wn,null),e(Ie,ec),e(Ie,jn),e(jn,oc),u(o,Ir,h),u(o,O,h),k(Nt,O,null),e(O,tc),e(O,Zt),e(Zt,ac),e(Zt,Jt),e(Jt,nc),e(Zt,rc),e(O,sc),e(O,B),k(Vt,B,null),e(B,lc),e(B,ze),e(ze,ic),e(ze,za),e(za,dc),e(ze,cc),e(ze,Un),e(Un,mc),e(ze,pc),e(B,fc),k(mo,B,null),e(B,hc),k(po,B,null),u(o,zr,h),u(o,Ce,h),e(Ce,fo),e(fo,Nn),k(Bt,Nn,null),e(Ce,gc),e(Ce,Zn),e(Zn,uc),u(o,Cr,h),u(o,D,h),k(Rt,D,null),e(D,_c),e(D,Gt),e(Gt,vc),e(Gt,qt),e(qt,bc),e(Gt,yc),e(D,kc),e(D,R),k(St,R,null),e(R,Fc),e(R,Pe),e(Pe,Tc),e(Pe,Ca),e(Ca,wc),e(Pe,Mc),e(Pe,Jn),e(Jn,$c),e(Pe,xc),e(R,Ic),k(ho,R,null),e(R,zc),k(go,R,null),Pr=!0},p(o,[h]){const Lt={};h&2&&(Lt.$$scope={dirty:h,ctx:o}),Ue.$set(Lt);const Vn={};h&2&&(Vn.$$scope={dirty:h,ctx:o}),Ve.$set(Vn);const Bn={};h&2&&(Bn.$$scope={dirty:h,ctx:o}),Re.$set(Bn);const Rn={};h&2&&(Rn.$$scope={dirty:h,ctx:o}),qe.$set(Rn);const Ot={};h&2&&(Ot.$$scope={dirty:h,ctx:o}),Ke.$set(Ot);const Gn={};h&2&&(Gn.$$scope={dirty:h,ctx:o}),oo.$set(Gn);const qn={};h&2&&(qn.$$scope={dirty:h,ctx:o}),to.$set(qn);const Sn={};h&2&&(Sn.$$scope={dirty:h,ctx:o}),ao.$set(Sn);const Dt={};h&2&&(Dt.$$scope={dirty:h,ctx:o}),no.$set(Dt);const Ln={};h&2&&(Ln.$$scope={dirty:h,ctx:o}),lo.$set(Ln);const On={};h&2&&(On.$$scope={dirty:h,ctx:o}),io.$set(On);const Dn={};h&2&&(Dn.$$scope={dirty:h,ctx:o}),mo.$set(Dn);const Xn={};h&2&&(Xn.$$scope={dirty:h,ctx:o}),po.$set(Xn);const Yn={};h&2&&(Yn.$$scope={dirty:h,ctx:o}),ho.$set(Yn);const Ee={};h&2&&(Ee.$$scope={dirty:h,ctx:o}),go.$set(Ee)},i(o){Pr||(F(i.$$.fragment,o),F(wo.$$.fragment,o),F(Io.$$.fragment,o),F(zo.$$.fragment,o),F(Ue.$$.fragment,o),F(Po.$$.fragment,o),F(Ao.$$.fragment,o),F(jo.$$.fragment,o),F(Uo.$$.fragment,o),F(Ve.$$.fragment,o),F(Vo.$$.fragment,o),F(Bo.$$.fragment,o),F(Re.$$.fragment,o),F(So.$$.fragment,o),F(Lo.$$.fragment,o),F(qe.$$.fragment,o),F(Yo.$$.fragment,o),F(Qo.$$.fragment,o),F(Ko.$$.fragment,o),F(et.$$.fragment,o),F(ot.$$.fragment,o),F(at.$$.fragment,o),F(rt.$$.fragment,o),F(lt.$$.fragment,o),F(it.$$.fragment,o),F(dt.$$.fragment,o),F(ct.$$.fragment,o),F(mt.$$.fragment,o),F(pt.$$.fragment,o),F(gt.$$.fragment,o),F(Ke.$$.fragment,o),F(ut.$$.fragment,o),F(_t.$$.fragment,o),F(yt.$$.fragment,o),F(oo.$$.fragment,o),F(to.$$.fragment,o),F(kt.$$.fragment,o),F(ao.$$.fragment,o),F(Ft.$$.fragment,o),F(no.$$.fragment,o),F(Tt.$$.fragment,o),F(wt.$$.fragment,o),F(It.$$.fragment,o),F(zt.$$.fragment,o),F(Ct.$$.fragment,o),F(Pt.$$.fragment,o),F(Et.$$.fragment,o),F(jt.$$.fragment,o),F(lo.$$.fragment,o),F(io.$$.fragment,o),F(Ut.$$.fragment,o),F(Nt.$$.fragment,o),F(Vt.$$.fragment,o),F(mo.$$.fragment,o),F(po.$$.fragment,o),F(Bt.$$.fragment,o),F(Rt.$$.fragment,o),F(St.$$.fragment,o),F(ho.$$.fragment,o),F(go.$$.fragment,o),Pr=!0)},o(o){T(i.$$.fragment,o),T(wo.$$.fragment,o),T(Io.$$.fragment,o),T(zo.$$.fragment,o),T(Ue.$$.fragment,o),T(Po.$$.fragment,o),T(Ao.$$.fragment,o),T(jo.$$.fragment,o),T(Uo.$$.fragment,o),T(Ve.$$.fragment,o),T(Vo.$$.fragment,o),T(Bo.$$.fragment,o),T(Re.$$.fragment,o),T(So.$$.fragment,o),T(Lo.$$.fragment,o),T(qe.$$.fragment,o),T(Yo.$$.fragment,o),T(Qo.$$.fragment,o),T(Ko.$$.fragment,o),T(et.$$.fragment,o),T(ot.$$.fragment,o),T(at.$$.fragment,o),T(rt.$$.fragment,o),T(lt.$$.fragment,o),T(it.$$.fragment,o),T(dt.$$.fragment,o),T(ct.$$.fragment,o),T(mt.$$.fragment,o),T(pt.$$.fragment,o),T(gt.$$.fragment,o),T(Ke.$$.fragment,o),T(ut.$$.fragment,o),T(_t.$$.fragment,o),T(yt.$$.fragment,o),T(oo.$$.fragment,o),T(to.$$.fragment,o),T(kt.$$.fragment,o),T(ao.$$.fragment,o),T(Ft.$$.fragment,o),T(no.$$.fragment,o),T(Tt.$$.fragment,o),T(wt.$$.fragment,o),T(It.$$.fragment,o),T(zt.$$.fragment,o),T(Ct.$$.fragment,o),T(Pt.$$.fragment,o),T(Et.$$.fragment,o),T(jt.$$.fragment,o),T(lo.$$.fragment,o),T(io.$$.fragment,o),T(Ut.$$.fragment,o),T(Nt.$$.fragment,o),T(Vt.$$.fragment,o),T(mo.$$.fragment,o),T(po.$$.fragment,o),T(Bt.$$.fragment,o),T(Rt.$$.fragment,o),T(St.$$.fragment,o),T(ho.$$.fragment,o),T(go.$$.fragment,o),Pr=!1},d(o){t(c),o&&t(M),o&&t(_),w(i),o&&t(Hn),o&&t(se),w(wo),o&&t(Qn),o&&t(We),o&&t(Kn),o&&t(Ht),o&&t(er),o&&t(Qt),o&&t(or),o&&t(Kt),o&&t(tr),o&&t(Y),o&&t(ar),o&&t(le),w(Io),o&&t(nr),o&&t(z),w(zo),w(Ue),w(Po),w(Ao),o&&t(rr),o&&t(de),w(jo),o&&t(sr),o&&t(E),w(Uo),w(Ve),o&&t(lr),o&&t(me),w(Vo),o&&t(ir),o&&t(A),w(Bo),w(Re),o&&t(dr),o&&t(fe),w(So),o&&t(cr),o&&t(W),w(Lo),w(qe),o&&t(mr),o&&t(ge),w(Yo),o&&t(pr),o&&t(Ho),w(Qo),o&&t(fr),o&&t(ue),w(Ko),o&&t(hr),o&&t(j),w(et),w(ot),w(at),o&&t(gr),o&&t(_e),w(rt),o&&t(ur),o&&t(st),w(lt),o&&t(_r),o&&t(ve),w(it),o&&t(vr),o&&t(S),w(dt),w(ct),o&&t(br),o&&t(be),w(mt),o&&t(yr),o&&t(Z),w(pt),w(gt),w(Ke),o&&t(kr),o&&t(ke),w(ut),o&&t(Fr),o&&t(U),w(_t),w(yt),w(oo),w(to),w(kt),w(ao),w(Ft),w(no),o&&t(Tr),o&&t(Me),w(Tt),o&&t(wr),o&&t(C),w(wt),w(It),w(zt),w(Ct),o&&t(Mr),o&&t($e),w(Pt),o&&t($r),o&&t(L),w(Et),w(jt),w(lo),w(io),o&&t(xr),o&&t(Ie),w(Ut),o&&t(Ir),o&&t(O),w(Nt),w(Vt),w(mo),w(po),o&&t(zr),o&&t(Ce),w(Bt),o&&t(Cr),o&&t(D),w(Rt),w(St),w(ho),w(go)}}}const Gp={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.FlavaFeatureExtractor",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 qp($){return $p(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Hp extends Fp{constructor(c){super();Tp(this,c,qp,Rp,wp,{})}}export{Hp as default,Gp as metadata};
