import{s as oa,f as na,o as sa,n as I}from"../chunks/scheduler.9bc65507.js";import{S as ra,i as aa,g as r,s as l,u as _,A as la,h as a,f as t,c as i,j as f,v as b,y as g,k as h,o as n,a as p,w as v,d as y,t as M,x as w}from"../chunks/index.78c82d43.js";import{T as Bo}from"../chunks/Tip.87d55b76.js";import{D as j}from"../chunks/Docstring.f3d04bd2.js";import{C as ae}from"../chunks/CodeBlock.48618ec2.js";import{I as S}from"../chunks/IconCopyLink.bedaa44d.js";import{E as re}from"../chunks/ExampleCodeBlock.872b014d.js";function ia(B){let s,T="Example:",m,c,u;return c=new ae({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBCbGlwMlZpc2lvbkNvbmZpZyUyQyUwQSUyMCUyMCUyMCUyMEJsaXAyUUZvcm1lckNvbmZpZyUyQyUwQSUyMCUyMCUyMCUyME9QVENvbmZpZyUyQyUwQSUyMCUyMCUyMCUyMEJsaXAyQ29uZmlnJTJDJTBBJTIwJTIwJTIwJTIwQmxpcDJGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMEEpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJsaXAyQ29uZmlnJTIwd2l0aCUyMFNhbGVzZm9yY2UlMkZibGlwMi1vcHQtMi43YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCbGlwMkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJsaXAyRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEJsaXAyRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZyUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGluaXRpYWxpemUlMjBhJTIwQmxpcDJDb25maWclMjBmcm9tJTIwYSUyMEJsaXAyVmlzaW9uQ29uZmlnJTJDJTIwQmxpcDJRRm9ybWVyQ29uZmlnJTIwYW5kJTIwYW55JTIwUHJldHJhaW5lZENvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMEJMSVAtMiUyMHZpc2lvbiUyQyUyMEJMSVAtMiUyMFEtRm9ybWVyJTIwYW5kJTIwbGFuZ3VhZ2UlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb25zJTBBdmlzaW9uX2NvbmZpZyUyMCUzRCUyMEJsaXAyVmlzaW9uQ29uZmlnKCklMEFxZm9ybWVyX2NvbmZpZyUyMCUzRCUyMEJsaXAyUUZvcm1lckNvbmZpZygpJTBBdGV4dF9jb25maWclMjAlM0QlMjBPUFRDb25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMEJsaXAyQ29uZmlnLmZyb21fdGV4dF92aXNpb25fY29uZmlncyh2aXNpb25fY29uZmlnJTJDJTIwcWZvcm1lcl9jb25maWclMkMlMjB0ZXh0X2NvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    Blip2VisionConfig,
<span class="hljs-meta">... </span>    Blip2QFormerConfig,
<span class="hljs-meta">... </span>    OPTConfig,
<span class="hljs-meta">... </span>    Blip2Config,
<span class="hljs-meta">... </span>    Blip2ForConditionalGeneration,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Blip2Config with Salesforce/blip2-opt-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Blip2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Blip2ForConditionalGeneration (with random weights) from the Salesforce/blip2-opt-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2ForConditionalGeneration(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also initialize a Blip2Config from a Blip2VisionConfig, Blip2QFormerConfig and any PretrainedConfig</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing BLIP-2 vision, BLIP-2 Q-Former and language model configurations</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vision_config = Blip2VisionConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>qformer_config = Blip2QFormerConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>text_config = OPTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = Blip2Config.from_text_vision_configs(vision_config, qformer_config, text_config)`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-11lpom8"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function da(B){let s,T="Example:",m,c,u;return c=new ae({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsaXAyVmlzaW9uQ29uZmlnJTJDJTIwQmxpcDJWaXNpb25Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCbGlwMlZpc2lvbkNvbmZpZyUyMHdpdGglMjBTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQmxpcDJWaXNpb25Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCbGlwMlZpc2lvbk1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEJsaXAyVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Blip2VisionConfig, Blip2VisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Blip2VisionConfig with Salesforce/blip2-opt-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Blip2VisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Blip2VisionModel (with random weights) from the Salesforce/blip2-opt-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2VisionModel(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(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-11lpom8"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function ca(B){let s,T="Examples:",m,c,u;return c=new ae({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsaXAyUUZvcm1lckNvbmZpZyUyQyUyMEJsaXAyUUZvcm1lck1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJMSVAtMiUyMFNhbGVzZm9yY2UlMkZibGlwMi1vcHQtMi43YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCbGlwMlFGb3JtZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwU2FsZXNmb3JjZSUyRmJsaXAyLW9wdC0yLjdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBCbGlwMlFGb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Blip2QFormerConfig, Blip2QFormerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BLIP-2 Salesforce/blip2-opt-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Blip2QFormerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the Salesforce/blip2-opt-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2QFormerModel(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(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function pa(B){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=r("p"),s.innerHTML=T},l(m){s=a(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(m,c){p(m,s,c)},p:I,d(m){m&&t(s)}}}function ma(B){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=r("p"),s.innerHTML=T},l(m){s=a(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(m,c){p(m,s,c)},p:I,d(m){m&&t(s)}}}function ha(B){let s,T="Examples:",m,c,u;return c=new ae({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQmxpcDJQcm9jZXNzb3IlMkMlMjBCbGlwMk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEFkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEJsaXAyUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBCbGlwMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBbW9kZWwudG8oZGV2aWNlKSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJRdWVzdGlvbiUzQSUyMGhvdyUyMG1hbnklMjBjYXRzJTIwYXJlJTIwdGhlcmUlM0YlMjBBbnN3ZXIlM0ElMjIlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjB0ZXh0JTNEcHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlJTJDJTIwdG9yY2guZmxvYXQxNiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMp",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> Blip2Processor, Blip2Model
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Blip2Processor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2Model.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<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>prompt = <span class="hljs-string">&quot;Question: how many cats are there? Answer:&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device, torch.float16)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function ga(B){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=r("p"),s.innerHTML=T},l(m){s=a(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(m,c){p(m,s,c)},p:I,d(m){m&&t(s)}}}function ua(B){let s,T="Examples:",m,c,u;return c=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJsaXAyTW9kZWwlMEElMEFkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwQmxpcDJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAyLW9wdC0yLjdiJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQSUwQW1vZGVsLnRvKGRldmljZSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfdGV4dF9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<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> transformers <span class="hljs-keyword">import</span> AutoTokenizer, Blip2Model

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2Model.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16)

<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function fa(B){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=r("p"),s.innerHTML=T},l(m){s=a(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(m,c){p(m,s,c)},p:I,d(m){m&&t(s)}}}function _a(B){let s,T="Examples:",m,c,u;return c=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQmxpcDJNb2RlbCUwQSUwQWRldmljZSUyMCUzRCUyMCUyMmN1ZGElMjIlMjBpZiUyMHRvcmNoLmN1ZGEuaXNfYXZhaWxhYmxlKCklMjBlbHNlJTIwJTIyY3B1JTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBCbGlwMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTBBbW9kZWwudG8oZGV2aWNlKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwMi1vcHQtMi43YiUyMiklMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlJTJDJTIwdG9yY2guZmxvYXQxNiklMEFpbWFnZV9vdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<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> 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, Blip2Model

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2Model.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16)

<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device, torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_outputs = model.get_image_features(**inputs)`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function ba(B){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=r("p"),s.innerHTML=T},l(m){s=a(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(m,c){p(m,s,c)},p:I,d(m){m&&t(s)}}}function va(B){let s,T="Examples:",m,c,u;return c=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBCbGlwMlByb2Nlc3NvciUyQyUyMEJsaXAyTW9kZWwlMEElMEFkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEJsaXAyUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBCbGlwMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcDItb3B0LTIuN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBbW9kZWwudG8oZGV2aWNlKSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UlMkMlMjB0b3JjaC5mbG9hdDE2KSUwQXFmb3JtZXJfb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdldF9xZm9ybWVyX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<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> 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> Blip2Processor, Blip2Model

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Blip2Processor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2Model.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device, torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>qformer_outputs = model.get_qformer_features(**inputs)`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function ya(B){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=r("p"),s.innerHTML=T},l(m){s=a(m,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(m,c){p(m,s,c)},p:I,d(m){m&&t(s)}}}function Ma(B){let s,T="Image captioning (without providing a text prompt):",m,c,u;return c=new ae({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQmxpcDJQcm9jZXNzb3IlMkMlMjBCbGlwMkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBCbGlwMlByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAyLW9wdC0yLjdiJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxpcDJGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMlNhbGVzZm9yY2UlMkZibGlwMi1vcHQtMi43YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFtb2RlbC50byhkZXZpY2UpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnRvKGRldmljZSUyQyUyMHRvcmNoLmZsb2F0MTYpJTBBJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQWdlbmVyYXRlZF90ZXh0JTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RC5zdHJpcCgpJTBBcHJpbnQoZ2VuZXJhdGVkX3RleHQp",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> Blip2Processor, Blip2ForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Blip2Processor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2ForConditionalGeneration.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device, torch.float16)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>].strip()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_text)
two cats laying on a couch`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-1xz2grm"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function wa(B){let s,T="Visual question answering (prompt = question):",m,c,u;return c=new ae({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQmxpcDJQcm9jZXNzb3IlMkMlMjBCbGlwMkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBCbGlwMlByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAyLW9wdC0yLjdiJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxpcDJGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMlNhbGVzZm9yY2UlMkZibGlwMi1vcHQtMi43YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFtb2RlbC50byhkZXZpY2UpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMlF1ZXN0aW9uJTNBJTIwaG93JTIwbWFueSUyMGNhdHMlMjBhcmUlMjB0aGVyZSUzRiUyMEFuc3dlciUzQSUyMiUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHRleHQlM0Rwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UlMkMlMjB0b3JjaC5mbG9hdDE2KSUwQSUwQWdlbmVyYXRlZF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyklMEFnZW5lcmF0ZWRfdGV4dCUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQuc3RyaXAoKSUwQXByaW50KGdlbmVyYXRlZF90ZXh0KQ==",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> Blip2Processor, Blip2ForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Blip2Processor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2ForConditionalGeneration.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<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>prompt = <span class="hljs-string">&quot;Question: how many cats are there? Answer:&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device, torch.float16)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>].strip()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_text)
two`}}),{c(){s=r("p"),s.textContent=T,m=l(),_(c.$$.fragment)},l(o){s=a(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-dkukz2"&&(s.textContent=T),m=i(o),b(c.$$.fragment,o)},m(o,$){p(o,s,$),p(o,m,$),v(c,o,$),u=!0},p:I,i(o){u||(y(c.$$.fragment,o),u=!0)},o(o){M(c.$$.fragment,o),u=!1},d(o){o&&(t(s),t(m)),w(c,o)}}}function Ta(B){let s,T,m,c,u,o,$,Le,In,Wt,Es="BLIP-2",Eo,R,le,ko,Se,zn,Ft,Hs="Overview",Ho,Ee,Xs=`The BLIP-2 model was proposed in <a href="https://arxiv.org/abs/2301.12597" rel="nofollow">BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models</a> by
Junnan Li, Dongxu Li, Silvio Savarese, Steven Hoi. BLIP-2 leverages frozen pre-trained image encoders and large language models (LLMs) by training a lightweight, 12-layer Transformer
encoder in between them, achieving state-of-the-art performance on various vision-language tasks. Most notably, BLIP-2 improves upon <a href="https://arxiv.org/abs/2204.14198" rel="nofollow">Flamingo</a>, an 80 billion parameter model, by 8.7%
on zero-shot VQAv2 with 54x fewer trainable parameters.`,Xo,He,Rs="The abstract from the paper is the following:",Ro,Xe,Ys="<em>The cost of vision-and-language pre-training has become increasingly prohibitive due to end-to-end training of large-scale models. This paper proposes BLIP-2, a generic and efficient pre-training strategy that bootstraps vision-language pre-training from off-the-shelf frozen pre-trained image encoders and frozen large language models. BLIP-2 bridges the modality gap with a lightweight Querying Transformer, which is pre-trained in two stages. The first stage bootstraps vision-language representation learning from a frozen image encoder. The second stage bootstraps vision-to-language generative learning from a frozen language model. BLIP-2 achieves state-of-the-art performance on various vision-language tasks, despite having significantly fewer trainable parameters than existing methods. For example, our model outperforms Flamingo80B by 8.7% on zero-shot VQAv2 with 54x fewer trainable parameters. We also demonstrate the model’s emerging capabilities of zero-shot image-to-text generation that can follow natural language instructions.</em>",Yo,Re,As="Tips:",Ao,Ye,Ds='<li>BLIP-2 can be used for conditional text generation given an image and an optional text prompt. At inference time, it’s recommended to use the <code>generate</code> method.</li> <li>One can use <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a> to prepare images for the model, and decode the predicted tokens ID’s back to text.</li>',Do,ie,Os,Oo,Ae,Ks='BLIP-2 architecture. Taken from the <a href="https://arxiv.org/abs/2301.12597">original paper.</a>',Ko,De,er=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>.
The original code can be found <a href="https://github.com/salesforce/LAVIS/tree/5ee63d688ba4cebff63acee04adaef2dee9af207" rel="nofollow">here</a>.`,en,Y,de,Co,Oe,Wn,Pt,tr="Resources",tn,Ke,or="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with BLIP-2.",on,et,nr='<li>Demo notebooks for BLIP-2 for image captioning, visual question answering (VQA) and chat-like conversations can be found <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/BLIP-2" rel="nofollow">here</a>.</li>',nn,tt,sr="If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",sn,A,ce,jo,ot,Fn,Nt,rr="Blip2Config",rn,U,nt,Pn,qt,ar=`<a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Config">Blip2Config</a> is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2ForConditionalGeneration">Blip2ForConditionalGeneration</a>. It is
used to instantiate a BLIP-2 model according to the specified arguments, defining the vision model, Q-Former model
and language model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the BLIP-2 <a href="https://huggingface.co/Salesforce/blip2-opt-2.7b" rel="nofollow">Salesforce/blip2-opt-2.7b</a> architecture.`,Nn,Gt,lr=`Configuration objects inherit from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,qn,pe,Gn,me,st,Qn,Qt,ir=`Instantiate a <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Config">Blip2Config</a> (or a derived class) from a BLIP-2 vision model, Q-Former and language model
configurations.`,an,D,he,Jo,rt,Vn,Vt,dr="Blip2VisionConfig",ln,W,at,Ln,Lt,cr=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2VisionModel">Blip2VisionModel</a>. It is used to instantiate a
BLIP-2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration defaults will yield a similar configuration to that of the BLIP-2
<a href="https://huggingface.co/Salesforce/blip2-opt-2.7b" rel="nofollow">Salesforce/blip2-opt-2.7b</a> architecture.`,Sn,St,pr=`Configuration objects inherit from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,En,ge,dn,O,ue,xo,lt,Hn,Et,mr="Blip2QFormerConfig",cn,F,it,Xn,Ht,hr=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2QFormerModel">Blip2QFormerModel</a>. It is used to instantiate a
BLIP-2 Querying Transformer (Q-Former) model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the BLIP-2
<a href="https://huggingface.co/Salesforce/blip2-opt-2.7b" rel="nofollow">Salesforce/blip2-opt-2.7b</a> architecture. Configuration objects
inherit from <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the documentation from
<a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Rn,Xt,gr='Note that <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2QFormerModel">Blip2QFormerModel</a> is very similar to <a href="/docs/transformers/v4.33.3/en/model_doc/bert#transformers.BertLMHeadModel">BertLMHeadModel</a> with interleaved cross-attention.',Yn,fe,pn,K,_e,Uo,dt,An,Rt,ur="Blip2Processor",mn,Z,ct,Dn,Yt,fr="Constructs a BLIP-2 processor which wraps a BLIP image processor and an OPT/T5 tokenizer into a single processor.",On,At,_r=`<a href="/docs/transformers/v4.33.3/en/model_doc/blip#transformers.BlipProcessor">BlipProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.33.3/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a> and <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See the docstring
of <code>__call__()</code> and <a href="/docs/transformers/v4.33.3/en/model_doc/blip#transformers.BlipProcessor.decode">decode()</a> for more information.`,Kn,be,pt,es,Dt,br=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ts,ve,mt,os,Ot,vr=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.decode">decode()</a>. Please refer
to the docstring of this method for more information.`,hn,ee,ye,Zo,ht,ns,Kt,yr="Blip2VisionModel",gn,te,gt,ss,E,ut,rs,eo,Mr='The <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2VisionModel">Blip2VisionModel</a> forward method, overrides the <code>__call__</code> special method.',as,Me,un,oe,we,Io,ft,ls,to,wr="Blip2QFormerModel",fn,L,_t,is,oo,Tr="Querying Transformer (Q-Former), used in BLIP-2.",ds,H,bt,cs,no,$r=`encoder_hidden_states  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <code>optional</code>):
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.
encoder_attention_mask (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <code>optional</code>):
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,ps,so,Br=`<li>1 for tokens that are <strong>not masked</strong>,</li> <li>0 for tokens that are <strong>masked</strong>.
past_key_values (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of:
shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>): Contains precomputed key and
value hidden states of the attention blocks. Can be used to speed up decoding. If <code>past_key_values</code> are
used, the user can optionally input only the last <code>decoder_input_ids</code> (those that don’t have their past key
value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>decoder_input_ids</code> of shape
<code>(batch_size, sequence_length)</code>.
use_cache (<code>bool</code>, <code>optional</code>):
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).</li>`,_n,ne,Te,zo,vt,ms,ro,kr="Blip2Model",bn,k,yt,hs,ao,Cr=`BLIP-2 Model for generating text and image features. The model consists of a vision encoder, Querying Transformer
(Q-Former) and a language model.`,gs,lo,jr=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,us,io,Jr=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,fs,N,Mt,_s,co,xr='The <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Model">Blip2Model</a> forward method, overrides the <code>__call__</code> special method.',bs,$e,vs,Be,ys,q,wt,Ms,po,Ur='The <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Model">Blip2Model</a> forward method, overrides the <code>__call__</code> special method.',ws,ke,Ts,Ce,$s,G,Tt,Bs,mo,Zr='The <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Model">Blip2Model</a> forward method, overrides the <code>__call__</code> special method.',ks,je,Cs,Je,js,Q,$t,Js,ho,Ir='The <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Model">Blip2Model</a> forward method, overrides the <code>__call__</code> special method.',xs,xe,Us,Ue,vn,se,Ze,Wo,Bt,Zs,go,zr="Blip2ForConditionalGeneration",yn,C,kt,Is,uo,Wr=`BLIP-2 Model for generating text given an image and an optional text prompt. The model consists of a vision
encoder, Querying Transformer (Q-Former) and a language model.`,zs,fo,Fr=`One can optionally pass <code>input_ids</code> to the model, which serve as a text prompt, to make the language model continue
the prompt. Otherwise, the language model starts generating text from the [BOS] (beginning-of-sequence) token.`,Ws,_o,Pr=`This model inherits from <a href="/docs/transformers/v4.33.3/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Fs,bo,Nr=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ps,J,Ct,Ns,vo,qr='The <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2ForConditionalGeneration">Blip2ForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',qs,Ie,Gs,yo,Gr="Examples:",Qs,ze,Vs,We,Ls,Fe,jt,Ss,Mo,Qr="Overrides <code>generate</code> function to be able to use the model as a conditional generator.",Mn,Fo,wn;return Le=new S({}),Se=new S({}),Oe=new S({}),ot=new S({}),nt=new j({props:{name:"class transformers.Blip2Config",anchor:"transformers.Blip2Config",parameters:[{name:"vision_config",val:" = None"},{name:"qformer_config",val:" = None"},{name:"text_config",val:" = None"},{name:"num_query_tokens",val:" = 32"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Blip2Config.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2VisionConfig">Blip2VisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.Blip2Config.qformer_config",description:`<strong>qformer_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2QFormerConfig">Blip2QFormerConfig</a>.`,name:"qformer_config"},{anchor:"transformers.Blip2Config.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize any <a href="/docs/transformers/v4.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>.`,name:"text_config"},{anchor:"transformers.Blip2Config.num_query_tokens",description:`<strong>num_query_tokens</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of query tokens passed through the Transformer.`,name:"num_query_tokens"},{anchor:"transformers.Blip2Config.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/configuration_blip_2.py#L250"}}),pe=new re({props:{anchor:"transformers.Blip2Config.example",$$slots:{default:[ia]},$$scope:{ctx:B}}}),st=new j({props:{name:"from_vision_qformer_text_configs",anchor:"transformers.Blip2Config.from_vision_qformer_text_configs",parameters:[{name:"vision_config",val:": Blip2VisionConfig"},{name:"qformer_config",val:": Blip2QFormerConfig"},{name:"text_config",val:": PretrainedConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/configuration_blip_2.py#L334",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Config"
>Blip2Config</a></p>
`}}),rt=new S({}),at=new j({props:{name:"class transformers.Blip2VisionConfig",anchor:"transformers.Blip2VisionConfig",parameters:[{name:"hidden_size",val:" = 1408"},{name:"intermediate_size",val:" = 6144"},{name:"num_hidden_layers",val:" = 39"},{name:"num_attention_heads",val:" = 16"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 14"},{name:"hidden_act",val:" = 'gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 1e-10"},{name:"qkv_bias",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Blip2VisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1408) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Blip2VisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 6144) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Blip2VisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 39) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Blip2VisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Blip2VisionConfig.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.Blip2VisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 14) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Blip2VisionConfig.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> \`<code>&quot;gelu&quot;</code> are supported. layer_norm_eps (<code>float</code>, <em>optional</em>, defaults
to 1e-5): The epsilon used by the layer normalization layers.`,name:"hidden_act"},{anchor:"transformers.Blip2VisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Blip2VisionConfig.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.Blip2VisionConfig.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 and values in the self-attention layers.`,name:"qkv_bias"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/configuration_blip_2.py#L33"}}),ge=new re({props:{anchor:"transformers.Blip2VisionConfig.example",$$slots:{default:[da]},$$scope:{ctx:B}}}),lt=new S({}),it=new j({props:{name:"class transformers.Blip2QFormerConfig",anchor:"transformers.Blip2QFormerConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"cross_attention_frequency",val:" = 2"},{name:"encoder_hidden_size",val:" = 1408"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Blip2QFormerConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the Q-Former model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling the model.`,name:"vocab_size"},{anchor:"transformers.Blip2QFormerConfig.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.Blip2QFormerConfig.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.Blip2QFormerConfig.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.Blip2QFormerConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Blip2QFormerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Blip2QFormerConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.Blip2QFormerConfig.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.Blip2QFormerConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.Blip2QFormerConfig.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.Blip2QFormerConfig.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.Blip2QFormerConfig.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.Blip2QFormerConfig.cross_attention_frequency",description:`<strong>cross_attention_frequency</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The frequency of adding cross-attention to the Transformer layers.`,name:"cross_attention_frequency"},{anchor:"transformers.Blip2QFormerConfig.encoder_hidden_size",description:`<strong>encoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1408) &#x2014;
The hidden size of the hidden states for cross-attention.`,name:"encoder_hidden_size"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/configuration_blip_2.py#L132"}}),fe=new re({props:{anchor:"transformers.Blip2QFormerConfig.example",$$slots:{default:[ca]},$$scope:{ctx:B}}}),dt=new S({}),ct=new j({props:{name:"class transformers.Blip2Processor",anchor:"transformers.Blip2Processor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.Blip2Processor.image_processor",description:`<strong>image_processor</strong> (<code>BlipImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.33.3/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.Blip2Processor.tokenizer",description:"<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;\nAn instance of [&#x2018;PreTrainedTokenizer`]. The tokenizer is a required input.",name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/processing_blip_2.py#L27"}}),pt=new j({props:{name:"batch_decode",anchor:"transformers.Blip2Processor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/processing_blip_2.py#L134"}}),mt=new j({props:{name:"decode",anchor:"transformers.Blip2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/processing_blip_2.py#L142"}}),ht=new S({}),gt=new j({props:{name:"class transformers.Blip2VisionModel",anchor:"transformers.Blip2VisionModel",parameters:[{name:"config",val:": Blip2VisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L511"}}),ut=new j({props:{name:"forward",anchor:"transformers.Blip2VisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Blip2VisionModel.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.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for
details.`,name:"pixel_values"},{anchor:"transformers.Blip2VisionModel.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.Blip2VisionModel.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.Blip2VisionModel.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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L526",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/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 (<code>&lt;class 'transformers.models.blip_2.configuration_blip_2.Blip2VisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — 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>) — 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>) — 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>) — 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.33.3/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new Bo({props:{$$slots:{default:[pa]},$$scope:{ctx:B}}}),ft=new S({}),_t=new j({props:{name:"class transformers.Blip2QFormerModel",anchor:"transformers.Blip2QFormerModel",parameters:[{name:"config",val:": Blip2QFormerConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1006"}}),bt=new j({props:{name:"forward",anchor:"transformers.Blip2QFormerModel.forward",parameters:[{name:"query_embeds",val:": FloatTensor"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1081"}}),vt=new S({}),yt=new j({props:{name:"class transformers.Blip2Model",anchor:"transformers.Blip2Model",parameters:[{name:"config",val:": Blip2Config"}],parametersDescription:[{anchor:"transformers.Blip2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Config">Blip2Config</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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1202"}}),Mt=new j({props:{name:"forward",anchor:"transformers.Blip2Model.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"input_ids",val:": FloatTensor"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Blip2Model.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.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for
details.`,name:"pixel_values"},{anchor:"transformers.Blip2Model.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary of the language model. Input tokens can optionally be
provided to serve as text prompt, which the language model can continue.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Blip2Model.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Blip2Model.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary of the language model. Only relevant in case an
encoder-decoder language model (like T5) is used.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,name:"decoder_input_ids"},{anchor:"transformers.Blip2Model.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>Only relevant in case an encoder-decoder language model (like T5) is used.`,name:"decoder_attention_mask"},{anchor:"transformers.Blip2Model.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.Blip2Model.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.Blip2Model.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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1425",returnDescription:`
<p>A <code>transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGenerationModelOutput</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.blip_2.configuration_blip_2.Blip2VisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code>, <em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) — Language modeling loss from the language model.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head of the language model.</li>
<li><strong>vision_outputs</strong> (<code>BaseModelOutputWithPooling</code>) — Outputs of the vision encoder.</li>
<li><strong>qformer_outputs</strong> (<code>BaseModelOutputWithPoolingAndCrossAttentions</code>) — Outputs of the Q-Former (Querying Transformer).</li>
<li><strong>language_model_outputs</strong> (<code>CausalLMOutputWithPast</code> or <code>Seq2SeqLMOutput</code>) — Outputs of the language model.</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGenerationModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Bo({props:{$$slots:{default:[ma]},$$scope:{ctx:B}}}),Be=new re({props:{anchor:"transformers.Blip2Model.forward.example",$$slots:{default:[ha]},$$scope:{ctx:B}}}),wt=new j({props:{name:"get_text_features",anchor:"transformers.Blip2Model.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",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.Blip2Model.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Blip2Model.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.Blip2Model.get_text_features.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>T5 uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>To know more on how to prepare <code>decoder_input_ids</code> for pretraining take a look at <a href="./t5#training">T5
Training</a>.`,name:"decoder_input_ids"},{anchor:"transformers.Blip2Model.get_text_features.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.Blip2Model.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.Blip2Model.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.Blip2Model.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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1252",returnDescription:`
<p>The language model outputs. If <code>return_dict=True</code>, the output is a <code>CausalLMOutputWithPast</code> that
contains the language model logits, the past key values and the hidden states if
<code>output_hidden_states=True</code>.</p>
`,returnType:`
<p>text_outputs (<code>CausalLMOutputWithPast</code>, or <code>tuple(torch.FloatTensor)</code> if <code>return_dict=False</code>)</p>
`}}),ke=new Bo({props:{$$slots:{default:[ga]},$$scope:{ctx:B}}}),Ce=new re({props:{anchor:"transformers.Blip2Model.get_text_features.example",$$slots:{default:[ua]},$$scope:{ctx:B}}}),Tt=new j({props:{name:"get_image_features",anchor:"transformers.Blip2Model.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Blip2Model.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.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for
details.`,name:"pixel_values"},{anchor:"transformers.Blip2Model.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.Blip2Model.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.Blip2Model.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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1315",returnDescription:`
<p>The vision model outputs. If <code>return_dict=True</code>, the output is a <code>BaseModelOutputWithPooling</code> that
contains the image features, the pooled image features and the hidden states if
<code>output_hidden_states=True</code>.</p>
`,returnType:`
<p>vision_outputs (<code>BaseModelOutputWithPooling</code> or tuple of <code>torch.FloatTensor</code>)</p>
`}}),je=new Bo({props:{$$slots:{default:[fa]},$$scope:{ctx:B}}}),Je=new re({props:{anchor:"transformers.Blip2Model.get_image_features.example",$$slots:{default:[_a]},$$scope:{ctx:B}}}),$t=new j({props:{name:"get_qformer_features",anchor:"transformers.Blip2Model.get_qformer_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Blip2Model.get_qformer_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.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for
details.`,name:"pixel_values"},{anchor:"transformers.Blip2Model.get_qformer_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary of the language model. Input tokens can optionally be
provided to serve as text prompt, which the language model can continue.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Blip2Model.get_qformer_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Blip2Model.get_qformer_features.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary of the language model. Only relevant in case an
encoder-decoder language model (like T5) is used.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,name:"decoder_input_ids"},{anchor:"transformers.Blip2Model.get_qformer_features.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>Only relevant in case an encoder-decoder language model (like T5) is used.`,name:"decoder_attention_mask"},{anchor:"transformers.Blip2Model.get_qformer_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.Blip2Model.get_qformer_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.Blip2Model.get_qformer_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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1363",returnDescription:`
<p>The vision model outputs. If <code>return_dict=True</code>, the output is a <code>BaseModelOutputWithPooling</code> that
contains the image features, the pooled image features and the hidden states if
<code>output_hidden_states=True</code>.</p>
`,returnType:`
<p>vision_outputs (<code>BaseModelOutputWithPooling</code> or tuple of <code>torch.FloatTensor</code>)</p>
`}}),xe=new Bo({props:{$$slots:{default:[ba]},$$scope:{ctx:B}}}),Ue=new re({props:{anchor:"transformers.Blip2Model.get_qformer_features.example",$$slots:{default:[va]},$$scope:{ctx:B}}}),Bt=new S({}),kt=new j({props:{name:"class transformers.Blip2ForConditionalGeneration",anchor:"transformers.Blip2ForConditionalGeneration",parameters:[{name:"config",val:": Blip2Config"}],parametersDescription:[{anchor:"transformers.Blip2ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Config">Blip2Config</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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1562"}}),Ct=new j({props:{name:"forward",anchor:"transformers.Blip2ForConditionalGeneration.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"input_ids",val:": FloatTensor"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Blip2ForConditionalGeneration.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.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for
details.`,name:"pixel_values"},{anchor:"transformers.Blip2ForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary of the language model. Input tokens can optionally be
provided to serve as text prompt, which the language model can continue.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/blip-2#transformers.Blip2Processor">Blip2Processor</a>. See <code>Blip2Processor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Blip2ForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Blip2ForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary of the language model. Only relevant in case an
encoder-decoder language model (like T5) is used.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#decoder-input-ids">What are decoder input IDs?</a>`,name:"decoder_input_ids"},{anchor:"transformers.Blip2ForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>Only relevant in case an encoder-decoder language model (like T5) is used.`,name:"decoder_attention_mask"},{anchor:"transformers.Blip2ForConditionalGeneration.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.Blip2ForConditionalGeneration.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.Blip2ForConditionalGeneration.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.33.3/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.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1632",returnDescription:`
<p>A <code>transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGenerationModelOutput</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.blip_2.configuration_blip_2.Blip2VisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code>, <em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) — Language modeling loss from the language model.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head of the language model.</li>
<li><strong>vision_outputs</strong> (<code>BaseModelOutputWithPooling</code>) — Outputs of the vision encoder.</li>
<li><strong>qformer_outputs</strong> (<code>BaseModelOutputWithPoolingAndCrossAttentions</code>) — Outputs of the Q-Former (Querying Transformer).</li>
<li><strong>language_model_outputs</strong> (<code>CausalLMOutputWithPast</code> or <code>Seq2SeqLMOutput</code>) — Outputs of the language model.</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGenerationModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ie=new Bo({props:{$$slots:{default:[ya]},$$scope:{ctx:B}}}),ze=new re({props:{anchor:"transformers.Blip2ForConditionalGeneration.forward.example",$$slots:{default:[Ma]},$$scope:{ctx:B}}}),We=new re({props:{anchor:"transformers.Blip2ForConditionalGeneration.forward.example-2",$$slots:{default:[wa]},$$scope:{ctx:B}}}),jt=new j({props:{name:"generate",anchor:"transformers.Blip2ForConditionalGeneration.generate",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"**generate_kwargs",val:""}],parametersDescription:[{anchor:"transformers.Blip2ForConditionalGeneration.generate.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape (batch_size, num_channels, height, width)) &#x2014;
Input images to be processed.`,name:"pixel_values"},{anchor:"transformers.Blip2ForConditionalGeneration.generate.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape (batch_size, sequence_length), <em>optional</em>) &#x2014;
The sequence used as a prompt for the generation.`,name:"input_ids"},{anchor:"transformers.Blip2ForConditionalGeneration.generate.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape (batch_size, sequence_length), <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices`,name:"attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/blip_2/modeling_blip_2.py#L1792",returnDescription:`
<p>A list of strings of length batch_size * num_captions.</p>
`,returnType:`
<p>captions (list)</p>
`}}),{c(){s=r("meta"),T=l(),m=r("p"),c=l(),u=r("h1"),o=r("a"),$=r("span"),_(Le.$$.fragment),In=l(),Wt=r("span"),Wt.textContent=Es,Eo=l(),R=r("h2"),le=r("a"),ko=r("span"),_(Se.$$.fragment),zn=l(),Ft=r("span"),Ft.textContent=Hs,Ho=l(),Ee=r("p"),Ee.innerHTML=Xs,Xo=l(),He=r("p"),He.textContent=Rs,Ro=l(),Xe=r("p"),Xe.innerHTML=Ys,Yo=l(),Re=r("p"),Re.textContent=As,Ao=l(),Ye=r("ul"),Ye.innerHTML=Ds,Do=l(),ie=r("img"),Oo=l(),Ae=r("small"),Ae.innerHTML=Ks,Ko=l(),De=r("p"),De.innerHTML=er,en=l(),Y=r("h2"),de=r("a"),Co=r("span"),_(Oe.$$.fragment),Wn=l(),Pt=r("span"),Pt.textContent=tr,tn=l(),Ke=r("p"),Ke.textContent=or,on=l(),et=r("ul"),et.innerHTML=nr,nn=l(),tt=r("p"),tt.textContent=sr,sn=l(),A=r("h2"),ce=r("a"),jo=r("span"),_(ot.$$.fragment),Fn=l(),Nt=r("span"),Nt.textContent=rr,rn=l(),U=r("div"),_(nt.$$.fragment),Pn=l(),qt=r("p"),qt.innerHTML=ar,Nn=l(),Gt=r("p"),Gt.innerHTML=lr,qn=l(),_(pe.$$.fragment),Gn=l(),me=r("div"),_(st.$$.fragment),Qn=l(),Qt=r("p"),Qt.innerHTML=ir,an=l(),D=r("h2"),he=r("a"),Jo=r("span"),_(rt.$$.fragment),Vn=l(),Vt=r("span"),Vt.textContent=dr,ln=l(),W=r("div"),_(at.$$.fragment),Ln=l(),Lt=r("p"),Lt.innerHTML=cr,Sn=l(),St=r("p"),St.innerHTML=pr,En=l(),_(ge.$$.fragment),dn=l(),O=r("h2"),ue=r("a"),xo=r("span"),_(lt.$$.fragment),Hn=l(),Et=r("span"),Et.textContent=mr,cn=l(),F=r("div"),_(it.$$.fragment),Xn=l(),Ht=r("p"),Ht.innerHTML=hr,Rn=l(),Xt=r("p"),Xt.innerHTML=gr,Yn=l(),_(fe.$$.fragment),pn=l(),K=r("h2"),_e=r("a"),Uo=r("span"),_(dt.$$.fragment),An=l(),Rt=r("span"),Rt.textContent=ur,mn=l(),Z=r("div"),_(ct.$$.fragment),Dn=l(),Yt=r("p"),Yt.textContent=fr,On=l(),At=r("p"),At.innerHTML=_r,Kn=l(),be=r("div"),_(pt.$$.fragment),es=l(),Dt=r("p"),Dt.innerHTML=br,ts=l(),ve=r("div"),_(mt.$$.fragment),os=l(),Ot=r("p"),Ot.innerHTML=vr,hn=l(),ee=r("h2"),ye=r("a"),Zo=r("span"),_(ht.$$.fragment),ns=l(),Kt=r("span"),Kt.textContent=yr,gn=l(),te=r("div"),_(gt.$$.fragment),ss=l(),E=r("div"),_(ut.$$.fragment),rs=l(),eo=r("p"),eo.innerHTML=Mr,as=l(),_(Me.$$.fragment),un=l(),oe=r("h2"),we=r("a"),Io=r("span"),_(ft.$$.fragment),ls=l(),to=r("span"),to.textContent=wr,fn=l(),L=r("div"),_(_t.$$.fragment),is=l(),oo=r("p"),oo.textContent=Tr,ds=l(),H=r("div"),_(bt.$$.fragment),cs=l(),no=r("p"),no.innerHTML=$r,ps=l(),so=r("ul"),so.innerHTML=Br,_n=l(),ne=r("h2"),Te=r("a"),zo=r("span"),_(vt.$$.fragment),ms=l(),ro=r("span"),ro.textContent=kr,bn=l(),k=r("div"),_(yt.$$.fragment),hs=l(),ao=r("p"),ao.textContent=Cr,gs=l(),lo=r("p"),lo.innerHTML=jr,us=l(),io=r("p"),io.innerHTML=Jr,fs=l(),N=r("div"),_(Mt.$$.fragment),_s=l(),co=r("p"),co.innerHTML=xr,bs=l(),_($e.$$.fragment),vs=l(),_(Be.$$.fragment),ys=l(),q=r("div"),_(wt.$$.fragment),Ms=l(),po=r("p"),po.innerHTML=Ur,ws=l(),_(ke.$$.fragment),Ts=l(),_(Ce.$$.fragment),$s=l(),G=r("div"),_(Tt.$$.fragment),Bs=l(),mo=r("p"),mo.innerHTML=Zr,ks=l(),_(je.$$.fragment),Cs=l(),_(Je.$$.fragment),js=l(),Q=r("div"),_($t.$$.fragment),Js=l(),ho=r("p"),ho.innerHTML=Ir,xs=l(),_(xe.$$.fragment),Us=l(),_(Ue.$$.fragment),vn=l(),se=r("h2"),Ze=r("a"),Wo=r("span"),_(Bt.$$.fragment),Zs=l(),go=r("span"),go.textContent=zr,yn=l(),C=r("div"),_(kt.$$.fragment),Is=l(),uo=r("p"),uo.textContent=Wr,zs=l(),fo=r("p"),fo.innerHTML=Fr,Ws=l(),_o=r("p"),_o.innerHTML=Pr,Fs=l(),bo=r("p"),bo.innerHTML=Nr,Ps=l(),J=r("div"),_(Ct.$$.fragment),Ns=l(),vo=r("p"),vo.innerHTML=qr,qs=l(),_(Ie.$$.fragment),Gs=l(),yo=r("p"),yo.textContent=Gr,Qs=l(),_(ze.$$.fragment),Vs=l(),_(We.$$.fragment),Ls=l(),Fe=r("div"),_(jt.$$.fragment),Ss=l(),Mo=r("p"),Mo.innerHTML=Qr,Mn=l(),Fo=r("p"),this.h()},l(e){const d=la("svelte-1phssyn",document.head);s=a(d,"META",{name:!0,content:!0}),d.forEach(t),T=i(e),m=a(e,"P",{}),f(m).forEach(t),c=i(e),u=a(e,"H1",{class:!0});var Jt=f(u);o=a(Jt,"A",{id:!0,class:!0,href:!0});var Po=f(o);$=a(Po,"SPAN",{});var No=f($);b(Le.$$.fragment,No),No.forEach(t),Po.forEach(t),In=i(Jt),Wt=a(Jt,"SPAN",{"data-svelte-h":!0}),g(Wt)!=="svelte-1ng884h"&&(Wt.textContent=Es),Jt.forEach(t),Eo=i(e),R=a(e,"H2",{class:!0});var xt=f(R);le=a(xt,"A",{id:!0,class:!0,href:!0});var qo=f(le);ko=a(qo,"SPAN",{});var Go=f(ko);b(Se.$$.fragment,Go),Go.forEach(t),qo.forEach(t),zn=i(xt),Ft=a(xt,"SPAN",{"data-svelte-h":!0}),g(Ft)!=="svelte-1jsw1pg"&&(Ft.textContent=Hs),xt.forEach(t),Ho=i(e),Ee=a(e,"P",{"data-svelte-h":!0}),g(Ee)!=="svelte-1tx2g06"&&(Ee.innerHTML=Xs),Xo=i(e),He=a(e,"P",{"data-svelte-h":!0}),g(He)!=="svelte-vfdo9a"&&(He.textContent=Rs),Ro=i(e),Xe=a(e,"P",{"data-svelte-h":!0}),g(Xe)!=="svelte-k65nu1"&&(Xe.innerHTML=Ys),Yo=i(e),Re=a(e,"P",{"data-svelte-h":!0}),g(Re)!=="svelte-axv494"&&(Re.textContent=As),Ao=i(e),Ye=a(e,"UL",{"data-svelte-h":!0}),g(Ye)!=="svelte-1eip0nc"&&(Ye.innerHTML=Ds),Do=i(e),ie=a(e,"IMG",{src:!0,alt:!0,width:!0}),Oo=i(e),Ae=a(e,"SMALL",{"data-svelte-h":!0}),g(Ae)!=="svelte-1f3k680"&&(Ae.innerHTML=Ks),Ko=i(e),De=a(e,"P",{"data-svelte-h":!0}),g(De)!=="svelte-1xpociz"&&(De.innerHTML=er),en=i(e),Y=a(e,"H2",{class:!0});var Ut=f(Y);de=a(Ut,"A",{id:!0,class:!0,href:!0});var Qo=f(de);Co=a(Qo,"SPAN",{});var Vo=f(Co);b(Oe.$$.fragment,Vo),Vo.forEach(t),Qo.forEach(t),Wn=i(Ut),Pt=a(Ut,"SPAN",{"data-svelte-h":!0}),g(Pt)!=="svelte-w4zzv6"&&(Pt.textContent=tr),Ut.forEach(t),tn=i(e),Ke=a(e,"P",{"data-svelte-h":!0}),g(Ke)!=="svelte-11jcle7"&&(Ke.textContent=or),on=i(e),et=a(e,"UL",{"data-svelte-h":!0}),g(et)!=="svelte-1tw7src"&&(et.innerHTML=nr),nn=i(e),tt=a(e,"P",{"data-svelte-h":!0}),g(tt)!=="svelte-1xesile"&&(tt.textContent=sr),sn=i(e),A=a(e,"H2",{class:!0});var Zt=f(A);ce=a(Zt,"A",{id:!0,class:!0,href:!0});var Lo=f(ce);jo=a(Lo,"SPAN",{});var So=f(jo);b(ot.$$.fragment,So),So.forEach(t),Lo.forEach(t),Fn=i(Zt),Nt=a(Zt,"SPAN",{"data-svelte-h":!0}),g(Nt)!=="svelte-isgiwe"&&(Nt.textContent=rr),Zt.forEach(t),rn=i(e),U=a(e,"DIV",{class:!0});var P=f(U);b(nt.$$.fragment,P),Pn=i(P),qt=a(P,"P",{"data-svelte-h":!0}),g(qt)!=="svelte-lev7mi"&&(qt.innerHTML=ar),Nn=i(P),Gt=a(P,"P",{"data-svelte-h":!0}),g(Gt)!=="svelte-cfh5wl"&&(Gt.innerHTML=lr),qn=i(P),b(pe.$$.fragment,P),Gn=i(P),me=a(P,"DIV",{class:!0});var It=f(me);b(st.$$.fragment,It),Qn=i(It),Qt=a(It,"P",{"data-svelte-h":!0}),g(Qt)!=="svelte-1es4piw"&&(Qt.innerHTML=ir),It.forEach(t),P.forEach(t),an=i(e),D=a(e,"H2",{class:!0});var zt=f(D);he=a(zt,"A",{id:!0,class:!0,href:!0});var Vr=f(he);Jo=a(Vr,"SPAN",{});var Lr=f(Jo);b(rt.$$.fragment,Lr),Lr.forEach(t),Vr.forEach(t),Vn=i(zt),Vt=a(zt,"SPAN",{"data-svelte-h":!0}),g(Vt)!=="svelte-17ofdky"&&(Vt.textContent=dr),zt.forEach(t),ln=i(e),W=a(e,"DIV",{class:!0});var Pe=f(W);b(at.$$.fragment,Pe),Ln=i(Pe),Lt=a(Pe,"P",{"data-svelte-h":!0}),g(Lt)!=="svelte-1q956l3"&&(Lt.innerHTML=cr),Sn=i(Pe),St=a(Pe,"P",{"data-svelte-h":!0}),g(St)!=="svelte-cfh5wl"&&(St.innerHTML=pr),En=i(Pe),b(ge.$$.fragment,Pe),Pe.forEach(t),dn=i(e),O=a(e,"H2",{class:!0});var Tn=f(O);ue=a(Tn,"A",{id:!0,class:!0,href:!0});var Sr=f(ue);xo=a(Sr,"SPAN",{});var Er=f(xo);b(lt.$$.fragment,Er),Er.forEach(t),Sr.forEach(t),Hn=i(Tn),Et=a(Tn,"SPAN",{"data-svelte-h":!0}),g(Et)!=="svelte-xx3d22"&&(Et.textContent=mr),Tn.forEach(t),cn=i(e),F=a(e,"DIV",{class:!0});var Ne=f(F);b(it.$$.fragment,Ne),Xn=i(Ne),Ht=a(Ne,"P",{"data-svelte-h":!0}),g(Ht)!=="svelte-1n98byl"&&(Ht.innerHTML=hr),Rn=i(Ne),Xt=a(Ne,"P",{"data-svelte-h":!0}),g(Xt)!=="svelte-414ol6"&&(Xt.innerHTML=gr),Yn=i(Ne),b(fe.$$.fragment,Ne),Ne.forEach(t),pn=i(e),K=a(e,"H2",{class:!0});var $n=f(K);_e=a($n,"A",{id:!0,class:!0,href:!0});var Hr=f(_e);Uo=a(Hr,"SPAN",{});var Xr=f(Uo);b(dt.$$.fragment,Xr),Xr.forEach(t),Hr.forEach(t),An=i($n),Rt=a($n,"SPAN",{"data-svelte-h":!0}),g(Rt)!=="svelte-zr8ioy"&&(Rt.textContent=ur),$n.forEach(t),mn=i(e),Z=a(e,"DIV",{class:!0});var X=f(Z);b(ct.$$.fragment,X),Dn=i(X),Yt=a(X,"P",{"data-svelte-h":!0}),g(Yt)!=="svelte-qq98xh"&&(Yt.textContent=fr),On=i(X),At=a(X,"P",{"data-svelte-h":!0}),g(At)!=="svelte-2rel1t"&&(At.innerHTML=_r),Kn=i(X),be=a(X,"DIV",{class:!0});var Bn=f(be);b(pt.$$.fragment,Bn),es=i(Bn),Dt=a(Bn,"P",{"data-svelte-h":!0}),g(Dt)!=="svelte-8bl32v"&&(Dt.innerHTML=br),Bn.forEach(t),ts=i(X),ve=a(X,"DIV",{class:!0});var kn=f(ve);b(mt.$$.fragment,kn),os=i(kn),Ot=a(kn,"P",{"data-svelte-h":!0}),g(Ot)!=="svelte-1433o95"&&(Ot.innerHTML=vr),kn.forEach(t),X.forEach(t),hn=i(e),ee=a(e,"H2",{class:!0});var Cn=f(ee);ye=a(Cn,"A",{id:!0,class:!0,href:!0});var Rr=f(ye);Zo=a(Rr,"SPAN",{});var Yr=f(Zo);b(ht.$$.fragment,Yr),Yr.forEach(t),Rr.forEach(t),ns=i(Cn),Kt=a(Cn,"SPAN",{"data-svelte-h":!0}),g(Kt)!=="svelte-1fko665"&&(Kt.textContent=yr),Cn.forEach(t),gn=i(e),te=a(e,"DIV",{class:!0});var jn=f(te);b(gt.$$.fragment,jn),ss=i(jn),E=a(jn,"DIV",{class:!0});var wo=f(E);b(ut.$$.fragment,wo),rs=i(wo),eo=a(wo,"P",{"data-svelte-h":!0}),g(eo)!=="svelte-1k0kwt5"&&(eo.innerHTML=Mr),as=i(wo),b(Me.$$.fragment,wo),wo.forEach(t),jn.forEach(t),un=i(e),oe=a(e,"H2",{class:!0});var Jn=f(oe);we=a(Jn,"A",{id:!0,class:!0,href:!0});var Ar=f(we);Io=a(Ar,"SPAN",{});var Dr=f(Io);b(ft.$$.fragment,Dr),Dr.forEach(t),Ar.forEach(t),ls=i(Jn),to=a(Jn,"SPAN",{"data-svelte-h":!0}),g(to)!=="svelte-mfd6uz"&&(to.textContent=wr),Jn.forEach(t),fn=i(e),L=a(e,"DIV",{class:!0});var To=f(L);b(_t.$$.fragment,To),is=i(To),oo=a(To,"P",{"data-svelte-h":!0}),g(oo)!=="svelte-d9cja9"&&(oo.textContent=Tr),ds=i(To),H=a(To,"DIV",{class:!0});var $o=f(H);b(bt.$$.fragment,$o),cs=i($o),no=a($o,"P",{"data-svelte-h":!0}),g(no)!=="svelte-sj4g2x"&&(no.innerHTML=$r),ps=i($o),so=a($o,"UL",{"data-svelte-h":!0}),g(so)!=="svelte-1mo0n1o"&&(so.innerHTML=Br),$o.forEach(t),To.forEach(t),_n=i(e),ne=a(e,"H2",{class:!0});var xn=f(ne);Te=a(xn,"A",{id:!0,class:!0,href:!0});var Or=f(Te);zo=a(Or,"SPAN",{});var Kr=f(zo);b(vt.$$.fragment,Kr),Kr.forEach(t),Or.forEach(t),ms=i(xn),ro=a(xn,"SPAN",{"data-svelte-h":!0}),g(ro)!=="svelte-enx4h1"&&(ro.textContent=kr),xn.forEach(t),bn=i(e),k=a(e,"DIV",{class:!0});var x=f(k);b(yt.$$.fragment,x),hs=i(x),ao=a(x,"P",{"data-svelte-h":!0}),g(ao)!=="svelte-1ib14ae"&&(ao.textContent=Cr),gs=i(x),lo=a(x,"P",{"data-svelte-h":!0}),g(lo)!=="svelte-ev63c"&&(lo.innerHTML=jr),us=i(x),io=a(x,"P",{"data-svelte-h":!0}),g(io)!=="svelte-hswkmf"&&(io.innerHTML=Jr),fs=i(x),N=a(x,"DIV",{class:!0});var qe=f(N);b(Mt.$$.fragment,qe),_s=i(qe),co=a(qe,"P",{"data-svelte-h":!0}),g(co)!=="svelte-qainqh"&&(co.innerHTML=xr),bs=i(qe),b($e.$$.fragment,qe),vs=i(qe),b(Be.$$.fragment,qe),qe.forEach(t),ys=i(x),q=a(x,"DIV",{class:!0});var Ge=f(q);b(wt.$$.fragment,Ge),Ms=i(Ge),po=a(Ge,"P",{"data-svelte-h":!0}),g(po)!=="svelte-qainqh"&&(po.innerHTML=Ur),ws=i(Ge),b(ke.$$.fragment,Ge),Ts=i(Ge),b(Ce.$$.fragment,Ge),Ge.forEach(t),$s=i(x),G=a(x,"DIV",{class:!0});var Qe=f(G);b(Tt.$$.fragment,Qe),Bs=i(Qe),mo=a(Qe,"P",{"data-svelte-h":!0}),g(mo)!=="svelte-qainqh"&&(mo.innerHTML=Zr),ks=i(Qe),b(je.$$.fragment,Qe),Cs=i(Qe),b(Je.$$.fragment,Qe),Qe.forEach(t),js=i(x),Q=a(x,"DIV",{class:!0});var Ve=f(Q);b($t.$$.fragment,Ve),Js=i(Ve),ho=a(Ve,"P",{"data-svelte-h":!0}),g(ho)!=="svelte-qainqh"&&(ho.innerHTML=Ir),xs=i(Ve),b(xe.$$.fragment,Ve),Us=i(Ve),b(Ue.$$.fragment,Ve),Ve.forEach(t),x.forEach(t),vn=i(e),se=a(e,"H2",{class:!0});var Un=f(se);Ze=a(Un,"A",{id:!0,class:!0,href:!0});var ea=f(Ze);Wo=a(ea,"SPAN",{});var ta=f(Wo);b(Bt.$$.fragment,ta),ta.forEach(t),ea.forEach(t),Zs=i(Un),go=a(Un,"SPAN",{"data-svelte-h":!0}),g(go)!=="svelte-1bxkavn"&&(go.textContent=zr),Un.forEach(t),yn=i(e),C=a(e,"DIV",{class:!0});var z=f(C);b(kt.$$.fragment,z),Is=i(z),uo=a(z,"P",{"data-svelte-h":!0}),g(uo)!=="svelte-1fsmwyj"&&(uo.textContent=Wr),zs=i(z),fo=a(z,"P",{"data-svelte-h":!0}),g(fo)!=="svelte-1ks26sg"&&(fo.innerHTML=Fr),Ws=i(z),_o=a(z,"P",{"data-svelte-h":!0}),g(_o)!=="svelte-ev63c"&&(_o.innerHTML=Pr),Fs=i(z),bo=a(z,"P",{"data-svelte-h":!0}),g(bo)!=="svelte-hswkmf"&&(bo.innerHTML=Nr),Ps=i(z),J=a(z,"DIV",{class:!0});var V=f(J);b(Ct.$$.fragment,V),Ns=i(V),vo=a(V,"P",{"data-svelte-h":!0}),g(vo)!=="svelte-bgz885"&&(vo.innerHTML=qr),qs=i(V),b(Ie.$$.fragment,V),Gs=i(V),yo=a(V,"P",{"data-svelte-h":!0}),g(yo)!=="svelte-kvfsh7"&&(yo.textContent=Gr),Qs=i(V),b(ze.$$.fragment,V),Vs=i(V),b(We.$$.fragment,V),V.forEach(t),Ls=i(z),Fe=a(z,"DIV",{class:!0});var Zn=f(Fe);b(jt.$$.fragment,Zn),Ss=i(Zn),Mo=a(Zn,"P",{"data-svelte-h":!0}),g(Mo)!=="svelte-eq620n"&&(Mo.innerHTML=Qr),Zn.forEach(t),z.forEach(t),Mn=i(e),Fo=a(e,"P",{}),f(Fo).forEach(t),this.h()},h(){h(s,"name","hf:doc:metadata"),h(s,"content",JSON.stringify($a)),h(o,"id","blip2"),h(o,"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"),h(o,"href","#blip2"),h(u,"class","relative group"),h(le,"id","overview"),h(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"),h(le,"href","#overview"),h(R,"class","relative group"),na(ie.src,Os="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/blip2_architecture.jpg")||h(ie,"src",Os),h(ie,"alt","drawing"),h(ie,"width","600"),h(de,"id","resources"),h(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(de,"href","#resources"),h(Y,"class","relative group"),h(ce,"id","transformers.Blip2Config"),h(ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ce,"href","#transformers.Blip2Config"),h(A,"class","relative group"),h(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(he,"id","transformers.Blip2VisionConfig"),h(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(he,"href","#transformers.Blip2VisionConfig"),h(D,"class","relative group"),h(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ue,"id","transformers.Blip2QFormerConfig"),h(ue,"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"),h(ue,"href","#transformers.Blip2QFormerConfig"),h(O,"class","relative group"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_e,"id","transformers.Blip2Processor"),h(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(_e,"href","#transformers.Blip2Processor"),h(K,"class","relative group"),h(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ye,"id","transformers.Blip2VisionModel"),h(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"),h(ye,"href","#transformers.Blip2VisionModel"),h(ee,"class","relative group"),h(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(we,"id","transformers.Blip2QFormerModel"),h(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(we,"href","#transformers.Blip2QFormerModel"),h(oe,"class","relative group"),h(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Te,"id","transformers.Blip2Model"),h(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Te,"href","#transformers.Blip2Model"),h(ne,"class","relative group"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ze,"id","transformers.Blip2ForConditionalGeneration"),h(Ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ze,"href","#transformers.Blip2ForConditionalGeneration"),h(se,"class","relative group"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,d){n(document.head,s),p(e,T,d),p(e,m,d),p(e,c,d),p(e,u,d),n(u,o),n(o,$),v(Le,$,null),n(u,In),n(u,Wt),p(e,Eo,d),p(e,R,d),n(R,le),n(le,ko),v(Se,ko,null),n(R,zn),n(R,Ft),p(e,Ho,d),p(e,Ee,d),p(e,Xo,d),p(e,He,d),p(e,Ro,d),p(e,Xe,d),p(e,Yo,d),p(e,Re,d),p(e,Ao,d),p(e,Ye,d),p(e,Do,d),p(e,ie,d),p(e,Oo,d),p(e,Ae,d),p(e,Ko,d),p(e,De,d),p(e,en,d),p(e,Y,d),n(Y,de),n(de,Co),v(Oe,Co,null),n(Y,Wn),n(Y,Pt),p(e,tn,d),p(e,Ke,d),p(e,on,d),p(e,et,d),p(e,nn,d),p(e,tt,d),p(e,sn,d),p(e,A,d),n(A,ce),n(ce,jo),v(ot,jo,null),n(A,Fn),n(A,Nt),p(e,rn,d),p(e,U,d),v(nt,U,null),n(U,Pn),n(U,qt),n(U,Nn),n(U,Gt),n(U,qn),v(pe,U,null),n(U,Gn),n(U,me),v(st,me,null),n(me,Qn),n(me,Qt),p(e,an,d),p(e,D,d),n(D,he),n(he,Jo),v(rt,Jo,null),n(D,Vn),n(D,Vt),p(e,ln,d),p(e,W,d),v(at,W,null),n(W,Ln),n(W,Lt),n(W,Sn),n(W,St),n(W,En),v(ge,W,null),p(e,dn,d),p(e,O,d),n(O,ue),n(ue,xo),v(lt,xo,null),n(O,Hn),n(O,Et),p(e,cn,d),p(e,F,d),v(it,F,null),n(F,Xn),n(F,Ht),n(F,Rn),n(F,Xt),n(F,Yn),v(fe,F,null),p(e,pn,d),p(e,K,d),n(K,_e),n(_e,Uo),v(dt,Uo,null),n(K,An),n(K,Rt),p(e,mn,d),p(e,Z,d),v(ct,Z,null),n(Z,Dn),n(Z,Yt),n(Z,On),n(Z,At),n(Z,Kn),n(Z,be),v(pt,be,null),n(be,es),n(be,Dt),n(Z,ts),n(Z,ve),v(mt,ve,null),n(ve,os),n(ve,Ot),p(e,hn,d),p(e,ee,d),n(ee,ye),n(ye,Zo),v(ht,Zo,null),n(ee,ns),n(ee,Kt),p(e,gn,d),p(e,te,d),v(gt,te,null),n(te,ss),n(te,E),v(ut,E,null),n(E,rs),n(E,eo),n(E,as),v(Me,E,null),p(e,un,d),p(e,oe,d),n(oe,we),n(we,Io),v(ft,Io,null),n(oe,ls),n(oe,to),p(e,fn,d),p(e,L,d),v(_t,L,null),n(L,is),n(L,oo),n(L,ds),n(L,H),v(bt,H,null),n(H,cs),n(H,no),n(H,ps),n(H,so),p(e,_n,d),p(e,ne,d),n(ne,Te),n(Te,zo),v(vt,zo,null),n(ne,ms),n(ne,ro),p(e,bn,d),p(e,k,d),v(yt,k,null),n(k,hs),n(k,ao),n(k,gs),n(k,lo),n(k,us),n(k,io),n(k,fs),n(k,N),v(Mt,N,null),n(N,_s),n(N,co),n(N,bs),v($e,N,null),n(N,vs),v(Be,N,null),n(k,ys),n(k,q),v(wt,q,null),n(q,Ms),n(q,po),n(q,ws),v(ke,q,null),n(q,Ts),v(Ce,q,null),n(k,$s),n(k,G),v(Tt,G,null),n(G,Bs),n(G,mo),n(G,ks),v(je,G,null),n(G,Cs),v(Je,G,null),n(k,js),n(k,Q),v($t,Q,null),n(Q,Js),n(Q,ho),n(Q,xs),v(xe,Q,null),n(Q,Us),v(Ue,Q,null),p(e,vn,d),p(e,se,d),n(se,Ze),n(Ze,Wo),v(Bt,Wo,null),n(se,Zs),n(se,go),p(e,yn,d),p(e,C,d),v(kt,C,null),n(C,Is),n(C,uo),n(C,zs),n(C,fo),n(C,Ws),n(C,_o),n(C,Fs),n(C,bo),n(C,Ps),n(C,J),v(Ct,J,null),n(J,Ns),n(J,vo),n(J,qs),v(Ie,J,null),n(J,Gs),n(J,yo),n(J,Qs),v(ze,J,null),n(J,Vs),v(We,J,null),n(C,Ls),n(C,Fe),v(jt,Fe,null),n(Fe,Ss),n(Fe,Mo),p(e,Mn,d),p(e,Fo,d),wn=!0},p(e,[d]){const Jt={};d&2&&(Jt.$$scope={dirty:d,ctx:e}),pe.$set(Jt);const Po={};d&2&&(Po.$$scope={dirty:d,ctx:e}),ge.$set(Po);const No={};d&2&&(No.$$scope={dirty:d,ctx:e}),fe.$set(No);const xt={};d&2&&(xt.$$scope={dirty:d,ctx:e}),Me.$set(xt);const qo={};d&2&&(qo.$$scope={dirty:d,ctx:e}),$e.$set(qo);const Go={};d&2&&(Go.$$scope={dirty:d,ctx:e}),Be.$set(Go);const Ut={};d&2&&(Ut.$$scope={dirty:d,ctx:e}),ke.$set(Ut);const Qo={};d&2&&(Qo.$$scope={dirty:d,ctx:e}),Ce.$set(Qo);const Vo={};d&2&&(Vo.$$scope={dirty:d,ctx:e}),je.$set(Vo);const Zt={};d&2&&(Zt.$$scope={dirty:d,ctx:e}),Je.$set(Zt);const Lo={};d&2&&(Lo.$$scope={dirty:d,ctx:e}),xe.$set(Lo);const So={};d&2&&(So.$$scope={dirty:d,ctx:e}),Ue.$set(So);const P={};d&2&&(P.$$scope={dirty:d,ctx:e}),Ie.$set(P);const It={};d&2&&(It.$$scope={dirty:d,ctx:e}),ze.$set(It);const zt={};d&2&&(zt.$$scope={dirty:d,ctx:e}),We.$set(zt)},i(e){wn||(y(Le.$$.fragment,e),y(Se.$$.fragment,e),y(Oe.$$.fragment,e),y(ot.$$.fragment,e),y(nt.$$.fragment,e),y(pe.$$.fragment,e),y(st.$$.fragment,e),y(rt.$$.fragment,e),y(at.$$.fragment,e),y(ge.$$.fragment,e),y(lt.$$.fragment,e),y(it.$$.fragment,e),y(fe.$$.fragment,e),y(dt.$$.fragment,e),y(ct.$$.fragment,e),y(pt.$$.fragment,e),y(mt.$$.fragment,e),y(ht.$$.fragment,e),y(gt.$$.fragment,e),y(ut.$$.fragment,e),y(Me.$$.fragment,e),y(ft.$$.fragment,e),y(_t.$$.fragment,e),y(bt.$$.fragment,e),y(vt.$$.fragment,e),y(yt.$$.fragment,e),y(Mt.$$.fragment,e),y($e.$$.fragment,e),y(Be.$$.fragment,e),y(wt.$$.fragment,e),y(ke.$$.fragment,e),y(Ce.$$.fragment,e),y(Tt.$$.fragment,e),y(je.$$.fragment,e),y(Je.$$.fragment,e),y($t.$$.fragment,e),y(xe.$$.fragment,e),y(Ue.$$.fragment,e),y(Bt.$$.fragment,e),y(kt.$$.fragment,e),y(Ct.$$.fragment,e),y(Ie.$$.fragment,e),y(ze.$$.fragment,e),y(We.$$.fragment,e),y(jt.$$.fragment,e),wn=!0)},o(e){M(Le.$$.fragment,e),M(Se.$$.fragment,e),M(Oe.$$.fragment,e),M(ot.$$.fragment,e),M(nt.$$.fragment,e),M(pe.$$.fragment,e),M(st.$$.fragment,e),M(rt.$$.fragment,e),M(at.$$.fragment,e),M(ge.$$.fragment,e),M(lt.$$.fragment,e),M(it.$$.fragment,e),M(fe.$$.fragment,e),M(dt.$$.fragment,e),M(ct.$$.fragment,e),M(pt.$$.fragment,e),M(mt.$$.fragment,e),M(ht.$$.fragment,e),M(gt.$$.fragment,e),M(ut.$$.fragment,e),M(Me.$$.fragment,e),M(ft.$$.fragment,e),M(_t.$$.fragment,e),M(bt.$$.fragment,e),M(vt.$$.fragment,e),M(yt.$$.fragment,e),M(Mt.$$.fragment,e),M($e.$$.fragment,e),M(Be.$$.fragment,e),M(wt.$$.fragment,e),M(ke.$$.fragment,e),M(Ce.$$.fragment,e),M(Tt.$$.fragment,e),M(je.$$.fragment,e),M(Je.$$.fragment,e),M($t.$$.fragment,e),M(xe.$$.fragment,e),M(Ue.$$.fragment,e),M(Bt.$$.fragment,e),M(kt.$$.fragment,e),M(Ct.$$.fragment,e),M(Ie.$$.fragment,e),M(ze.$$.fragment,e),M(We.$$.fragment,e),M(jt.$$.fragment,e),wn=!1},d(e){e&&(t(T),t(m),t(c),t(u),t(Eo),t(R),t(Ho),t(Ee),t(Xo),t(He),t(Ro),t(Xe),t(Yo),t(Re),t(Ao),t(Ye),t(Do),t(ie),t(Oo),t(Ae),t(Ko),t(De),t(en),t(Y),t(tn),t(Ke),t(on),t(et),t(nn),t(tt),t(sn),t(A),t(rn),t(U),t(an),t(D),t(ln),t(W),t(dn),t(O),t(cn),t(F),t(pn),t(K),t(mn),t(Z),t(hn),t(ee),t(gn),t(te),t(un),t(oe),t(fn),t(L),t(_n),t(ne),t(bn),t(k),t(vn),t(se),t(yn),t(C),t(Mn),t(Fo)),t(s),w(Le),w(Se),w(Oe),w(ot),w(nt),w(pe),w(st),w(rt),w(at),w(ge),w(lt),w(it),w(fe),w(dt),w(ct),w(pt),w(mt),w(ht),w(gt),w(ut),w(Me),w(ft),w(_t),w(bt),w(vt),w(yt),w(Mt),w($e),w(Be),w(wt),w(ke),w(Ce),w(Tt),w(je),w(Je),w($t),w(xe),w(Ue),w(Bt),w(kt),w(Ct),w(Ie),w(ze),w(We),w(jt)}}}const $a={local:"blip2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.Blip2Config",title:"Blip2Config"},{local:"transformers.Blip2VisionConfig",title:"Blip2VisionConfig"},{local:"transformers.Blip2QFormerConfig",title:"Blip2QFormerConfig"},{local:"transformers.Blip2Processor",title:"Blip2Processor"},{local:"transformers.Blip2VisionModel",title:"Blip2VisionModel"},{local:"transformers.Blip2QFormerModel",title:"Blip2QFormerModel"},{local:"transformers.Blip2Model",title:"Blip2Model"},{local:"transformers.Blip2ForConditionalGeneration",title:"Blip2ForConditionalGeneration"}],title:"BLIP-2"};function Ba(B){return sa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ia extends ra{constructor(s){super(),aa(this,s,Ba,Ta,oa,{})}}export{Ia as component};
