import{s as Mo,o as yo,n as U}from"../chunks/scheduler.9bc65507.js";import{S as wo,i as $o,g as p,s as r,r as g,A as Bo,h as m,f as i,c as l,j,u as h,x as y,k as C,y as a,a as f,v as _,d as b,t as T,w as v}from"../chunks/index.707bf1b6.js";import{T as It}from"../chunks/Tip.c2ecdbf4.js";import{D as I}from"../chunks/Docstring.570ddb64.js";import{C as Ut}from"../chunks/CodeBlock.54a9f38d.js";import{F as xo,M as vo}from"../chunks/Markdown.fef84341.js";import{E as Ft}from"../chunks/ExampleCodeBlock.bc2be6bc.js";import{H as ye,E as Jo}from"../chunks/EditOnGithub.922df6ba.js";function jo(x){let e,u="Example:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsaXBDb25maWclMkMlMjBCbGlwTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmxpcENvbmZpZyUyMHdpdGglMjBTYWxlc2ZvcmNlJTJGYmxpcC12cWEtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCbGlwQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmxpcFBNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwU2FsZXNmb3JjZSUyRmJsaXAtdnFhLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEJsaXBNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWclMEElMEElMjMlMjBXZSUyMGNhbiUyMGFsc28lMjBpbml0aWFsaXplJTIwYSUyMEJsaXBDb25maWclMjBmcm9tJTIwYSUyMEJsaXBUZXh0Q29uZmlnJTIwYW5kJTIwYSUyMEJsaXBWaXNpb25Db25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQkxJUFRleHQlMjBhbmQlMjBCTElQVmlzaW9uJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ190ZXh0JTIwJTNEJTIwQmxpcFRleHRDb25maWcoKSUwQWNvbmZpZ192aXNpb24lMjAlM0QlMjBCbGlwVmlzaW9uQ29uZmlnKCklMEElMEFjb25maWclMjAlM0QlMjBCbGlwQ29uZmlnLmZyb21fdGV4dF92aXNpb25fY29uZmlncyhjb25maWdfdGV4dCUyQyUyMGNvbmZpZ192aXNpb24p",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlipConfig, BlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BlipConfig with Salesforce/blip-vqa-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BlipConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BlipPModel (with random weights) from the Salesforce/blip-vqa-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipModel(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 BlipConfig from a BlipTextConfig and a BlipVisionConfig</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BLIPText and BLIPVision configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = BlipTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = BlipVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = BlipConfig.from_text_vision_configs(config_text, config_vision)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-11lpom8"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Co(x){let e,u="Example:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsaXBUZXh0Q29uZmlnJTJDJTIwQmxpcFRleHRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCbGlwVGV4dENvbmZpZyUyMHdpdGglMjBTYWxlc2ZvcmNlJTJGYmxpcC12cWEtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCbGlwVGV4dENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJsaXBUZXh0TW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMFNhbGVzZm9yY2UlMkZibGlwLXZxYS1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBCbGlwVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlipTextConfig, BlipTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BlipTextConfig with Salesforce/blip-vqa-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BlipTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BlipTextModel (with random weights) from the Salesforce/blip-vqa-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipTextModel(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`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-11lpom8"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Io(x){let e,u="Example:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsaXBWaXNpb25Db25maWclMkMlMjBCbGlwVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmxpcFZpc2lvbkNvbmZpZyUyMHdpdGglMjBTYWxlc2ZvcmNlJTJGYmxpcC12cWEtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCbGlwVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmxpcFZpc2lvbk1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBTYWxlc2ZvcmNlJTJGYmxpcC12cWEtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmxpcFZpc2lvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlipVisionConfig, BlipVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BlipVisionConfig with Salesforce/blip-vqa-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BlipVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BlipVisionModel (with random weights) from the Salesforce/blip-vqa-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipVisionModel(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`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-11lpom8"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Fo(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Uo(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEJsaXBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQmxpcE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC1pbWFnZS1jYXB0aW9uaW5nLWJhc2UlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaW1hZ2UtY2FwdGlvbmluZy1iYXNlJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwbG9naXRzX3Blcl9pbWFnZS5zb2Z0bWF4KGRpbSUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&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(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function ko(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function zo(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBCbGlwTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEJsaXBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaW1hZ2UtY2FwdGlvbmluZy1iYXNlJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWltYWdlLWNhcHRpb25pbmctYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF0ZXh0X2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X3RleHRfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=[<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>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Wo(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Zo(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEJsaXBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQmxpcE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC1pbWFnZS1jYXB0aW9uaW5nLWJhc2UlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaW1hZ2UtY2FwdGlvbmluZy1iYXNlJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&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>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function No(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Vo(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Po(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEJsaXBGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC1pbWFnZS1jYXB0aW9uaW5nLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBCbGlwRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC1pbWFnZS1jYXB0aW9uaW5nLWJhc2UlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQXRleHQlMjAlM0QlMjAlMjJBJTIwcGljdHVyZSUyMG9mJTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwdGV4dCUzRHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BlipForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&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>text = <span class="hljs-string">&quot;A picture of&quot;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Ho(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Ro(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEJsaXBGb3JJbWFnZVRleHRSZXRyaWV2YWwlMEElMEFtb2RlbCUyMCUzRCUyMEJsaXBGb3JJbWFnZVRleHRSZXRyaWV2YWwuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWl0bS1iYXNlLWNvY28lMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaXRtLWJhc2UtY29jbyUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dCUyMCUzRCUyMCUyMmFuJTIwaW1hZ2UlMjBvZiUyMGElMjBjYXQlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjB0ZXh0JTNEdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BlipForImageTextRetrieval

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipForImageTextRetrieval.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-itm-base-coco&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-itm-base-coco&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>text = <span class="hljs-string">&quot;an image of a cat&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Go(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function qo(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEJsaXBGb3JRdWVzdGlvbkFuc3dlcmluZyUwQSUwQW1vZGVsJTIwJTNEJTIwQmxpcEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC12cWEtYmFzZSUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC12cWEtYmFzZSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBJTIzJTIwdHJhaW5pbmclMEF0ZXh0JTIwJTNEJTIwJTIySG93JTIwbWFueSUyMGNhdHMlMjBhcmUlMjBpbiUyMHRoZSUyMHBpY3R1cmUlM0YlMjIlMEFsYWJlbCUyMCUzRCUyMCUyMjIlMjIlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjB0ZXh0JTNEdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBbGFiZWxzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0RsYWJlbCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQWlucHV0cyU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMGxhYmVscyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9zcy5iYWNrd2FyZCgpJTBBJTBBJTIzJTIwaW5mZXJlbmNlJTBBdGV4dCUyMCUzRCUyMCUyMkhvdyUyMG1hbnklMjBjYXRzJTIwYXJlJTIwaW4lMjB0aGUlMjBwaWN0dXJlJTNGJTIyJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwdGV4dCUzRHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyklMEFwcmludChwcm9jZXNzb3IuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BlipForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BlipForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-vqa-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-vqa-base&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><span class="hljs-comment"># training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are in the picture?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>label = <span class="hljs-string">&quot;2&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = processor(text=label, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = labels
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.backward()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are in the picture?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(processor.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
<span class="hljs-number">2</span>`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Lo(x){let e,u,o,n,M,t,w=`This model inherits from <a href="/docs/transformers/v4.40.2/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.)`,oo,le,bo=`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.`,no,k,kt,Le,ze,We='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipModel">BlipModel</a> forward method, overrides the <code>__call__</code> special method.',Ke,fe,Xt,et,mt,X,tt,ue,Et,ge='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipModel">BlipModel</a> forward method, overrides the <code>__call__</code> special method.',we,ft,ut,$e,so,z,zt,Xe,Be,gt='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipModel">BlipModel</a> forward method, overrides the <code>__call__</code> special method.',E,W,ht,xe,Wt,Zt,_t,R,Je,ot,Ee,Nt=`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in <a href="https://arxiv.org/abs/1706.03762" rel="nofollow">Attention is
all you need</a> by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and <code>is_decoder</code> set to <code>True</code>; an
<code>encoder_hidden_states</code> is then expected as an input to the forward pass.`,bt,D,je,Vt,nt,he=`encoder_hidden_states  (<code>torch.FloatTensor</code>, <em>optional</em>):
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>, <em>optional</em>):
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>:`,st,S,ie=`<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>, <em>optional</em>):
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>, <em>optional</em>):
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>`,at,Ze,Pt,rt,Ne,Tt,Ce,Q,St,F,vt='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel">BlipVisionModel</a> forward method, overrides the <code>__call__</code> special method.',de,O,lo,Ve,Ht,ne,Pe,Qt,Yt,Mt=`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
<code>input_ids</code> to the model, which serve as a text prompt, to make the text decoder continue the prompt. Otherwise,
the decoder starts generating text from the [BOS] (beginning-of-sequence) token. will start generating the caption
from the text input. If no text input is provided, the decoder will start with the [BOS] token only.`,ce,se,io=`This model inherits from <a href="/docs/transformers/v4.40.2/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.)`,V,Se,ho=`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.`,Ie,Fe,_e,yt,Qe,co='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipForConditionalGeneration">BlipForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Z,Y,po,ae,_o,wt,be,P,$t,Ye,ao,mo=`BLIP Model with a vision and text projector, and a classification head on top. The model is used in the context of
image-text retrieval. Given an image and a text, the model returns the probability of the text being relevant to
the image.`,A,Ue,He=`This model inherits from <a href="/docs/transformers/v4.40.2/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.)`,Re,At,Dt=`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.`,Bt,Te,G,lt,Ge,Rt='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipForImageTextRetrieval">BlipForImageTextRetrieval</a> forward method, overrides the <code>__call__</code> special method.',re,pe,it,ve,xt,dt,Ae,K,s,$,ee,Gt=`BLIP Model for visual question answering. The model consists of a vision encoder, a text encoder as well as a text
decoder. The vision encoder will encode the input image, the text encoder will encode the input question together
with the encoding of the image, and the text decoder will output the answer to the question.`,N,H,De=`This model inherits from <a href="/docs/transformers/v4.40.2/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.)`,Jt,qt,Ot=`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.`,Oe,ct,pt,To,d,J='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipForQuestionAnswering">BlipForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',jt,Me,Ct,qe,Lt;return e=new ye({props:{title:"BlipModel",local:"transformers.BlipModel",headingTag:"h2"}}),n=new I({props:{name:"class transformers.BlipModel",anchor:"transformers.BlipModel",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L706"}}),kt=new I({props:{name:"forward",anchor:"transformers.BlipModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"pixel_values",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"return_loss",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.40.2/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlipModel.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.BlipModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BlipModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.BlipModel.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.BlipModel.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.BlipModel.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L817",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_blip.BlipOutput</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.configuration_blip.BlipConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_blip.BlipOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new It({props:{$$slots:{default:[Fo]},$$scope:{ctx:x}}}),et=new Ft({props:{anchor:"transformers.BlipModel.forward.example",$$slots:{default:[Uo]},$$scope:{ctx:x}}}),tt=new I({props:{name:"get_text_features",anchor:"transformers.BlipModel.get_text_features",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.40.2/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlipModel.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>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BlipModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BlipModel.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.BlipModel.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.BlipModel.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L742",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),ft=new It({props:{$$slots:{default:[ko]},$$scope:{ctx:x}}}),$e=new Ft({props:{anchor:"transformers.BlipModel.get_text_features.example",$$slots:{default:[zo]},$$scope:{ctx:x}}}),zt=new I({props:{name:"get_image_features",anchor:"transformers.BlipModel.get_image_features",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipModel.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.BlipModel.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.BlipModel.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L780",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),W=new It({props:{$$slots:{default:[Wo]},$$scope:{ctx:x}}}),xe=new Ft({props:{anchor:"transformers.BlipModel.get_image_features.example",$$slots:{default:[Zo]},$$scope:{ctx:x}}}),Zt=new ye({props:{title:"BlipTextModel",local:"transformers.BlipTextModel",headingTag:"h2"}}),Je=new I({props:{name:"class transformers.BlipTextModel",anchor:"transformers.BlipTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_blip_text.py#L567"}}),je=new I({props:{name:"forward",anchor:"transformers.BlipTextModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"encoder_embeds",val:": Optional = None"},{name:"encoder_hidden_states",val:": Optional = None"},{name:"encoder_attention_mask",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"is_decoder",val:": Optional = False"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_blip_text.py#L666"}}),Ze=new ye({props:{title:"BlipVisionModel",local:"transformers.BlipVisionModel",headingTag:"h2"}}),Ne=new I({props:{name:"class transformers.BlipVisionModel",anchor:"transformers.BlipVisionModel",parameters:[{name:"config",val:": BlipVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_blip.py#L640"}}),Q=new I({props:{name:"forward",anchor:"transformers.BlipVisionModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipVisionModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipVisionModel.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.BlipVisionModel.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.BlipVisionModel.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L655",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.40.2/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.configuration_blip.BlipVisionConfig'&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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.40.2/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new It({props:{$$slots:{default:[No]},$$scope:{ctx:x}}}),Ve=new ye({props:{title:"BlipForConditionalGeneration",local:"transformers.BlipForConditionalGeneration",headingTag:"h2"}}),Pe=new I({props:{name:"class transformers.BlipForConditionalGeneration",anchor:"transformers.BlipForConditionalGeneration",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L911"}}),_e=new I({props:{name:"forward",anchor:"transformers.BlipForConditionalGeneration.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipForConditionalGeneration.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipForConditionalGeneration.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.BlipForConditionalGeneration.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.BlipForConditionalGeneration.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L941",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_blip.BlipForConditionalGenerationModelOutput</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.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><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>) — Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>, <em>optional</em>) — Prediction scores of the language modeling head of the text decoder model.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>) — The image embeddings obtained after applying the Vision Transformer model to the input image.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>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) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_blip.BlipForConditionalGenerationModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new It({props:{$$slots:{default:[Vo]},$$scope:{ctx:x}}}),ae=new Ft({props:{anchor:"transformers.BlipForConditionalGeneration.forward.example",$$slots:{default:[Po]},$$scope:{ctx:x}}}),wt=new ye({props:{title:"BlipForImageTextRetrieval",local:"transformers.BlipForImageTextRetrieval",headingTag:"h2"}}),$t=new I({props:{name:"class transformers.BlipForImageTextRetrieval",anchor:"transformers.BlipForImageTextRetrieval",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForImageTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L1306"}}),G=new I({props:{name:"forward",anchor:"transformers.BlipForImageTextRetrieval.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"pixel_values",val:": FloatTensor"},{name:"use_itm_head",val:": Optional = True"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipForImageTextRetrieval.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipForImageTextRetrieval.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.BlipForImageTextRetrieval.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.BlipForImageTextRetrieval.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L1350",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_blip.BlipTextVisionModelOutput</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.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) — The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<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>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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_blip.BlipTextVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new It({props:{$$slots:{default:[Ho]},$$scope:{ctx:x}}}),ve=new Ft({props:{anchor:"transformers.BlipForImageTextRetrieval.forward.example",$$slots:{default:[Ro]},$$scope:{ctx:x}}}),dt=new ye({props:{title:"BlipForQuestionAnswering",local:"transformers.BlipForQuestionAnswering",headingTag:"h2"}}),s=new I({props:{name:"class transformers.BlipForQuestionAnswering",anchor:"transformers.BlipForQuestionAnswering",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L1084"}}),pt=new I({props:{name:"forward",anchor:"transformers.BlipForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"pixel_values",val:": FloatTensor"},{name:"decoder_input_ids",val:": Optional = None"},{name:"decoder_attention_mask",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.BlipForQuestionAnswering.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipForQuestionAnswering.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.BlipForQuestionAnswering.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.BlipForQuestionAnswering.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.40.2/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.40.2/src/transformers/models/blip/modeling_blip.py#L1114",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_blip.BlipTextVisionModelOutput</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.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) — The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<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>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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_blip.BlipTextVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new It({props:{$$slots:{default:[Go]},$$scope:{ctx:x}}}),qe=new Ft({props:{anchor:"transformers.BlipForQuestionAnswering.forward.example",$$slots:{default:[qo]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment),u=r(),o=p("div"),g(n.$$.fragment),M=r(),t=p("p"),t.innerHTML=w,oo=r(),le=p("p"),le.innerHTML=bo,no=r(),k=p("div"),g(kt.$$.fragment),Le=r(),ze=p("p"),ze.innerHTML=We,Ke=r(),g(fe.$$.fragment),Xt=r(),g(et.$$.fragment),mt=r(),X=p("div"),g(tt.$$.fragment),ue=r(),Et=p("p"),Et.innerHTML=ge,we=r(),g(ft.$$.fragment),ut=r(),g($e.$$.fragment),so=r(),z=p("div"),g(zt.$$.fragment),Xe=r(),Be=p("p"),Be.innerHTML=gt,E=r(),g(W.$$.fragment),ht=r(),g(xe.$$.fragment),Wt=r(),g(Zt.$$.fragment),_t=r(),R=p("div"),g(Je.$$.fragment),ot=r(),Ee=p("p"),Ee.innerHTML=Nt,bt=r(),D=p("div"),g(je.$$.fragment),Vt=r(),nt=p("p"),nt.innerHTML=he,st=r(),S=p("ul"),S.innerHTML=ie,at=r(),g(Ze.$$.fragment),Pt=r(),rt=p("div"),g(Ne.$$.fragment),Tt=r(),Ce=p("div"),g(Q.$$.fragment),St=r(),F=p("p"),F.innerHTML=vt,de=r(),g(O.$$.fragment),lo=r(),g(Ve.$$.fragment),Ht=r(),ne=p("div"),g(Pe.$$.fragment),Qt=r(),Yt=p("p"),Yt.innerHTML=Mt,ce=r(),se=p("p"),se.innerHTML=io,V=r(),Se=p("p"),Se.innerHTML=ho,Ie=r(),Fe=p("div"),g(_e.$$.fragment),yt=r(),Qe=p("p"),Qe.innerHTML=co,Z=r(),g(Y.$$.fragment),po=r(),g(ae.$$.fragment),_o=r(),g(wt.$$.fragment),be=r(),P=p("div"),g($t.$$.fragment),Ye=r(),ao=p("p"),ao.textContent=mo,A=r(),Ue=p("p"),Ue.innerHTML=He,Re=r(),At=p("p"),At.innerHTML=Dt,Bt=r(),Te=p("div"),g(G.$$.fragment),lt=r(),Ge=p("p"),Ge.innerHTML=Rt,re=r(),g(pe.$$.fragment),it=r(),g(ve.$$.fragment),xt=r(),g(dt.$$.fragment),Ae=r(),K=p("div"),g(s.$$.fragment),$=r(),ee=p("p"),ee.textContent=Gt,N=r(),H=p("p"),H.innerHTML=De,Jt=r(),qt=p("p"),qt.innerHTML=Ot,Oe=r(),ct=p("div"),g(pt.$$.fragment),To=r(),d=p("p"),d.innerHTML=J,jt=r(),g(Me.$$.fragment),Ct=r(),g(qe.$$.fragment),this.h()},l(c){h(e.$$.fragment,c),u=l(c),o=m(c,"DIV",{class:!0});var B=j(o);h(n.$$.fragment,B),M=l(B),t=m(B,"P",{"data-svelte-h":!0}),y(t)!=="svelte-rwvg7n"&&(t.innerHTML=w),oo=l(B),le=m(B,"P",{"data-svelte-h":!0}),y(le)!=="svelte-hswkmf"&&(le.innerHTML=bo),no=l(B),k=m(B,"DIV",{class:!0});var q=j(k);h(kt.$$.fragment,q),Le=l(q),ze=m(q,"P",{"data-svelte-h":!0}),y(ze)!=="svelte-et59zv"&&(ze.innerHTML=We),Ke=l(q),h(fe.$$.fragment,q),Xt=l(q),h(et.$$.fragment,q),q.forEach(i),mt=l(B),X=m(B,"DIV",{class:!0});var te=j(X);h(tt.$$.fragment,te),ue=l(te),Et=m(te,"P",{"data-svelte-h":!0}),y(Et)!=="svelte-et59zv"&&(Et.innerHTML=ge),we=l(te),h(ft.$$.fragment,te),ut=l(te),h($e.$$.fragment,te),te.forEach(i),so=l(B),z=m(B,"DIV",{class:!0});var L=j(z);h(zt.$$.fragment,L),Xe=l(L),Be=m(L,"P",{"data-svelte-h":!0}),y(Be)!=="svelte-et59zv"&&(Be.innerHTML=gt),E=l(L),h(W.$$.fragment,L),ht=l(L),h(xe.$$.fragment,L),L.forEach(i),B.forEach(i),Wt=l(c),h(Zt.$$.fragment,c),_t=l(c),R=m(c,"DIV",{class:!0});var me=j(R);h(Je.$$.fragment,me),ot=l(me),Ee=m(me,"P",{"data-svelte-h":!0}),y(Ee)!=="svelte-ehxhk2"&&(Ee.innerHTML=Nt),bt=l(me),D=m(me,"DIV",{class:!0});var oe=j(D);h(je.$$.fragment,oe),Vt=l(oe),nt=m(oe,"P",{"data-svelte-h":!0}),y(nt)!=="svelte-1misbdl"&&(nt.innerHTML=he),st=l(oe),S=m(oe,"UL",{"data-svelte-h":!0}),y(S)!=="svelte-64obm2"&&(S.innerHTML=ie),oe.forEach(i),me.forEach(i),at=l(c),h(Ze.$$.fragment,c),Pt=l(c),rt=m(c,"DIV",{class:!0});var ke=j(rt);h(Ne.$$.fragment,ke),Tt=l(ke),Ce=m(ke,"DIV",{class:!0});var ro=j(Ce);h(Q.$$.fragment,ro),St=l(ro),F=m(ro,"P",{"data-svelte-h":!0}),y(F)!=="svelte-1fvc5n"&&(F.innerHTML=vt),de=l(ro),h(O.$$.fragment,ro),ro.forEach(i),ke.forEach(i),lo=l(c),h(Ve.$$.fragment,c),Ht=l(c),ne=m(c,"DIV",{class:!0});var Kt=j(ne);h(Pe.$$.fragment,Kt),Qt=l(Kt),Yt=m(Kt,"P",{"data-svelte-h":!0}),y(Yt)!=="svelte-u9sua2"&&(Yt.innerHTML=Mt),ce=l(Kt),se=m(Kt,"P",{"data-svelte-h":!0}),y(se)!=="svelte-rwvg7n"&&(se.innerHTML=io),V=l(Kt),Se=m(Kt,"P",{"data-svelte-h":!0}),y(Se)!=="svelte-hswkmf"&&(Se.innerHTML=ho),Ie=l(Kt),Fe=m(Kt,"DIV",{class:!0});var fo=j(Fe);h(_e.$$.fragment,fo),yt=l(fo),Qe=m(fo,"P",{"data-svelte-h":!0}),y(Qe)!=="svelte-1w6a32b"&&(Qe.innerHTML=co),Z=l(fo),h(Y.$$.fragment,fo),po=l(fo),h(ae.$$.fragment,fo),fo.forEach(i),Kt.forEach(i),_o=l(c),h(wt.$$.fragment,c),be=l(c),P=m(c,"DIV",{class:!0});var eo=j(P);h($t.$$.fragment,eo),Ye=l(eo),ao=m(eo,"P",{"data-svelte-h":!0}),y(ao)!=="svelte-1cwza0e"&&(ao.textContent=mo),A=l(eo),Ue=m(eo,"P",{"data-svelte-h":!0}),y(Ue)!=="svelte-rwvg7n"&&(Ue.innerHTML=He),Re=l(eo),At=m(eo,"P",{"data-svelte-h":!0}),y(At)!=="svelte-hswkmf"&&(At.innerHTML=Dt),Bt=l(eo),Te=m(eo,"DIV",{class:!0});var uo=j(Te);h(G.$$.fragment,uo),lt=l(uo),Ge=m(uo,"P",{"data-svelte-h":!0}),y(Ge)!=="svelte-15232uz"&&(Ge.innerHTML=Rt),re=l(uo),h(pe.$$.fragment,uo),it=l(uo),h(ve.$$.fragment,uo),uo.forEach(i),eo.forEach(i),xt=l(c),h(dt.$$.fragment,c),Ae=l(c),K=m(c,"DIV",{class:!0});var to=j(K);h(s.$$.fragment,to),$=l(to),ee=m(to,"P",{"data-svelte-h":!0}),y(ee)!=="svelte-tf7otj"&&(ee.textContent=Gt),N=l(to),H=m(to,"P",{"data-svelte-h":!0}),y(H)!=="svelte-rwvg7n"&&(H.innerHTML=De),Jt=l(to),qt=m(to,"P",{"data-svelte-h":!0}),y(qt)!=="svelte-hswkmf"&&(qt.innerHTML=Ot),Oe=l(to),ct=m(to,"DIV",{class:!0});var go=j(ct);h(pt.$$.fragment,go),To=l(go),d=m(go,"P",{"data-svelte-h":!0}),y(d)!=="svelte-1qnfbab"&&(d.innerHTML=J),jt=l(go),h(Me.$$.fragment,go),Ct=l(go),h(qe.$$.fragment,go),go.forEach(i),to.forEach(i),this.h()},h(){C(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(c,B){_(e,c,B),f(c,u,B),f(c,o,B),_(n,o,null),a(o,M),a(o,t),a(o,oo),a(o,le),a(o,no),a(o,k),_(kt,k,null),a(k,Le),a(k,ze),a(k,Ke),_(fe,k,null),a(k,Xt),_(et,k,null),a(o,mt),a(o,X),_(tt,X,null),a(X,ue),a(X,Et),a(X,we),_(ft,X,null),a(X,ut),_($e,X,null),a(o,so),a(o,z),_(zt,z,null),a(z,Xe),a(z,Be),a(z,E),_(W,z,null),a(z,ht),_(xe,z,null),f(c,Wt,B),_(Zt,c,B),f(c,_t,B),f(c,R,B),_(Je,R,null),a(R,ot),a(R,Ee),a(R,bt),a(R,D),_(je,D,null),a(D,Vt),a(D,nt),a(D,st),a(D,S),f(c,at,B),_(Ze,c,B),f(c,Pt,B),f(c,rt,B),_(Ne,rt,null),a(rt,Tt),a(rt,Ce),_(Q,Ce,null),a(Ce,St),a(Ce,F),a(Ce,de),_(O,Ce,null),f(c,lo,B),_(Ve,c,B),f(c,Ht,B),f(c,ne,B),_(Pe,ne,null),a(ne,Qt),a(ne,Yt),a(ne,ce),a(ne,se),a(ne,V),a(ne,Se),a(ne,Ie),a(ne,Fe),_(_e,Fe,null),a(Fe,yt),a(Fe,Qe),a(Fe,Z),_(Y,Fe,null),a(Fe,po),_(ae,Fe,null),f(c,_o,B),_(wt,c,B),f(c,be,B),f(c,P,B),_($t,P,null),a(P,Ye),a(P,ao),a(P,A),a(P,Ue),a(P,Re),a(P,At),a(P,Bt),a(P,Te),_(G,Te,null),a(Te,lt),a(Te,Ge),a(Te,re),_(pe,Te,null),a(Te,it),_(ve,Te,null),f(c,xt,B),_(dt,c,B),f(c,Ae,B),f(c,K,B),_(s,K,null),a(K,$),a(K,ee),a(K,N),a(K,H),a(K,Jt),a(K,qt),a(K,Oe),a(K,ct),_(pt,ct,null),a(ct,To),a(ct,d),a(ct,jt),_(Me,ct,null),a(ct,Ct),_(qe,ct,null),Lt=!0},p(c,B){const q={};B&2&&(q.$$scope={dirty:B,ctx:c}),fe.$set(q);const te={};B&2&&(te.$$scope={dirty:B,ctx:c}),et.$set(te);const L={};B&2&&(L.$$scope={dirty:B,ctx:c}),ft.$set(L);const me={};B&2&&(me.$$scope={dirty:B,ctx:c}),$e.$set(me);const oe={};B&2&&(oe.$$scope={dirty:B,ctx:c}),W.$set(oe);const ke={};B&2&&(ke.$$scope={dirty:B,ctx:c}),xe.$set(ke);const ro={};B&2&&(ro.$$scope={dirty:B,ctx:c}),O.$set(ro);const Kt={};B&2&&(Kt.$$scope={dirty:B,ctx:c}),Y.$set(Kt);const fo={};B&2&&(fo.$$scope={dirty:B,ctx:c}),ae.$set(fo);const eo={};B&2&&(eo.$$scope={dirty:B,ctx:c}),pe.$set(eo);const uo={};B&2&&(uo.$$scope={dirty:B,ctx:c}),ve.$set(uo);const to={};B&2&&(to.$$scope={dirty:B,ctx:c}),Me.$set(to);const go={};B&2&&(go.$$scope={dirty:B,ctx:c}),qe.$set(go)},i(c){Lt||(b(e.$$.fragment,c),b(n.$$.fragment,c),b(kt.$$.fragment,c),b(fe.$$.fragment,c),b(et.$$.fragment,c),b(tt.$$.fragment,c),b(ft.$$.fragment,c),b($e.$$.fragment,c),b(zt.$$.fragment,c),b(W.$$.fragment,c),b(xe.$$.fragment,c),b(Zt.$$.fragment,c),b(Je.$$.fragment,c),b(je.$$.fragment,c),b(Ze.$$.fragment,c),b(Ne.$$.fragment,c),b(Q.$$.fragment,c),b(O.$$.fragment,c),b(Ve.$$.fragment,c),b(Pe.$$.fragment,c),b(_e.$$.fragment,c),b(Y.$$.fragment,c),b(ae.$$.fragment,c),b(wt.$$.fragment,c),b($t.$$.fragment,c),b(G.$$.fragment,c),b(pe.$$.fragment,c),b(ve.$$.fragment,c),b(dt.$$.fragment,c),b(s.$$.fragment,c),b(pt.$$.fragment,c),b(Me.$$.fragment,c),b(qe.$$.fragment,c),Lt=!0)},o(c){T(e.$$.fragment,c),T(n.$$.fragment,c),T(kt.$$.fragment,c),T(fe.$$.fragment,c),T(et.$$.fragment,c),T(tt.$$.fragment,c),T(ft.$$.fragment,c),T($e.$$.fragment,c),T(zt.$$.fragment,c),T(W.$$.fragment,c),T(xe.$$.fragment,c),T(Zt.$$.fragment,c),T(Je.$$.fragment,c),T(je.$$.fragment,c),T(Ze.$$.fragment,c),T(Ne.$$.fragment,c),T(Q.$$.fragment,c),T(O.$$.fragment,c),T(Ve.$$.fragment,c),T(Pe.$$.fragment,c),T(_e.$$.fragment,c),T(Y.$$.fragment,c),T(ae.$$.fragment,c),T(wt.$$.fragment,c),T($t.$$.fragment,c),T(G.$$.fragment,c),T(pe.$$.fragment,c),T(ve.$$.fragment,c),T(dt.$$.fragment,c),T(s.$$.fragment,c),T(pt.$$.fragment,c),T(Me.$$.fragment,c),T(qe.$$.fragment,c),Lt=!1},d(c){c&&(i(u),i(o),i(Wt),i(_t),i(R),i(at),i(Pt),i(rt),i(lo),i(Ht),i(ne),i(_o),i(be),i(P),i(xt),i(Ae),i(K)),v(e,c),v(n),v(kt),v(fe),v(et),v(tt),v(ft),v($e),v(zt),v(W),v(xe),v(Zt,c),v(Je),v(je),v(Ze,c),v(Ne),v(Q),v(O),v(Ve,c),v(Pe),v(_e),v(Y),v(ae),v(wt,c),v($t),v(G),v(pe),v(ve),v(dt,c),v(s),v(pt),v(Me),v(qe)}}}function Xo(x){let e,u;return e=new vo({props:{$$slots:{default:[Lo]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment)},l(o){h(e.$$.fragment,o)},m(o,n){_(e,o,n),u=!0},p(o,n){const M={};n&2&&(M.$$scope={dirty:n,ctx:o}),e.$set(M)},i(o){u||(b(e.$$.fragment,o),u=!0)},o(o){T(e.$$.fragment,o),u=!1},d(o){v(e,o)}}}function Eo(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function So(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQmxpcE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkJsaXBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaW1hZ2UtY2FwdGlvbmluZy1iYXNlJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWltYWdlLWNhcHRpb25pbmctYmFzZSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMHRleHQlM0QlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUwQSklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzX3Blcl9pbWFnZSUyMCUzRCUyMG91dHB1dHMubG9naXRzX3Blcl9pbWFnZSUyMCUyMCUyMyUyMHRoaXMlMjBpcyUyMHRoZSUyMGltYWdlLXRleHQlMjBzaW1pbGFyaXR5JTIwc2NvcmUlMEFwcm9icyUyMCUzRCUyMHRmLm5uLnNvZnRtYXgobG9naXRzX3Blcl9pbWFnZSUyQyUyMGF4aXMlM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFBlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBlipModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&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(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = tf.nn.softmax(logits_per_image, axis=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Qo(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Yo(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBURkJsaXBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVEZCbGlwTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWltYWdlLWNhcHRpb25pbmctYmFzZSUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC1pbWFnZS1jYXB0aW9uaW5nLWJhc2UlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0QlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFBlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBlipModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=[<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;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Ao(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Do(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQmxpcE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkJsaXBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaW1hZ2UtY2FwdGlvbmluZy1iYXNlJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWltYWdlLWNhcHRpb25pbmctYmFzZSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFBlipModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBlipModel.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&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;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function Oo(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function Ko(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function en(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function tn(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQmxpcEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWltYWdlLWNhcHRpb25pbmctYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFRGQmxpcEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtaW1hZ2UtY2FwdGlvbmluZy1iYXNlJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEF0ZXh0JTIwJTNEJTIwJTIyQSUyMHBpY3R1cmUlMjBvZiUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHRleHQlM0R0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFBlipForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBlipForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-image-captioning-base&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>text = <span class="hljs-string">&quot;A picture of&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function on(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function nn(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQmxpcEZvckltYWdlVGV4dFJldHJpZXZhbCUwQSUwQW1vZGVsJTIwJTNEJTIwVEZCbGlwRm9ySW1hZ2VUZXh0UmV0cmlldmFsLmZyb21fcHJldHJhaW5lZCglMjJTYWxlc2ZvcmNlJTJGYmxpcC1pdG0tYmFzZS1jb2NvJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwLWl0bS1iYXNlLWNvY28lMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQXRleHQlMjAlM0QlMjAlMjJhbiUyMGltYWdlJTIwb2YlMjBhJTIwY2F0JTIyJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwdGV4dCUzRHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFBlipForImageTextRetrieval

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBlipForImageTextRetrieval.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-itm-base-coco&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-itm-base-coco&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>text = <span class="hljs-string">&quot;an image of a cat&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function sn(x){let e,u=`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(){e=p("p"),e.innerHTML=u},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(o,n){f(o,e,n)},p:U,d(o){o&&i(e)}}}function an(x){let e,u="Examples:",o,n,M;return n=new Ut({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQmxpcEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBJTBBbW9kZWwlMjAlM0QlMjBURkJsaXBGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtdnFhLWJhc2UlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAtdnFhLWJhc2UlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMHRyYWluaW5nJTBBdGV4dCUyMCUzRCUyMCUyMkhvdyUyMG1hbnklMjBjYXRzJTIwYXJlJTIwaW4lMjB0aGUlMjBwaWN0dXJlJTNGJTIyJTBBbGFiZWwlMjAlM0QlMjAlMjIyJTIyJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwdGV4dCUzRHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxhYmVscyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEbGFiZWwlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKS5pbnB1dF9pZHMlMEElMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjBsYWJlbHMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQSUwQSUyMyUyMGluZmVyZW5jZSUwQXRleHQlMjAlM0QlMjAlMjJIb3clMjBtYW55JTIwY2F0cyUyMGFyZSUyMGluJTIwdGhlJTIwcGljdHVyZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHRleHQlM0R0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMpJTBBcHJpbnQocHJvY2Vzc29yLmRlY29kZShvdXRwdXRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFBlipForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFBlipForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-vqa-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip-vqa-base&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><span class="hljs-comment"># training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are in the picture?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>label = <span class="hljs-string">&quot;2&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = processor(text=label, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = labels
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are in the picture?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(processor.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
<span class="hljs-number">2</span>`,wrap:!1}}),{c(){e=p("p"),e.textContent=u,o=r(),g(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=u),o=l(t),h(n.$$.fragment,t)},m(t,w){f(t,e,w),f(t,o,w),_(n,t,w),M=!0},p:U,i(t){M||(b(n.$$.fragment,t),M=!0)},o(t){T(n.$$.fragment,t),M=!1},d(t){t&&(i(e),i(o)),v(n,t)}}}function rn(x){let e,u,o,n,M,t,w,oo,le,bo='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipModel">TFBlipModel</a> forward method, overrides the <code>__call__</code> special method.',no,k,kt,Le,ze,We,Ke,fe,Xt,et='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipModel">TFBlipModel</a> forward method, overrides the <code>__call__</code> special method.',mt,X,tt,ue,Et,ge,we,ft,ut,$e='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipModel">TFBlipModel</a> forward method, overrides the <code>__call__</code> special method.',so,z,zt,Xe,Be,gt,E,W,ht,xe,Wt,Zt=`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in <a href="https://arxiv.org/abs/1706.03762" rel="nofollow">Attention is
all you need</a> by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and <code>is_decoder</code> set to <code>True</code>; an
<code>encoder_hidden_states</code> is then expected as an input to the forward pass.`,_t,R,Je,ot,Ee,Nt='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipTextModel">TFBlipTextModel</a> forward method, overrides the <code>__call__</code> special method.',bt,D,je,Vt,nt,he,st,S,ie,at,Ze,Pt,rt='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipVisionModel">TFBlipVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Ne,Tt,Ce,Q,St,F,vt,de,O,lo=`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
<code>input_ids</code> to the model, which serve as a text prompt, to make the text decoder continue the prompt. Otherwise,
the decoder starts generating text from the [BOS] (beginning-of-sequence) token. will start generating the caption
from the text input. If no text input is provided, the decoder will start with the [BOS] token only.`,Ve,Ht,ne=`This model inherits from <a href="/docs/transformers/v4.40.2/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,Pe,Qt,Yt=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Mt,ce,se,io,V,Se='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipForConditionalGeneration">TFBlipForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',ho,Ie,Fe,_e,yt,Qe,co,Z,Y,po,ae,_o=`BLIP Model with a vision and text projector, and a classification head on top. The model is used in the context of
image-text retrieval. Given an image and a text, the model returns the probability of the text being relevant to
the image.`,wt,be,P=`This model inherits from <a href="/docs/transformers/v4.40.2/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,$t,Ye,ao=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,mo,A,Ue,He,Re,At='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipForImageTextRetrieval">TFBlipForImageTextRetrieval</a> forward method, overrides the <code>__call__</code> special method.',Dt,Bt,Te,G,lt,Ge,Rt,re,pe,it,ve,xt=`BLIP Model for visual question answering. The model consists of a vision encoder, a text encoder as well as a text
decoder. The vision encoder will encode the input image, the text encoder will encode the input question together
with the encoding of the image, and the text decoder will output the answer to the question.`,dt,Ae,K=`This model inherits from <a href="/docs/transformers/v4.40.2/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,s,$,ee=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Gt,N,H,De,Jt,qt='The <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipForQuestionAnswering">TFBlipForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',Ot,Oe,ct,pt,To;return e=new ye({props:{title:"TFBlipModel",local:"transformers.TFBlipModel",headingTag:"h2"}}),n=new I({props:{name:"class transformers.TFBlipModel",anchor:"transformers.TFBlipModel",parameters:[{name:"config",val:": BlipConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip.py#L933"}}),w=new I({props:{name:"call",anchor:"transformers.TFBlipModel.call",parameters:[{name:"input_ids",val:": tf.Tensor | None = None"},{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"return_loss",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.40.2/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBlipModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.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.TFBlipModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBlipModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipModel.call.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.TFBlipModel.call.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.TFBlipModel.call.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.TFBlipModel.call.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L951",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipOutput</code> or a tuple of <code>tf.Tensor</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.configuration_blip.BlipConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>tf.Tensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>tf.Tensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>tf.Tensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>image_embeds(<code>tf.Tensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_tf_blip.TFBlipOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),k=new It({props:{$$slots:{default:[Eo]},$$scope:{ctx:x}}}),Le=new Ft({props:{anchor:"transformers.TFBlipModel.call.example",$$slots:{default:[So]},$$scope:{ctx:x}}}),Ke=new I({props:{name:"get_text_features",anchor:"transformers.TFBlipModel.get_text_features",parameters:[{name:"input_ids",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"return_dict",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.40.2/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBlipModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.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.TFBlipModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBlipModel.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.TFBlipModel.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.TFBlipModel.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1003",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipTextModel"
>TFBlipTextModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>text_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),X=new It({props:{$$slots:{default:[Qo]},$$scope:{ctx:x}}}),ue=new Ft({props:{anchor:"transformers.TFBlipModel.get_text_features.example",$$slots:{default:[Yo]},$$scope:{ctx:x}}}),we=new I({props:{name:"get_image_features",anchor:"transformers.TFBlipModel.get_image_features",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"return_dict",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipModel.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.TFBlipModel.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.TFBlipModel.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1041",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The image embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.TFBlipVisionModel"
>TFBlipVisionModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>image_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),z=new It({props:{$$slots:{default:[Ao]},$$scope:{ctx:x}}}),Xe=new Ft({props:{anchor:"transformers.TFBlipModel.get_image_features.example",$$slots:{default:[Do]},$$scope:{ctx:x}}}),gt=new ye({props:{title:"TFBlipTextModel",local:"transformers.TFBlipTextModel",headingTag:"h2"}}),ht=new I({props:{name:"class transformers.TFBlipTextModel",anchor:"transformers.TFBlipTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"},{name:"name",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip_text.py#L729"}}),Je=new I({props:{name:"call",anchor:"transformers.TFBlipTextModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"encoder_embeds",val:": tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": tf.Tensor | None = None"},{name:"encoder_attention_mask",val:": tf.Tensor | None = None"},{name:"past_key_values",val:": Tuple[Tuple[tf.Tensor]] | None = None"},{name:"use_cache",val:": bool | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"is_decoder",val:": bool = False"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFBlipTextModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.40.2/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBlipTextModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.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.TFBlipTextModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBlipTextModel.call.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.TFBlipTextModel.call.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.TFBlipTextModel.call.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.40.2/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFBlipTextModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code>, <em>optional</em>) &#x2014;
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.`,name:"encoder_hidden_states"},{anchor:"transformers.TFBlipTextModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code>, <em>optional</em>) &#x2014;
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>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.TFBlipTextModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>) &#x2014;
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&#x2019;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>.`,name:"past_key_values"},{anchor:"transformers.TFBlipTextModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
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>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip_text.py#L817"}}),D=new It({props:{$$slots:{default:[Oo]},$$scope:{ctx:x}}}),Vt=new ye({props:{title:"TFBlipVisionModel",local:"transformers.TFBlipVisionModel",headingTag:"h2"}}),st=new I({props:{name:"class transformers.TFBlipVisionModel",anchor:"transformers.TFBlipVisionModel",parameters:[{name:"config",val:": BlipVisionConfig"},{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip.py#L699"}}),at=new I({props:{name:"call",anchor:"transformers.TFBlipVisionModel.call",parameters:[{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipVisionModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipVisionModel.call.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.TFBlipVisionModel.call.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.TFBlipVisionModel.call.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L723",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.40.2/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</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.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you’re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.40.2/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Tt=new It({props:{$$slots:{default:[Ko]},$$scope:{ctx:x}}}),Q=new ye({props:{title:"TFBlipForConditionalGeneration",local:"transformers.TFBlipForConditionalGeneration",headingTag:"h2"}}),vt=new I({props:{name:"class transformers.TFBlipForConditionalGeneration",anchor:"transformers.TFBlipForConditionalGeneration",parameters:[{name:"config",val:": BlipConfig"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBlipForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1087"}}),se=new I({props:{name:"call",anchor:"transformers.TFBlipForConditionalGeneration.call",parameters:[{name:"pixel_values",val:": tf.Tensor"},{name:"input_ids",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipForConditionalGeneration.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipForConditionalGeneration.call.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.TFBlipForConditionalGeneration.call.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.TFBlipForConditionalGeneration.call.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1114",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipForConditionalGenerationModelOutput</code> or a tuple of <code>tf.Tensor</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.configuration_blip.BlipConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) — Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>, <em>optional</em>) — Prediction scores of the language modeling head of the text decoder model.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>) — The image embeddings obtained after applying the Vision Transformer model to the input image.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed) — Tuple of <code>tf.Tensor</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_tf_blip.TFBlipForConditionalGenerationModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ie=new It({props:{$$slots:{default:[en]},$$scope:{ctx:x}}}),_e=new Ft({props:{anchor:"transformers.TFBlipForConditionalGeneration.call.example",$$slots:{default:[tn]},$$scope:{ctx:x}}}),Qe=new ye({props:{title:"TFBlipForImageTextRetrieval",local:"transformers.TFBlipForImageTextRetrieval",headingTag:"h2"}}),Y=new I({props:{name:"class transformers.TFBlipForImageTextRetrieval",anchor:"transformers.TFBlipForImageTextRetrieval",parameters:[{name:"config",val:": BlipConfig"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBlipForImageTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1533"}}),Ue=new I({props:{name:"call",anchor:"transformers.TFBlipForImageTextRetrieval.call",parameters:[{name:"input_ids",val:": tf.Tensor"},{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"use_itm_head",val:": Optional[bool] = True"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipForImageTextRetrieval.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipForImageTextRetrieval.call.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.TFBlipForImageTextRetrieval.call.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.TFBlipForImageTextRetrieval.call.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1585",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipImageTextMatchingModelOutput</code> or a tuple of <code>tf.Tensor</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.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>itm_score</strong> (<code>tf.Tensor</code>) — The image-text similarity scores.</p>
</li>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) — The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>vision_pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>, <em>optional</em>) — Last layer hidden-state of the vision of the vision-only branch of the model.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</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>
<li>
<p><strong>question_embeds</strong> (<code>tf.Tensor</code>) — The question embeddings obtained by the text projection layer.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_tf_blip.TFBlipImageTextMatchingModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Bt=new It({props:{$$slots:{default:[on]},$$scope:{ctx:x}}}),G=new Ft({props:{anchor:"transformers.TFBlipForImageTextRetrieval.call.example",$$slots:{default:[nn]},$$scope:{ctx:x}}}),Ge=new ye({props:{title:"TFBlipForQuestionAnswering",local:"transformers.TFBlipForQuestionAnswering",headingTag:"h2"}}),pe=new I({props:{name:"class transformers.TFBlipForQuestionAnswering",anchor:"transformers.TFBlipForQuestionAnswering",parameters:[{name:"config",val:": BlipConfig"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBlipForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</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.40.2/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1278"}}),H=new I({props:{name:"call",anchor:"transformers.TFBlipForQuestionAnswering.call",parameters:[{name:"input_ids",val:": tf.Tensor"},{name:"pixel_values",val:": tf.Tensor | None = None"},{name:"decoder_input_ids",val:": tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipForQuestionAnswering.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.40.2/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipForQuestionAnswering.call.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.TFBlipForQuestionAnswering.call.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.TFBlipForQuestionAnswering.call.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.40.2/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.40.2/src/transformers/models/blip/modeling_tf_blip.py#L1329",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipTextVisionModelOutput</code> or a tuple of <code>tf.Tensor</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.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) — The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.blip.modeling_tf_blip.TFBlipTextVisionModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Oe=new It({props:{$$slots:{default:[sn]},$$scope:{ctx:x}}}),pt=new Ft({props:{anchor:"transformers.TFBlipForQuestionAnswering.call.example",$$slots:{default:[an]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment),u=r(),o=p("div"),g(n.$$.fragment),M=r(),t=p("div"),g(w.$$.fragment),oo=r(),le=p("p"),le.innerHTML=bo,no=r(),g(k.$$.fragment),kt=r(),g(Le.$$.fragment),ze=r(),We=p("div"),g(Ke.$$.fragment),fe=r(),Xt=p("p"),Xt.innerHTML=et,mt=r(),g(X.$$.fragment),tt=r(),g(ue.$$.fragment),Et=r(),ge=p("div"),g(we.$$.fragment),ft=r(),ut=p("p"),ut.innerHTML=$e,so=r(),g(z.$$.fragment),zt=r(),g(Xe.$$.fragment),Be=r(),g(gt.$$.fragment),E=r(),W=p("div"),g(ht.$$.fragment),xe=r(),Wt=p("p"),Wt.innerHTML=Zt,_t=r(),R=p("div"),g(Je.$$.fragment),ot=r(),Ee=p("p"),Ee.innerHTML=Nt,bt=r(),g(D.$$.fragment),je=r(),g(Vt.$$.fragment),nt=r(),he=p("div"),g(st.$$.fragment),S=r(),ie=p("div"),g(at.$$.fragment),Ze=r(),Pt=p("p"),Pt.innerHTML=rt,Ne=r(),g(Tt.$$.fragment),Ce=r(),g(Q.$$.fragment),St=r(),F=p("div"),g(vt.$$.fragment),de=r(),O=p("p"),O.innerHTML=lo,Ve=r(),Ht=p("p"),Ht.innerHTML=ne,Pe=r(),Qt=p("p"),Qt.innerHTML=Yt,Mt=r(),ce=p("div"),g(se.$$.fragment),io=r(),V=p("p"),V.innerHTML=Se,ho=r(),g(Ie.$$.fragment),Fe=r(),g(_e.$$.fragment),yt=r(),g(Qe.$$.fragment),co=r(),Z=p("div"),g(Y.$$.fragment),po=r(),ae=p("p"),ae.textContent=_o,wt=r(),be=p("p"),be.innerHTML=P,$t=r(),Ye=p("p"),Ye.innerHTML=ao,mo=r(),A=p("div"),g(Ue.$$.fragment),He=r(),Re=p("p"),Re.innerHTML=At,Dt=r(),g(Bt.$$.fragment),Te=r(),g(G.$$.fragment),lt=r(),g(Ge.$$.fragment),Rt=r(),re=p("div"),g(pe.$$.fragment),it=r(),ve=p("p"),ve.textContent=xt,dt=r(),Ae=p("p"),Ae.innerHTML=K,s=r(),$=p("p"),$.innerHTML=ee,Gt=r(),N=p("div"),g(H.$$.fragment),De=r(),Jt=p("p"),Jt.innerHTML=qt,Ot=r(),g(Oe.$$.fragment),ct=r(),g(pt.$$.fragment),this.h()},l(d){h(e.$$.fragment,d),u=l(d),o=m(d,"DIV",{class:!0});var J=j(o);h(n.$$.fragment,J),M=l(J),t=m(J,"DIV",{class:!0});var jt=j(t);h(w.$$.fragment,jt),oo=l(jt),le=m(jt,"P",{"data-svelte-h":!0}),y(le)!=="svelte-aajf4z"&&(le.innerHTML=bo),no=l(jt),h(k.$$.fragment,jt),kt=l(jt),h(Le.$$.fragment,jt),jt.forEach(i),ze=l(J),We=m(J,"DIV",{class:!0});var Me=j(We);h(Ke.$$.fragment,Me),fe=l(Me),Xt=m(Me,"P",{"data-svelte-h":!0}),y(Xt)!=="svelte-aajf4z"&&(Xt.innerHTML=et),mt=l(Me),h(X.$$.fragment,Me),tt=l(Me),h(ue.$$.fragment,Me),Me.forEach(i),Et=l(J),ge=m(J,"DIV",{class:!0});var Ct=j(ge);h(we.$$.fragment,Ct),ft=l(Ct),ut=m(Ct,"P",{"data-svelte-h":!0}),y(ut)!=="svelte-aajf4z"&&(ut.innerHTML=$e),so=l(Ct),h(z.$$.fragment,Ct),zt=l(Ct),h(Xe.$$.fragment,Ct),Ct.forEach(i),J.forEach(i),Be=l(d),h(gt.$$.fragment,d),E=l(d),W=m(d,"DIV",{class:!0});var qe=j(W);h(ht.$$.fragment,qe),xe=l(qe),Wt=m(qe,"P",{"data-svelte-h":!0}),y(Wt)!=="svelte-ehxhk2"&&(Wt.innerHTML=Zt),_t=l(qe),R=m(qe,"DIV",{class:!0});var Lt=j(R);h(Je.$$.fragment,Lt),ot=l(Lt),Ee=m(Lt,"P",{"data-svelte-h":!0}),y(Ee)!=="svelte-155gs2r"&&(Ee.innerHTML=Nt),bt=l(Lt),h(D.$$.fragment,Lt),Lt.forEach(i),qe.forEach(i),je=l(d),h(Vt.$$.fragment,d),nt=l(d),he=m(d,"DIV",{class:!0});var c=j(he);h(st.$$.fragment,c),S=l(c),ie=m(c,"DIV",{class:!0});var B=j(ie);h(at.$$.fragment,B),Ze=l(B),Pt=m(B,"P",{"data-svelte-h":!0}),y(Pt)!=="svelte-5dr3wb"&&(Pt.innerHTML=rt),Ne=l(B),h(Tt.$$.fragment,B),B.forEach(i),c.forEach(i),Ce=l(d),h(Q.$$.fragment,d),St=l(d),F=m(d,"DIV",{class:!0});var q=j(F);h(vt.$$.fragment,q),de=l(q),O=m(q,"P",{"data-svelte-h":!0}),y(O)!=="svelte-u9sua2"&&(O.innerHTML=lo),Ve=l(q),Ht=m(q,"P",{"data-svelte-h":!0}),y(Ht)!=="svelte-1sj6iur"&&(Ht.innerHTML=ne),Pe=l(q),Qt=m(q,"P",{"data-svelte-h":!0}),y(Qt)!=="svelte-1be7e3c"&&(Qt.innerHTML=Yt),Mt=l(q),ce=m(q,"DIV",{class:!0});var te=j(ce);h(se.$$.fragment,te),io=l(te),V=m(te,"P",{"data-svelte-h":!0}),y(V)!=="svelte-6gguhv"&&(V.innerHTML=Se),ho=l(te),h(Ie.$$.fragment,te),Fe=l(te),h(_e.$$.fragment,te),te.forEach(i),q.forEach(i),yt=l(d),h(Qe.$$.fragment,d),co=l(d),Z=m(d,"DIV",{class:!0});var L=j(Z);h(Y.$$.fragment,L),po=l(L),ae=m(L,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1cwza0e"&&(ae.textContent=_o),wt=l(L),be=m(L,"P",{"data-svelte-h":!0}),y(be)!=="svelte-1sj6iur"&&(be.innerHTML=P),$t=l(L),Ye=m(L,"P",{"data-svelte-h":!0}),y(Ye)!=="svelte-1be7e3c"&&(Ye.innerHTML=ao),mo=l(L),A=m(L,"DIV",{class:!0});var me=j(A);h(Ue.$$.fragment,me),He=l(me),Re=m(me,"P",{"data-svelte-h":!0}),y(Re)!=="svelte-1eusm37"&&(Re.innerHTML=At),Dt=l(me),h(Bt.$$.fragment,me),Te=l(me),h(G.$$.fragment,me),me.forEach(i),L.forEach(i),lt=l(d),h(Ge.$$.fragment,d),Rt=l(d),re=m(d,"DIV",{class:!0});var oe=j(re);h(pe.$$.fragment,oe),it=l(oe),ve=m(oe,"P",{"data-svelte-h":!0}),y(ve)!=="svelte-tf7otj"&&(ve.textContent=xt),dt=l(oe),Ae=m(oe,"P",{"data-svelte-h":!0}),y(Ae)!=="svelte-1sj6iur"&&(Ae.innerHTML=K),s=l(oe),$=m(oe,"P",{"data-svelte-h":!0}),y($)!=="svelte-1be7e3c"&&($.innerHTML=ee),Gt=l(oe),N=m(oe,"DIV",{class:!0});var ke=j(N);h(H.$$.fragment,ke),De=l(ke),Jt=m(ke,"P",{"data-svelte-h":!0}),y(Jt)!=="svelte-5egzvb"&&(Jt.innerHTML=qt),Ot=l(ke),h(Oe.$$.fragment,ke),ct=l(ke),h(pt.$$.fragment,ke),ke.forEach(i),oe.forEach(i),this.h()},h(){C(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(d,J){_(e,d,J),f(d,u,J),f(d,o,J),_(n,o,null),a(o,M),a(o,t),_(w,t,null),a(t,oo),a(t,le),a(t,no),_(k,t,null),a(t,kt),_(Le,t,null),a(o,ze),a(o,We),_(Ke,We,null),a(We,fe),a(We,Xt),a(We,mt),_(X,We,null),a(We,tt),_(ue,We,null),a(o,Et),a(o,ge),_(we,ge,null),a(ge,ft),a(ge,ut),a(ge,so),_(z,ge,null),a(ge,zt),_(Xe,ge,null),f(d,Be,J),_(gt,d,J),f(d,E,J),f(d,W,J),_(ht,W,null),a(W,xe),a(W,Wt),a(W,_t),a(W,R),_(Je,R,null),a(R,ot),a(R,Ee),a(R,bt),_(D,R,null),f(d,je,J),_(Vt,d,J),f(d,nt,J),f(d,he,J),_(st,he,null),a(he,S),a(he,ie),_(at,ie,null),a(ie,Ze),a(ie,Pt),a(ie,Ne),_(Tt,ie,null),f(d,Ce,J),_(Q,d,J),f(d,St,J),f(d,F,J),_(vt,F,null),a(F,de),a(F,O),a(F,Ve),a(F,Ht),a(F,Pe),a(F,Qt),a(F,Mt),a(F,ce),_(se,ce,null),a(ce,io),a(ce,V),a(ce,ho),_(Ie,ce,null),a(ce,Fe),_(_e,ce,null),f(d,yt,J),_(Qe,d,J),f(d,co,J),f(d,Z,J),_(Y,Z,null),a(Z,po),a(Z,ae),a(Z,wt),a(Z,be),a(Z,$t),a(Z,Ye),a(Z,mo),a(Z,A),_(Ue,A,null),a(A,He),a(A,Re),a(A,Dt),_(Bt,A,null),a(A,Te),_(G,A,null),f(d,lt,J),_(Ge,d,J),f(d,Rt,J),f(d,re,J),_(pe,re,null),a(re,it),a(re,ve),a(re,dt),a(re,Ae),a(re,s),a(re,$),a(re,Gt),a(re,N),_(H,N,null),a(N,De),a(N,Jt),a(N,Ot),_(Oe,N,null),a(N,ct),_(pt,N,null),To=!0},p(d,J){const jt={};J&2&&(jt.$$scope={dirty:J,ctx:d}),k.$set(jt);const Me={};J&2&&(Me.$$scope={dirty:J,ctx:d}),Le.$set(Me);const Ct={};J&2&&(Ct.$$scope={dirty:J,ctx:d}),X.$set(Ct);const qe={};J&2&&(qe.$$scope={dirty:J,ctx:d}),ue.$set(qe);const Lt={};J&2&&(Lt.$$scope={dirty:J,ctx:d}),z.$set(Lt);const c={};J&2&&(c.$$scope={dirty:J,ctx:d}),Xe.$set(c);const B={};J&2&&(B.$$scope={dirty:J,ctx:d}),D.$set(B);const q={};J&2&&(q.$$scope={dirty:J,ctx:d}),Tt.$set(q);const te={};J&2&&(te.$$scope={dirty:J,ctx:d}),Ie.$set(te);const L={};J&2&&(L.$$scope={dirty:J,ctx:d}),_e.$set(L);const me={};J&2&&(me.$$scope={dirty:J,ctx:d}),Bt.$set(me);const oe={};J&2&&(oe.$$scope={dirty:J,ctx:d}),G.$set(oe);const ke={};J&2&&(ke.$$scope={dirty:J,ctx:d}),Oe.$set(ke);const ro={};J&2&&(ro.$$scope={dirty:J,ctx:d}),pt.$set(ro)},i(d){To||(b(e.$$.fragment,d),b(n.$$.fragment,d),b(w.$$.fragment,d),b(k.$$.fragment,d),b(Le.$$.fragment,d),b(Ke.$$.fragment,d),b(X.$$.fragment,d),b(ue.$$.fragment,d),b(we.$$.fragment,d),b(z.$$.fragment,d),b(Xe.$$.fragment,d),b(gt.$$.fragment,d),b(ht.$$.fragment,d),b(Je.$$.fragment,d),b(D.$$.fragment,d),b(Vt.$$.fragment,d),b(st.$$.fragment,d),b(at.$$.fragment,d),b(Tt.$$.fragment,d),b(Q.$$.fragment,d),b(vt.$$.fragment,d),b(se.$$.fragment,d),b(Ie.$$.fragment,d),b(_e.$$.fragment,d),b(Qe.$$.fragment,d),b(Y.$$.fragment,d),b(Ue.$$.fragment,d),b(Bt.$$.fragment,d),b(G.$$.fragment,d),b(Ge.$$.fragment,d),b(pe.$$.fragment,d),b(H.$$.fragment,d),b(Oe.$$.fragment,d),b(pt.$$.fragment,d),To=!0)},o(d){T(e.$$.fragment,d),T(n.$$.fragment,d),T(w.$$.fragment,d),T(k.$$.fragment,d),T(Le.$$.fragment,d),T(Ke.$$.fragment,d),T(X.$$.fragment,d),T(ue.$$.fragment,d),T(we.$$.fragment,d),T(z.$$.fragment,d),T(Xe.$$.fragment,d),T(gt.$$.fragment,d),T(ht.$$.fragment,d),T(Je.$$.fragment,d),T(D.$$.fragment,d),T(Vt.$$.fragment,d),T(st.$$.fragment,d),T(at.$$.fragment,d),T(Tt.$$.fragment,d),T(Q.$$.fragment,d),T(vt.$$.fragment,d),T(se.$$.fragment,d),T(Ie.$$.fragment,d),T(_e.$$.fragment,d),T(Qe.$$.fragment,d),T(Y.$$.fragment,d),T(Ue.$$.fragment,d),T(Bt.$$.fragment,d),T(G.$$.fragment,d),T(Ge.$$.fragment,d),T(pe.$$.fragment,d),T(H.$$.fragment,d),T(Oe.$$.fragment,d),T(pt.$$.fragment,d),To=!1},d(d){d&&(i(u),i(o),i(Be),i(E),i(W),i(je),i(nt),i(he),i(Ce),i(St),i(F),i(yt),i(co),i(Z),i(lt),i(Rt),i(re)),v(e,d),v(n),v(w),v(k),v(Le),v(Ke),v(X),v(ue),v(we),v(z),v(Xe),v(gt,d),v(ht),v(Je),v(D),v(Vt,d),v(st),v(at),v(Tt),v(Q,d),v(vt),v(se),v(Ie),v(_e),v(Qe,d),v(Y),v(Ue),v(Bt),v(G),v(Ge,d),v(pe),v(H),v(Oe),v(pt)}}}function ln(x){let e,u;return e=new vo({props:{$$slots:{default:[rn]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment)},l(o){h(e.$$.fragment,o)},m(o,n){_(e,o,n),u=!0},p(o,n){const M={};n&2&&(M.$$scope={dirty:n,ctx:o}),e.$set(M)},i(o){u||(b(e.$$.fragment,o),u=!0)},o(o){T(e.$$.fragment,o),u=!1},d(o){v(e,o)}}}function dn(x){let e,u,o,n,M,t,w,oo,le,bo='The BLIP model was proposed in <a href="https://arxiv.org/abs/2201.12086" rel="nofollow">BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation</a> by Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi.',no,k,kt="BLIP is a model that is able to perform various multi-modal tasks including:",Le,ze,We="<li>Visual Question Answering</li> <li>Image-Text retrieval (Image-text matching)</li> <li>Image Captioning</li>",Ke,fe,Xt="The abstract from the paper is the following:",et,mt,X=`<em>Vision-Language Pre-training (VLP) has advanced the performance for many vision-language tasks.
However, most existing pre-trained models only excel in either understanding-based tasks or generation-based tasks. Furthermore, performance improvement has been largely achieved by scaling up the dataset with noisy image-text pairs collected from the web, which is a suboptimal source of supervision. In this paper, we propose BLIP, a new VLP framework which transfers flexibly to both vision-language understanding and generation tasks. BLIP effectively utilizes the noisy web data by bootstrapping the captions, where a captioner generates synthetic captions and a filter removes the noisy ones. We achieve state-of-the-art results on a wide range of vision-language tasks, such as image-text retrieval (+2.7% in average recall@1), image captioning (+2.8% in CIDEr), and VQA (+1.6% in VQA score). BLIP also demonstrates strong generalization ability when directly transferred to videolanguage tasks in a zero-shot manner. Code, models, and datasets are released.</em>`,tt,ue,Et='<img src="https://cdn-uploads.huggingface.co/production/uploads/1670928184033-62441d1d9fdefb55a0b7d12c.gif" alt="BLIP.gif"/>',ge,we,ft=`This model was contributed by <a href="https://huggingface.co/ybelkada" rel="nofollow">ybelkada</a>.
The original code can be found <a href="https://github.com/salesforce/BLIP" rel="nofollow">here</a>.`,ut,$e,so,z,zt='<li><a href="https://github.com/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb" rel="nofollow">Jupyter notebook</a> on how to fine-tune BLIP for image captioning on a custom dataset</li>',Xe,Be,gt,E,W,ht,xe,Wt=`<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipModel">BlipModel</a>. It is used to instantiate
a BLIP model according to the specified arguments, defining the text model and vision model configs. Instantiating
a configuration with the defaults will yield a similar configuration to that of the BLIP-base
<a href="https://huggingface.co/Salesforce/blip-vqa-base" rel="nofollow">Salesforce/blip-vqa-base</a> architecture.`,Zt,_t,R=`Configuration objects inherit from <a href="/docs/transformers/v4.40.2/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.40.2/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Je,ot,Ee,Nt,bt,D,je,Vt=`Instantiate a <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig">BlipConfig</a> (or a derived class) from blip text model configuration and blip vision model
configuration.`,nt,he,st,S,ie,at,Ze,Pt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextModel">BlipTextModel</a>. It is used to instantiate a BLIP
text 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 <code>BlipText</code> used by the <a href="https://huggingface.co/Salesforce/blip-vqa-base" rel="nofollow">base
architectures</a>.`,rt,Ne,Tt=`Configuration objects inherit from <a href="/docs/transformers/v4.40.2/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.40.2/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ce,Q,St,F,vt,de,O,lo,Ve,Ht=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipVisionModel">BlipVisionModel</a>. It is used to instantiate a
BLIP vision model according to the specified arguments, defining the model architecture. Instantiating a
configuration defaults will yield a similar configuration to that of the Blip-base
<a href="https://huggingface.co/Salesforce/blip-vqa-base" rel="nofollow">Salesforce/blip-vqa-base</a> architecture.`,ne,Pe,Qt=`Configuration objects inherit from <a href="/docs/transformers/v4.40.2/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.40.2/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Yt,Mt,ce,se,io,V,Se,ho,Ie,Fe="Constructs a BLIP processor which wraps a BERT tokenizer and BLIP image processor into a single processor.",_e,yt,Qe=`<a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipProcessor">BlipProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a> and <a href="/docs/transformers/v4.40.2/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>. See the
docstring of <code>__call__()</code> and <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipProcessor.decode">decode()</a> for more information.`,co,Z,Y,po,ae,_o=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/v4.40.2/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,wt,be,P,$t,Ye,ao=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/v4.40.2/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,mo,A,Ue,He,Re,At,Dt,Bt="Constructs a BLIP image processor.",Te,G,lt,Ge,Rt,re="Preprocess an image or batch of images.",pe,it,ve,xt,dt,Ae,K;return M=new ye({props:{title:"BLIP",local:"blip",headingTag:"h1"}}),w=new ye({props:{title:"Overview",local:"overview",headingTag:"h2"}}),$e=new ye({props:{title:"Resources",local:"resources",headingTag:"h2"}}),Be=new ye({props:{title:"BlipConfig",local:"transformers.BlipConfig",headingTag:"h2"}}),W=new I({props:{name:"class transformers.BlipConfig",anchor:"transformers.BlipConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"image_text_hidden_size",val:" = 256"},{name:"label_smoothing",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipTextConfig">BlipTextConfig</a>.`,name:"text_config"},{anchor:"transformers.BlipConfig.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.40.2/en/model_doc/blip#transformers.BlipVisionConfig">BlipVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.BlipConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.BlipConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original BLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.BlipConfig.image_text_hidden_size",description:`<strong>image_text_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimentionality of the hidden state of the image-text fusion layer.`,name:"image_text_hidden_size"},{anchor:"transformers.BlipConfig.label_smoothing",description:`<strong>label_smoothing</strong> (float, optional, <em>optional</em>, defaults to 0.0) &#x2014;
A float in [0.0, 1.0]. Specifies the amount of smoothing when computing the loss, where 0.0 means no smoothing. The targets
become a mixture of the original ground truth and a uniform distribution as described in
<code>Rethinking the Inception Architecture for Computer Vision &lt;https://arxiv.org/abs/1512.00567&gt;</code>__. Default: :math:<code>0.0</code>.`,name:"label_smoothing"},{anchor:"transformers.BlipConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/configuration_blip.py#L270"}}),ot=new Ft({props:{anchor:"transformers.BlipConfig.example",$$slots:{default:[jo]},$$scope:{ctx:x}}}),bt=new I({props:{name:"from_text_vision_configs",anchor:"transformers.BlipConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": BlipTextConfig"},{name:"vision_config",val:": BlipVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/configuration_blip.py#L355",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>An instance of a configuration object</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipConfig"
>BlipConfig</a></p>
`}}),he=new ye({props:{title:"BlipTextConfig",local:"transformers.BlipTextConfig",headingTag:"h2"}}),ie=new I({props:{name:"class transformers.BlipTextConfig",anchor:"transformers.BlipTextConfig",parameters:[{name:"vocab_size",val:" = 30524"},{name:"hidden_size",val:" = 768"},{name:"encoder_hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 512"},{name:"hidden_act",val:" = 'gelu'"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"bos_token_id",val:" = 30522"},{name:"eos_token_id",val:" = 2"},{name:"pad_token_id",val:" = 0"},{name:"sep_token_id",val:" = 102"},{name:"is_decoder",val:" = True"},{name:"use_cache",val:" = True"},{name:"label_smoothing",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30524) &#x2014;
Vocabulary size of the <code>Blip</code> text model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipModel">BlipModel</a>.`,name:"vocab_size"},{anchor:"transformers.BlipTextConfig.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.BlipTextConfig.encoder_hidden_size",description:`<strong>encoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers from the vision model.`,name:"encoder_hidden_size"},{anchor:"transformers.BlipTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BlipTextConfig.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.BlipTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.BlipTextConfig.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.BlipTextConfig.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.`,name:"hidden_act"},{anchor:"transformers.BlipTextConfig.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.BlipTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BlipTextConfig.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.BlipTextConfig.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.BlipTextConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
The id of the <code>beginning-of-sequence</code> token.`,name:"bos_token_id"},{anchor:"transformers.BlipTextConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the <code>end-of-sequence</code> token.`,name:"eos_token_id"},{anchor:"transformers.BlipTextConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The id of the <code>padding</code> token.`,name:"pad_token_id"},{anchor:"transformers.BlipTextConfig.sep_token_id",description:`<strong>sep_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 102) &#x2014;
The id of the <code>separator</code> token.`,name:"sep_token_id"},{anchor:"transformers.BlipTextConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the model is used as a decoder.`,name:"is_decoder"},{anchor:"transformers.BlipTextConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.BlipTextConfig.label_smoothing",description:`<strong>label_smoothing</strong> (float, <em>optional</em>) &#x2014;
A float in [0.0, 1.0]. Specifies the amount of smoothing when computing the loss, where 0.0 means no smoothing. The targets
become a mixture of the original ground truth and a uniform distribution as described in
<code>Rethinking the Inception Architecture for Computer Vision &lt;https://arxiv.org/abs/1512.00567&gt;</code>__. Default: :math:<code>0.0</code>.`,name:"label_smoothing"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/configuration_blip.py#L30"}}),Q=new Ft({props:{anchor:"transformers.BlipTextConfig.example",$$slots:{default:[Co]},$$scope:{ctx:x}}}),F=new ye({props:{title:"BlipVisionConfig",local:"transformers.BlipVisionConfig",headingTag:"h2"}}),O=new I({props:{name:"class transformers.BlipVisionConfig",anchor:"transformers.BlipVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"image_size",val:" = 384"},{name:"patch_size",val:" = 16"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipVisionConfig.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.BlipVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BlipVisionConfig.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.BlipVisionConfig.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.BlipVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 384) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.BlipVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.BlipVisionConfig.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.`,name:"hidden_act"},{anchor:"transformers.BlipVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BlipVisionConfig.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.BlipVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-10) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/configuration_blip.py#L171"}}),Mt=new Ft({props:{anchor:"transformers.BlipVisionConfig.example",$$slots:{default:[Io]},$$scope:{ctx:x}}}),se=new ye({props:{title:"BlipProcessor",local:"transformers.BlipProcessor",headingTag:"h2"}}),Se=new I({props:{name:"class transformers.BlipProcessor",anchor:"transformers.BlipProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.BlipProcessor.image_processor",description:`<strong>image_processor</strong> (<code>BlipImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.40.2/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.BlipProcessor.tokenizer",description:"<strong>tokenizer</strong> (<code>BertTokenizerFast</code>) &#x2014;\nAn instance of [&#x2018;BertTokenizerFast`]. The tokenizer is a required input.",name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/processing_blip.py#L27"}}),Y=new I({props:{name:"batch_decode",anchor:"transformers.BlipProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/processing_blip.py#L132"}}),P=new I({props:{name:"decode",anchor:"transformers.BlipProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/processing_blip.py#L139"}}),A=new ye({props:{title:"BlipImageProcessor",local:"transformers.BlipImageProcessor",headingTag:"h2"}}),Re=new I({props:{name:"class transformers.BlipImageProcessor",anchor:"transformers.BlipImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.BlipImageProcessor.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 384, &quot;width&quot;: 384}</code>):
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.BlipImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. Can be
overridden by the <code>resample</code> parameter in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.BlipImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the
<code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.BlipImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.BlipImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.BlipImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.BlipImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.BlipImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/image_processing_blip.py#L47"}}),lt=new I({props:{name:"preprocess",anchor:"transformers.BlipImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.BlipImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.BlipImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Controls the size of the image after <code>resize</code>. The shortest edge of the image is resized to
<code>size[&quot;shortest_edge&quot;]</code> whilst preserving the aspect ratio. If the longest edge of this resized image
is &gt; <code>int(size[&quot;shortest_edge&quot;] * (1333 / 800))</code>, then the image is resized again to make the longest
edge equal to <code>int(size[&quot;shortest_edge&quot;] * (1333 / 800))</code>.`,name:"size"},{anchor:"transformers.BlipImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.BlipImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.BlipImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.BlipImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.BlipImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to normalize the image by if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.BlipImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to normalize the image by if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.BlipImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.BlipImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.BlipImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.BlipImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.40.2/src/transformers/models/blip/image_processing_blip.py#L175"}}),it=new xo({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ln],pytorch:[Xo]},$$scope:{ctx:x}}}),xt=new Jo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/blip.md"}}),{c(){e=p("meta"),u=r(),o=p("p"),n=r(),g(M.$$.fragment),t=r(),g(w.$$.fragment),oo=r(),le=p("p"),le.innerHTML=bo,no=r(),k=p("p"),k.textContent=kt,Le=r(),ze=p("ul"),ze.innerHTML=We,Ke=r(),fe=p("p"),fe.textContent=Xt,et=r(),mt=p("p"),mt.innerHTML=X,tt=r(),ue=p("p"),ue.innerHTML=Et,ge=r(),we=p("p"),we.innerHTML=ft,ut=r(),g($e.$$.fragment),so=r(),z=p("ul"),z.innerHTML=zt,Xe=r(),g(Be.$$.fragment),gt=r(),E=p("div"),g(W.$$.fragment),ht=r(),xe=p("p"),xe.innerHTML=Wt,Zt=r(),_t=p("p"),_t.innerHTML=R,Je=r(),g(ot.$$.fragment),Ee=r(),Nt=p("div"),g(bt.$$.fragment),D=r(),je=p("p"),je.innerHTML=Vt,nt=r(),g(he.$$.fragment),st=r(),S=p("div"),g(ie.$$.fragment),at=r(),Ze=p("p"),Ze.innerHTML=Pt,rt=r(),Ne=p("p"),Ne.innerHTML=Tt,Ce=r(),g(Q.$$.fragment),St=r(),g(F.$$.fragment),vt=r(),de=p("div"),g(O.$$.fragment),lo=r(),Ve=p("p"),Ve.innerHTML=Ht,ne=r(),Pe=p("p"),Pe.innerHTML=Qt,Yt=r(),g(Mt.$$.fragment),ce=r(),g(se.$$.fragment),io=r(),V=p("div"),g(Se.$$.fragment),ho=r(),Ie=p("p"),Ie.textContent=Fe,_e=r(),yt=p("p"),yt.innerHTML=Qe,co=r(),Z=p("div"),g(Y.$$.fragment),po=r(),ae=p("p"),ae.innerHTML=_o,wt=r(),be=p("div"),g(P.$$.fragment),$t=r(),Ye=p("p"),Ye.innerHTML=ao,mo=r(),g(A.$$.fragment),Ue=r(),He=p("div"),g(Re.$$.fragment),At=r(),Dt=p("p"),Dt.textContent=Bt,Te=r(),G=p("div"),g(lt.$$.fragment),Ge=r(),Rt=p("p"),Rt.textContent=re,pe=r(),g(it.$$.fragment),ve=r(),g(xt.$$.fragment),dt=r(),Ae=p("p"),this.h()},l(s){const $=Bo("svelte-u9bgzb",document.head);e=m($,"META",{name:!0,content:!0}),$.forEach(i),u=l(s),o=m(s,"P",{}),j(o).forEach(i),n=l(s),h(M.$$.fragment,s),t=l(s),h(w.$$.fragment,s),oo=l(s),le=m(s,"P",{"data-svelte-h":!0}),y(le)!=="svelte-17k3ayt"&&(le.innerHTML=bo),no=l(s),k=m(s,"P",{"data-svelte-h":!0}),y(k)!=="svelte-zufbp3"&&(k.textContent=kt),Le=l(s),ze=m(s,"UL",{"data-svelte-h":!0}),y(ze)!=="svelte-nylfz4"&&(ze.innerHTML=We),Ke=l(s),fe=m(s,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-vfdo9a"&&(fe.textContent=Xt),et=l(s),mt=m(s,"P",{"data-svelte-h":!0}),y(mt)!=="svelte-4jmih4"&&(mt.innerHTML=X),tt=l(s),ue=m(s,"P",{"data-svelte-h":!0}),y(ue)!=="svelte-1nlkgp7"&&(ue.innerHTML=Et),ge=l(s),we=m(s,"P",{"data-svelte-h":!0}),y(we)!=="svelte-1kg7i71"&&(we.innerHTML=ft),ut=l(s),h($e.$$.fragment,s),so=l(s),z=m(s,"UL",{"data-svelte-h":!0}),y(z)!=="svelte-1ag1pc7"&&(z.innerHTML=zt),Xe=l(s),h(Be.$$.fragment,s),gt=l(s),E=m(s,"DIV",{class:!0});var ee=j(E);h(W.$$.fragment,ee),ht=l(ee),xe=m(ee,"P",{"data-svelte-h":!0}),y(xe)!=="svelte-1b6m5y3"&&(xe.innerHTML=Wt),Zt=l(ee),_t=m(ee,"P",{"data-svelte-h":!0}),y(_t)!=="svelte-xu8n6r"&&(_t.innerHTML=R),Je=l(ee),h(ot.$$.fragment,ee),Ee=l(ee),Nt=m(ee,"DIV",{class:!0});var Gt=j(Nt);h(bt.$$.fragment,Gt),D=l(Gt),je=m(Gt,"P",{"data-svelte-h":!0}),y(je)!=="svelte-v6826k"&&(je.innerHTML=Vt),Gt.forEach(i),ee.forEach(i),nt=l(s),h(he.$$.fragment,s),st=l(s),S=m(s,"DIV",{class:!0});var N=j(S);h(ie.$$.fragment,N),at=l(N),Ze=m(N,"P",{"data-svelte-h":!0}),y(Ze)!=="svelte-1swg1z1"&&(Ze.innerHTML=Pt),rt=l(N),Ne=m(N,"P",{"data-svelte-h":!0}),y(Ne)!=="svelte-xu8n6r"&&(Ne.innerHTML=Tt),Ce=l(N),h(Q.$$.fragment,N),N.forEach(i),St=l(s),h(F.$$.fragment,s),vt=l(s),de=m(s,"DIV",{class:!0});var H=j(de);h(O.$$.fragment,H),lo=l(H),Ve=m(H,"P",{"data-svelte-h":!0}),y(Ve)!=="svelte-35kxxw"&&(Ve.innerHTML=Ht),ne=l(H),Pe=m(H,"P",{"data-svelte-h":!0}),y(Pe)!=="svelte-xu8n6r"&&(Pe.innerHTML=Qt),Yt=l(H),h(Mt.$$.fragment,H),H.forEach(i),ce=l(s),h(se.$$.fragment,s),io=l(s),V=m(s,"DIV",{class:!0});var De=j(V);h(Se.$$.fragment,De),ho=l(De),Ie=m(De,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-4ee3u1"&&(Ie.textContent=Fe),_e=l(De),yt=m(De,"P",{"data-svelte-h":!0}),y(yt)!=="svelte-1bv5gid"&&(yt.innerHTML=Qe),co=l(De),Z=m(De,"DIV",{class:!0});var Jt=j(Z);h(Y.$$.fragment,Jt),po=l(Jt),ae=m(Jt,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1kf1kc3"&&(ae.innerHTML=_o),Jt.forEach(i),wt=l(De),be=m(De,"DIV",{class:!0});var qt=j(be);h(P.$$.fragment,qt),$t=l(qt),Ye=m(qt,"P",{"data-svelte-h":!0}),y(Ye)!=="svelte-1jivupl"&&(Ye.innerHTML=ao),qt.forEach(i),De.forEach(i),mo=l(s),h(A.$$.fragment,s),Ue=l(s),He=m(s,"DIV",{class:!0});var Ot=j(He);h(Re.$$.fragment,Ot),At=l(Ot),Dt=m(Ot,"P",{"data-svelte-h":!0}),y(Dt)!=="svelte-17e80zr"&&(Dt.textContent=Bt),Te=l(Ot),G=m(Ot,"DIV",{class:!0});var Oe=j(G);h(lt.$$.fragment,Oe),Ge=l(Oe),Rt=m(Oe,"P",{"data-svelte-h":!0}),y(Rt)!=="svelte-1x3yxsa"&&(Rt.textContent=re),Oe.forEach(i),Ot.forEach(i),pe=l(s),h(it.$$.fragment,s),ve=l(s),h(xt.$$.fragment,s),dt=l(s),Ae=m(s,"P",{}),j(Ae).forEach(i),this.h()},h(){C(e,"name","hf:doc:metadata"),C(e,"content",cn),C(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,$){a(document.head,e),f(s,u,$),f(s,o,$),f(s,n,$),_(M,s,$),f(s,t,$),_(w,s,$),f(s,oo,$),f(s,le,$),f(s,no,$),f(s,k,$),f(s,Le,$),f(s,ze,$),f(s,Ke,$),f(s,fe,$),f(s,et,$),f(s,mt,$),f(s,tt,$),f(s,ue,$),f(s,ge,$),f(s,we,$),f(s,ut,$),_($e,s,$),f(s,so,$),f(s,z,$),f(s,Xe,$),_(Be,s,$),f(s,gt,$),f(s,E,$),_(W,E,null),a(E,ht),a(E,xe),a(E,Zt),a(E,_t),a(E,Je),_(ot,E,null),a(E,Ee),a(E,Nt),_(bt,Nt,null),a(Nt,D),a(Nt,je),f(s,nt,$),_(he,s,$),f(s,st,$),f(s,S,$),_(ie,S,null),a(S,at),a(S,Ze),a(S,rt),a(S,Ne),a(S,Ce),_(Q,S,null),f(s,St,$),_(F,s,$),f(s,vt,$),f(s,de,$),_(O,de,null),a(de,lo),a(de,Ve),a(de,ne),a(de,Pe),a(de,Yt),_(Mt,de,null),f(s,ce,$),_(se,s,$),f(s,io,$),f(s,V,$),_(Se,V,null),a(V,ho),a(V,Ie),a(V,_e),a(V,yt),a(V,co),a(V,Z),_(Y,Z,null),a(Z,po),a(Z,ae),a(V,wt),a(V,be),_(P,be,null),a(be,$t),a(be,Ye),f(s,mo,$),_(A,s,$),f(s,Ue,$),f(s,He,$),_(Re,He,null),a(He,At),a(He,Dt),a(He,Te),a(He,G),_(lt,G,null),a(G,Ge),a(G,Rt),f(s,pe,$),_(it,s,$),f(s,ve,$),_(xt,s,$),f(s,dt,$),f(s,Ae,$),K=!0},p(s,[$]){const ee={};$&2&&(ee.$$scope={dirty:$,ctx:s}),ot.$set(ee);const Gt={};$&2&&(Gt.$$scope={dirty:$,ctx:s}),Q.$set(Gt);const N={};$&2&&(N.$$scope={dirty:$,ctx:s}),Mt.$set(N);const H={};$&2&&(H.$$scope={dirty:$,ctx:s}),it.$set(H)},i(s){K||(b(M.$$.fragment,s),b(w.$$.fragment,s),b($e.$$.fragment,s),b(Be.$$.fragment,s),b(W.$$.fragment,s),b(ot.$$.fragment,s),b(bt.$$.fragment,s),b(he.$$.fragment,s),b(ie.$$.fragment,s),b(Q.$$.fragment,s),b(F.$$.fragment,s),b(O.$$.fragment,s),b(Mt.$$.fragment,s),b(se.$$.fragment,s),b(Se.$$.fragment,s),b(Y.$$.fragment,s),b(P.$$.fragment,s),b(A.$$.fragment,s),b(Re.$$.fragment,s),b(lt.$$.fragment,s),b(it.$$.fragment,s),b(xt.$$.fragment,s),K=!0)},o(s){T(M.$$.fragment,s),T(w.$$.fragment,s),T($e.$$.fragment,s),T(Be.$$.fragment,s),T(W.$$.fragment,s),T(ot.$$.fragment,s),T(bt.$$.fragment,s),T(he.$$.fragment,s),T(ie.$$.fragment,s),T(Q.$$.fragment,s),T(F.$$.fragment,s),T(O.$$.fragment,s),T(Mt.$$.fragment,s),T(se.$$.fragment,s),T(Se.$$.fragment,s),T(Y.$$.fragment,s),T(P.$$.fragment,s),T(A.$$.fragment,s),T(Re.$$.fragment,s),T(lt.$$.fragment,s),T(it.$$.fragment,s),T(xt.$$.fragment,s),K=!1},d(s){s&&(i(u),i(o),i(n),i(t),i(oo),i(le),i(no),i(k),i(Le),i(ze),i(Ke),i(fe),i(et),i(mt),i(tt),i(ue),i(ge),i(we),i(ut),i(so),i(z),i(Xe),i(gt),i(E),i(nt),i(st),i(S),i(St),i(vt),i(de),i(ce),i(io),i(V),i(mo),i(Ue),i(He),i(pe),i(ve),i(dt),i(Ae)),i(e),v(M,s),v(w,s),v($e,s),v(Be,s),v(W),v(ot),v(bt),v(he,s),v(ie),v(Q),v(F,s),v(O),v(Mt),v(se,s),v(Se),v(Y),v(P),v(A,s),v(Re),v(lt),v(it,s),v(xt,s)}}}const cn='{"title":"BLIP","local":"blip","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"BlipConfig","local":"transformers.BlipConfig","sections":[],"depth":2},{"title":"BlipTextConfig","local":"transformers.BlipTextConfig","sections":[],"depth":2},{"title":"BlipVisionConfig","local":"transformers.BlipVisionConfig","sections":[],"depth":2},{"title":"BlipProcessor","local":"transformers.BlipProcessor","sections":[],"depth":2},{"title":"BlipImageProcessor","local":"transformers.BlipImageProcessor","sections":[],"depth":2},{"title":"BlipModel","local":"transformers.BlipModel","sections":[],"depth":2},{"title":"BlipTextModel","local":"transformers.BlipTextModel","sections":[],"depth":2},{"title":"BlipVisionModel","local":"transformers.BlipVisionModel","sections":[],"depth":2},{"title":"BlipForConditionalGeneration","local":"transformers.BlipForConditionalGeneration","sections":[],"depth":2},{"title":"BlipForImageTextRetrieval","local":"transformers.BlipForImageTextRetrieval","sections":[],"depth":2},{"title":"BlipForQuestionAnswering","local":"transformers.BlipForQuestionAnswering","sections":[],"depth":2},{"title":"TFBlipModel","local":"transformers.TFBlipModel","sections":[],"depth":2},{"title":"TFBlipTextModel","local":"transformers.TFBlipTextModel","sections":[],"depth":2},{"title":"TFBlipVisionModel","local":"transformers.TFBlipVisionModel","sections":[],"depth":2},{"title":"TFBlipForConditionalGeneration","local":"transformers.TFBlipForConditionalGeneration","sections":[],"depth":2},{"title":"TFBlipForImageTextRetrieval","local":"transformers.TFBlipForImageTextRetrieval","sections":[],"depth":2},{"title":"TFBlipForQuestionAnswering","local":"transformers.TFBlipForQuestionAnswering","sections":[],"depth":2}],"depth":1}';function pn(x){return yo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vn extends wo{constructor(e){super(),$o(this,e,pn,dn,Mo,{})}}export{vn as component};
