import{s as $o,o as Bo,n as k}from"../chunks/scheduler.9bc65507.js";import{S as xo,i as jo,g as p,s as a,r as h,A as Jo,h as m,f as i,c as l,j as J,u,x as y,k as C,y as s,a as f,v as _,d as b,t as T,w as M}from"../chunks/index.707bf1b6.js";import{T as wt}from"../chunks/Tip.c2ecdbf4.js";import{D as F}from"../chunks/Docstring.570ddb64.js";import{C as Bt}from"../chunks/CodeBlock.54a9f38d.js";import{F as Co,M as wo}from"../chunks/Markdown.8ab98a13.js";import{E as $t}from"../chunks/ExampleCodeBlock.bc2be6bc.js";import{H as ve,E as Fo}from"../chunks/EditOnGithub.922df6ba.js";function Io(x){let e,g="Example:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-11lpom8"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Uo(x){let e,g="Example:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-11lpom8"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function ko(x){let e,g="Example:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-11lpom8"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function zo(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Wo(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Zo(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function No(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Vo(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Ho(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Po(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Ro(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Go(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function qo(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Eo(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Lo(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Xo(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function So(x){let e,g,o,n,v,t,$="This model is going to be deprecated in future versions. Please use <code>BlipForConditionalGeneration</code>, <code>BlipForQuestionAnswering</code> or <code>BlipForImageTextRetrieval</code> depending on your usecase.",Qt,ae,Mo=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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.)`,Yt,A,uo=`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.`,Qe,q,D,st,ze,At='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipModel">BlipModel</a> forward method, overrides the <code>__call__</code> special method.',to,fe,ct,Ye,ge,ye,H,we,Vt,xt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipModel">BlipModel</a> forward method, overrides the <code>__call__</code> special method.',jt,Ae,he,pt,De,P,ue,E,Z,Jt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipModel">BlipModel</a> forward method, overrides the <code>__call__</code> special method.',Ct,We,mo,$e,Ze,Be,Oe,te,xe,mt,je,Ft=`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.`,It,_e,R,rt,L,le=`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>:`,ft,Ke,Dt=`<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>`,oo,Ne,at,Ve,X,Ht,I,be,ie,de,_o='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipVisionModel">BlipVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Ut,He,no,Pe,kt,oe,Te,ce,ne,so=`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.`,N,et,fo=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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.)`,Je,Pt,gt=`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.`,ht,O,lt,z,se,go='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipForConditionalGeneration">BlipForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',tt,zt,ro,S,ut,_t,Re,pe,it,Q,Ce,Ge=`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.`,qe,Rt,Gt=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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.)`,bt,Wt,Me=`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.`,dt,Y,Fe,re,Ie,Tt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipForImageTextRetrieval">BlipForImageTextRetrieval</a> forward method, overrides the <code>__call__</code> special method.',Mt,Ue,Ot,me,Kt,r,B,U,ke,W,V,ot=`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.`,vt,Zt,qt=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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.)`,nt,ho,ao=`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.`,vo,d,j,yt,Ee,Nt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipForQuestionAnswering">BlipForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',Et,Le,lo,Xe,Se;return e=new ve({props:{title:"BlipModel",local:"transformers.BlipModel",headingTag:"h2"}}),n=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_blip.py#L754"}}),D=new F({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"},{name:"interpolate_pos_encoding",val:": bool = False"}],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/pr_31098/ja/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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlipModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L934",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/pr_31098/ja/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/pr_31098/ja/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/pr_31098/ja/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/pr_31098/ja/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 wt({props:{$$slots:{default:[zo]},$$scope:{ctx:x}}}),Ye=new $t({props:{anchor:"transformers.BlipModel.forward.example",$$slots:{default:[Wo]},$$scope:{ctx:x}}}),H=new F({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/pr_31098/ja/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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L799",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/pr_31098/ja/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>
`}}),Ae=new wt({props:{$$slots:{default:[Zo]},$$scope:{ctx:x}}}),pt=new $t({props:{anchor:"transformers.BlipModel.get_text_features.example",$$slots:{default:[No]},$$scope:{ctx:x}}}),ue=new F({props:{name:"get_image_features",anchor:"transformers.BlipModel.get_image_features",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": bool = False"}],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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlipModel.get_image_features.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L837",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/pr_31098/ja/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>
`}}),We=new wt({props:{$$slots:{default:[Vo]},$$scope:{ctx:x}}}),$e=new $t({props:{anchor:"transformers.BlipModel.get_image_features.example",$$slots:{default:[Ho]},$$scope:{ctx:x}}}),Be=new ve({props:{title:"BlipTextModel",local:"transformers.BlipTextModel",headingTag:"h2"}}),xe=new F({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/vr_31098/src/transformers/models/blip/modeling_blip_text.py#L572"}}),R=new F({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/vr_31098/src/transformers/models/blip/modeling_blip_text.py#L671"}}),Ne=new ve({props:{title:"BlipVisionModel",local:"transformers.BlipVisionModel",headingTag:"h2"}}),X=new F({props:{name:"class transformers.BlipVisionModel",anchor:"transformers.BlipVisionModel",parameters:[{name:"config",val:": BlipVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L687"}}),be=new F({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"},{name:"interpolate_pos_encoding",val:": bool = False"}],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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlipVisionModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L702",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31098/ja/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/pr_31098/ja/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new wt({props:{$$slots:{default:[Po]},$$scope:{ctx:x}}}),Pe=new ve({props:{title:"BlipForConditionalGeneration",local:"transformers.BlipForConditionalGeneration",headingTag:"h2"}}),Te=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_blip.py#L1030"}}),lt=new F({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"},{name:"interpolate_pos_encoding",val:": bool = False"}],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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlipForConditionalGeneration.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L1060",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>
`}}),zt=new wt({props:{$$slots:{default:[Ro]},$$scope:{ctx:x}}}),S=new $t({props:{anchor:"transformers.BlipForConditionalGeneration.forward.example",$$slots:{default:[Go]},$$scope:{ctx:x}}}),_t=new ve({props:{title:"BlipForImageTextRetrieval",local:"transformers.BlipForImageTextRetrieval",headingTag:"h2"}}),it=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_blip.py#L1437"}}),Fe=new F({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"},{name:"interpolate_pos_encoding",val:": bool = False"}],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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlipForImageTextRetrieval.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L1481",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>
`}}),Ue=new wt({props:{$$slots:{default:[qo]},$$scope:{ctx:x}}}),me=new $t({props:{anchor:"transformers.BlipForImageTextRetrieval.forward.example",$$slots:{default:[Eo]},$$scope:{ctx:x}}}),r=new ve({props:{title:"BlipForQuestionAnswering",local:"transformers.BlipForQuestionAnswering",headingTag:"h2"}}),ke=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_blip.py#L1209"}}),j=new F({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"},{name:"interpolate_pos_encoding",val:": bool = False"}],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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlipForQuestionAnswering.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_blip.py#L1239",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>
`}}),Le=new wt({props:{$$slots:{default:[Lo]},$$scope:{ctx:x}}}),Xe=new $t({props:{anchor:"transformers.BlipForQuestionAnswering.forward.example",$$slots:{default:[Xo]},$$scope:{ctx:x}}}),{c(){h(e.$$.fragment),g=a(),o=p("div"),h(n.$$.fragment),v=a(),t=p("p"),t.innerHTML=$,Qt=a(),ae=p("p"),ae.innerHTML=Mo,Yt=a(),A=p("p"),A.innerHTML=uo,Qe=a(),q=p("div"),h(D.$$.fragment),st=a(),ze=p("p"),ze.innerHTML=At,to=a(),h(fe.$$.fragment),ct=a(),h(Ye.$$.fragment),ge=a(),ye=p("div"),h(H.$$.fragment),we=a(),Vt=p("p"),Vt.innerHTML=xt,jt=a(),h(Ae.$$.fragment),he=a(),h(pt.$$.fragment),De=a(),P=p("div"),h(ue.$$.fragment),E=a(),Z=p("p"),Z.innerHTML=Jt,Ct=a(),h(We.$$.fragment),mo=a(),h($e.$$.fragment),Ze=a(),h(Be.$$.fragment),Oe=a(),te=p("div"),h(xe.$$.fragment),mt=a(),je=p("p"),je.innerHTML=Ft,It=a(),_e=p("div"),h(R.$$.fragment),rt=a(),L=p("p"),L.innerHTML=le,ft=a(),Ke=p("ul"),Ke.innerHTML=Dt,oo=a(),h(Ne.$$.fragment),at=a(),Ve=p("div"),h(X.$$.fragment),Ht=a(),I=p("div"),h(be.$$.fragment),ie=a(),de=p("p"),de.innerHTML=_o,Ut=a(),h(He.$$.fragment),no=a(),h(Pe.$$.fragment),kt=a(),oe=p("div"),h(Te.$$.fragment),ce=a(),ne=p("p"),ne.innerHTML=so,N=a(),et=p("p"),et.innerHTML=fo,Je=a(),Pt=p("p"),Pt.innerHTML=gt,ht=a(),O=p("div"),h(lt.$$.fragment),z=a(),se=p("p"),se.innerHTML=go,tt=a(),h(zt.$$.fragment),ro=a(),h(S.$$.fragment),ut=a(),h(_t.$$.fragment),Re=a(),pe=p("div"),h(it.$$.fragment),Q=a(),Ce=p("p"),Ce.textContent=Ge,qe=a(),Rt=p("p"),Rt.innerHTML=Gt,bt=a(),Wt=p("p"),Wt.innerHTML=Me,dt=a(),Y=p("div"),h(Fe.$$.fragment),re=a(),Ie=p("p"),Ie.innerHTML=Tt,Mt=a(),h(Ue.$$.fragment),Ot=a(),h(me.$$.fragment),Kt=a(),h(r.$$.fragment),B=a(),U=p("div"),h(ke.$$.fragment),W=a(),V=p("p"),V.textContent=ot,vt=a(),Zt=p("p"),Zt.innerHTML=qt,nt=a(),ho=p("p"),ho.innerHTML=ao,vo=a(),d=p("div"),h(j.$$.fragment),yt=a(),Ee=p("p"),Ee.innerHTML=Nt,Et=a(),h(Le.$$.fragment),lo=a(),h(Xe.$$.fragment),this.h()},l(c){u(e.$$.fragment,c),g=l(c),o=m(c,"DIV",{class:!0});var w=J(o);u(n.$$.fragment,w),v=l(w),t=m(w,"P",{"data-svelte-h":!0}),y(t)!=="svelte-1ke3c5j"&&(t.innerHTML=$),Qt=l(w),ae=m(w,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1ybp5qz"&&(ae.innerHTML=Mo),Yt=l(w),A=m(w,"P",{"data-svelte-h":!0}),y(A)!=="svelte-hswkmf"&&(A.innerHTML=uo),Qe=l(w),q=m(w,"DIV",{class:!0});var K=J(q);u(D.$$.fragment,K),st=l(K),ze=m(K,"P",{"data-svelte-h":!0}),y(ze)!=="svelte-1ptxqcz"&&(ze.innerHTML=At),to=l(K),u(fe.$$.fragment,K),ct=l(K),u(Ye.$$.fragment,K),K.forEach(i),ge=l(w),ye=m(w,"DIV",{class:!0});var G=J(ye);u(H.$$.fragment,G),we=l(G),Vt=m(G,"P",{"data-svelte-h":!0}),y(Vt)!=="svelte-1ptxqcz"&&(Vt.innerHTML=xt),jt=l(G),u(Ae.$$.fragment,G),he=l(G),u(pt.$$.fragment,G),G.forEach(i),De=l(w),P=m(w,"DIV",{class:!0});var ee=J(P);u(ue.$$.fragment,ee),E=l(ee),Z=m(ee,"P",{"data-svelte-h":!0}),y(Z)!=="svelte-1ptxqcz"&&(Z.innerHTML=Jt),Ct=l(ee),u(We.$$.fragment,ee),mo=l(ee),u($e.$$.fragment,ee),ee.forEach(i),w.forEach(i),Ze=l(c),u(Be.$$.fragment,c),Oe=l(c),te=m(c,"DIV",{class:!0});var eo=J(te);u(xe.$$.fragment,eo),mt=l(eo),je=m(eo,"P",{"data-svelte-h":!0}),y(je)!=="svelte-ehxhk2"&&(je.innerHTML=Ft),It=l(eo),_e=m(eo,"DIV",{class:!0});var bo=J(_e);u(R.$$.fragment,bo),rt=l(bo),L=m(bo,"P",{"data-svelte-h":!0}),y(L)!=="svelte-1misbdl"&&(L.innerHTML=le),ft=l(bo),Ke=m(bo,"UL",{"data-svelte-h":!0}),y(Ke)!=="svelte-64obm2"&&(Ke.innerHTML=Dt),bo.forEach(i),eo.forEach(i),oo=l(c),u(Ne.$$.fragment,c),at=l(c),Ve=m(c,"DIV",{class:!0});var yo=J(Ve);u(X.$$.fragment,yo),Ht=l(yo),I=m(yo,"DIV",{class:!0});var To=J(I);u(be.$$.fragment,To),ie=l(To),de=m(To,"P",{"data-svelte-h":!0}),y(de)!=="svelte-knivmr"&&(de.innerHTML=_o),Ut=l(To),u(He.$$.fragment,To),To.forEach(i),yo.forEach(i),no=l(c),u(Pe.$$.fragment,c),kt=l(c),oe=m(c,"DIV",{class:!0});var Lt=J(oe);u(Te.$$.fragment,Lt),ce=l(Lt),ne=m(Lt,"P",{"data-svelte-h":!0}),y(ne)!=="svelte-u9sua2"&&(ne.innerHTML=so),N=l(Lt),et=m(Lt,"P",{"data-svelte-h":!0}),y(et)!=="svelte-1ybp5qz"&&(et.innerHTML=fo),Je=l(Lt),Pt=m(Lt,"P",{"data-svelte-h":!0}),y(Pt)!=="svelte-hswkmf"&&(Pt.innerHTML=gt),ht=l(Lt),O=m(Lt,"DIV",{class:!0});var io=J(O);u(lt.$$.fragment,io),z=l(io),se=m(io,"P",{"data-svelte-h":!0}),y(se)!=="svelte-1chxfff"&&(se.innerHTML=go),tt=l(io),u(zt.$$.fragment,io),ro=l(io),u(S.$$.fragment,io),io.forEach(i),Lt.forEach(i),ut=l(c),u(_t.$$.fragment,c),Re=l(c),pe=m(c,"DIV",{class:!0});var Xt=J(pe);u(it.$$.fragment,Xt),Q=l(Xt),Ce=m(Xt,"P",{"data-svelte-h":!0}),y(Ce)!=="svelte-1cwza0e"&&(Ce.textContent=Ge),qe=l(Xt),Rt=m(Xt,"P",{"data-svelte-h":!0}),y(Rt)!=="svelte-1ybp5qz"&&(Rt.innerHTML=Gt),bt=l(Xt),Wt=m(Xt,"P",{"data-svelte-h":!0}),y(Wt)!=="svelte-hswkmf"&&(Wt.innerHTML=Me),dt=l(Xt),Y=m(Xt,"DIV",{class:!0});var co=J(Y);u(Fe.$$.fragment,co),re=l(co),Ie=m(co,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-11lcjir"&&(Ie.innerHTML=Tt),Mt=l(co),u(Ue.$$.fragment,co),Ot=l(co),u(me.$$.fragment,co),co.forEach(i),Xt.forEach(i),Kt=l(c),u(r.$$.fragment,c),B=l(c),U=m(c,"DIV",{class:!0});var St=J(U);u(ke.$$.fragment,St),W=l(St),V=m(St,"P",{"data-svelte-h":!0}),y(V)!=="svelte-tf7otj"&&(V.textContent=ot),vt=l(St),Zt=m(St,"P",{"data-svelte-h":!0}),y(Zt)!=="svelte-1ybp5qz"&&(Zt.innerHTML=qt),nt=l(St),ho=m(St,"P",{"data-svelte-h":!0}),y(ho)!=="svelte-hswkmf"&&(ho.innerHTML=ao),vo=l(St),d=m(St,"DIV",{class:!0});var po=J(d);u(j.$$.fragment,po),yt=l(po),Ee=m(po,"P",{"data-svelte-h":!0}),y(Ee)!=="svelte-1avyuij"&&(Ee.innerHTML=Nt),Et=l(po),u(Le.$$.fragment,po),lo=l(po),u(Xe.$$.fragment,po),po.forEach(i),St.forEach(i),this.h()},h(){C(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(ye,"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(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(_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(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(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Ve,"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(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(pe,"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(U,"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,w){_(e,c,w),f(c,g,w),f(c,o,w),_(n,o,null),s(o,v),s(o,t),s(o,Qt),s(o,ae),s(o,Yt),s(o,A),s(o,Qe),s(o,q),_(D,q,null),s(q,st),s(q,ze),s(q,to),_(fe,q,null),s(q,ct),_(Ye,q,null),s(o,ge),s(o,ye),_(H,ye,null),s(ye,we),s(ye,Vt),s(ye,jt),_(Ae,ye,null),s(ye,he),_(pt,ye,null),s(o,De),s(o,P),_(ue,P,null),s(P,E),s(P,Z),s(P,Ct),_(We,P,null),s(P,mo),_($e,P,null),f(c,Ze,w),_(Be,c,w),f(c,Oe,w),f(c,te,w),_(xe,te,null),s(te,mt),s(te,je),s(te,It),s(te,_e),_(R,_e,null),s(_e,rt),s(_e,L),s(_e,ft),s(_e,Ke),f(c,oo,w),_(Ne,c,w),f(c,at,w),f(c,Ve,w),_(X,Ve,null),s(Ve,Ht),s(Ve,I),_(be,I,null),s(I,ie),s(I,de),s(I,Ut),_(He,I,null),f(c,no,w),_(Pe,c,w),f(c,kt,w),f(c,oe,w),_(Te,oe,null),s(oe,ce),s(oe,ne),s(oe,N),s(oe,et),s(oe,Je),s(oe,Pt),s(oe,ht),s(oe,O),_(lt,O,null),s(O,z),s(O,se),s(O,tt),_(zt,O,null),s(O,ro),_(S,O,null),f(c,ut,w),_(_t,c,w),f(c,Re,w),f(c,pe,w),_(it,pe,null),s(pe,Q),s(pe,Ce),s(pe,qe),s(pe,Rt),s(pe,bt),s(pe,Wt),s(pe,dt),s(pe,Y),_(Fe,Y,null),s(Y,re),s(Y,Ie),s(Y,Mt),_(Ue,Y,null),s(Y,Ot),_(me,Y,null),f(c,Kt,w),_(r,c,w),f(c,B,w),f(c,U,w),_(ke,U,null),s(U,W),s(U,V),s(U,vt),s(U,Zt),s(U,nt),s(U,ho),s(U,vo),s(U,d),_(j,d,null),s(d,yt),s(d,Ee),s(d,Et),_(Le,d,null),s(d,lo),_(Xe,d,null),Se=!0},p(c,w){const K={};w&2&&(K.$$scope={dirty:w,ctx:c}),fe.$set(K);const G={};w&2&&(G.$$scope={dirty:w,ctx:c}),Ye.$set(G);const ee={};w&2&&(ee.$$scope={dirty:w,ctx:c}),Ae.$set(ee);const eo={};w&2&&(eo.$$scope={dirty:w,ctx:c}),pt.$set(eo);const bo={};w&2&&(bo.$$scope={dirty:w,ctx:c}),We.$set(bo);const yo={};w&2&&(yo.$$scope={dirty:w,ctx:c}),$e.$set(yo);const To={};w&2&&(To.$$scope={dirty:w,ctx:c}),He.$set(To);const Lt={};w&2&&(Lt.$$scope={dirty:w,ctx:c}),zt.$set(Lt);const io={};w&2&&(io.$$scope={dirty:w,ctx:c}),S.$set(io);const Xt={};w&2&&(Xt.$$scope={dirty:w,ctx:c}),Ue.$set(Xt);const co={};w&2&&(co.$$scope={dirty:w,ctx:c}),me.$set(co);const St={};w&2&&(St.$$scope={dirty:w,ctx:c}),Le.$set(St);const po={};w&2&&(po.$$scope={dirty:w,ctx:c}),Xe.$set(po)},i(c){Se||(b(e.$$.fragment,c),b(n.$$.fragment,c),b(D.$$.fragment,c),b(fe.$$.fragment,c),b(Ye.$$.fragment,c),b(H.$$.fragment,c),b(Ae.$$.fragment,c),b(pt.$$.fragment,c),b(ue.$$.fragment,c),b(We.$$.fragment,c),b($e.$$.fragment,c),b(Be.$$.fragment,c),b(xe.$$.fragment,c),b(R.$$.fragment,c),b(Ne.$$.fragment,c),b(X.$$.fragment,c),b(be.$$.fragment,c),b(He.$$.fragment,c),b(Pe.$$.fragment,c),b(Te.$$.fragment,c),b(lt.$$.fragment,c),b(zt.$$.fragment,c),b(S.$$.fragment,c),b(_t.$$.fragment,c),b(it.$$.fragment,c),b(Fe.$$.fragment,c),b(Ue.$$.fragment,c),b(me.$$.fragment,c),b(r.$$.fragment,c),b(ke.$$.fragment,c),b(j.$$.fragment,c),b(Le.$$.fragment,c),b(Xe.$$.fragment,c),Se=!0)},o(c){T(e.$$.fragment,c),T(n.$$.fragment,c),T(D.$$.fragment,c),T(fe.$$.fragment,c),T(Ye.$$.fragment,c),T(H.$$.fragment,c),T(Ae.$$.fragment,c),T(pt.$$.fragment,c),T(ue.$$.fragment,c),T(We.$$.fragment,c),T($e.$$.fragment,c),T(Be.$$.fragment,c),T(xe.$$.fragment,c),T(R.$$.fragment,c),T(Ne.$$.fragment,c),T(X.$$.fragment,c),T(be.$$.fragment,c),T(He.$$.fragment,c),T(Pe.$$.fragment,c),T(Te.$$.fragment,c),T(lt.$$.fragment,c),T(zt.$$.fragment,c),T(S.$$.fragment,c),T(_t.$$.fragment,c),T(it.$$.fragment,c),T(Fe.$$.fragment,c),T(Ue.$$.fragment,c),T(me.$$.fragment,c),T(r.$$.fragment,c),T(ke.$$.fragment,c),T(j.$$.fragment,c),T(Le.$$.fragment,c),T(Xe.$$.fragment,c),Se=!1},d(c){c&&(i(g),i(o),i(Ze),i(Oe),i(te),i(oo),i(at),i(Ve),i(no),i(kt),i(oe),i(ut),i(Re),i(pe),i(Kt),i(B),i(U)),M(e,c),M(n),M(D),M(fe),M(Ye),M(H),M(Ae),M(pt),M(ue),M(We),M($e),M(Be,c),M(xe),M(R),M(Ne,c),M(X),M(be),M(He),M(Pe,c),M(Te),M(lt),M(zt),M(S),M(_t,c),M(it),M(Fe),M(Ue),M(me),M(r,c),M(ke),M(j),M(Le),M(Xe)}}}function Qo(x){let e,g;return e=new wo({props:{$$slots:{default:[So]},$$scope:{ctx:x}}}),{c(){h(e.$$.fragment)},l(o){u(e.$$.fragment,o)},m(o,n){_(e,o,n),g=!0},p(o,n){const v={};n&2&&(v.$$scope={dirty:n,ctx:o}),e.$set(v)},i(o){g||(b(e.$$.fragment,o),g=!0)},o(o){T(e.$$.fragment,o),g=!1},d(o){M(e,o)}}}function Yo(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Ao(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Do(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function Oo(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function Ko(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function en(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function tn(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function on(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function nn(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function sn(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function rn(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function an(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function ln(x){let e,g=`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=g},l(o){e=m(o,"P",{"data-svelte-h":!0}),y(e)!=="svelte-fincs2"&&(e.innerHTML=g)},m(o,n){f(o,e,n)},p:k,d(o){o&&i(e)}}}function dn(x){let e,g="Examples:",o,n,v;return n=new Bt({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=g,o=a(),h(n.$$.fragment)},l(t){e=m(t,"P",{"data-svelte-h":!0}),y(e)!=="svelte-kvfsh7"&&(e.textContent=g),o=l(t),u(n.$$.fragment,t)},m(t,$){f(t,e,$),f(t,o,$),_(n,t,$),v=!0},p:k,i(t){v||(b(n.$$.fragment,t),v=!0)},o(t){T(n.$$.fragment,t),v=!1},d(t){t&&(i(e),i(o)),M(n,t)}}}function cn(x){let e,g,o,n,v,t,$,Qt,ae,Mo='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipModel">TFBlipModel</a> forward method, overrides the <code>__call__</code> special method.',Yt,A,uo,Qe,q,D,st,ze,At,to='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipModel">TFBlipModel</a> forward method, overrides the <code>__call__</code> special method.',fe,ct,Ye,ge,ye,H,we,Vt,xt,jt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipModel">TFBlipModel</a> forward method, overrides the <code>__call__</code> special method.',Ae,he,pt,De,P,ue,E,Z,Jt,Ct,We,mo=`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.`,$e,Ze,Be,Oe,te,xe='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipTextModel">TFBlipTextModel</a> forward method, overrides the <code>__call__</code> special method.',mt,je,Ft,It,_e,R,rt,L,le,ft,Ke,Dt,oo='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipVisionModel">TFBlipVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Ne,at,Ve,X,Ht,I,be,ie,de,_o=`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.`,Ut,He,no=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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,kt,oe=`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.`,Te,ce,ne,so,N,et='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipForConditionalGeneration">TFBlipForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',fo,Je,Pt,gt,ht,O,lt,z,se,go,tt,zt=`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.`,ro,S,ut=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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,Re,pe=`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.`,it,Q,Ce,Ge,qe,Rt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipForImageTextRetrieval">TFBlipForImageTextRetrieval</a> forward method, overrides the <code>__call__</code> special method.',Gt,bt,Wt,Me,dt,Y,Fe,re,Ie,Tt,Mt,Ue=`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.`,Ot,me,Kt=`This model inherits from <a href="/docs/transformers/pr_31098/ja/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.)`,r,B,U=`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.`,ke,W,V,ot,vt,Zt='The <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.TFBlipForQuestionAnswering">TFBlipForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',qt,nt,ho,ao,vo;return e=new ve({props:{title:"TFBlipModel",local:"transformers.TFBlipModel",headingTag:"h2"}}),n=new F({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/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L930"}}),$=new F({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/pr_31098/ja/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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L948",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/pr_31098/ja/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/pr_31098/ja/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/pr_31098/ja/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/pr_31098/ja/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>
`}}),A=new wt({props:{$$slots:{default:[Yo]},$$scope:{ctx:x}}}),Qe=new $t({props:{anchor:"transformers.TFBlipModel.call.example",$$slots:{default:[Ao]},$$scope:{ctx:x}}}),st=new F({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/pr_31098/ja/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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1000",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/pr_31098/ja/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>
`}}),ct=new wt({props:{$$slots:{default:[Do]},$$scope:{ctx:x}}}),ge=new $t({props:{anchor:"transformers.TFBlipModel.get_text_features.example",$$slots:{default:[Oo]},$$scope:{ctx:x}}}),we=new F({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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1038",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/pr_31098/ja/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>
`}}),he=new wt({props:{$$slots:{default:[Ko]},$$scope:{ctx:x}}}),De=new $t({props:{anchor:"transformers.TFBlipModel.get_image_features.example",$$slots:{default:[en]},$$scope:{ctx:x}}}),ue=new ve({props:{title:"TFBlipTextModel",local:"transformers.TFBlipTextModel",headingTag:"h2"}}),Jt=new F({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/vr_31098/src/transformers/models/blip/modeling_tf_blip_text.py#L729"}}),Be=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_tf_blip_text.py#L817"}}),je=new wt({props:{$$slots:{default:[tn]},$$scope:{ctx:x}}}),It=new ve({props:{title:"TFBlipVisionModel",local:"transformers.TFBlipVisionModel",headingTag:"h2"}}),rt=new F({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/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L696"}}),ft=new F({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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L720",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31098/ja/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/pr_31098/ja/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),at=new wt({props:{$$slots:{default:[on]},$$scope:{ctx:x}}}),X=new ve({props:{title:"TFBlipForConditionalGeneration",local:"transformers.TFBlipForConditionalGeneration",headingTag:"h2"}}),be=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1084"}}),ne=new F({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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1111",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>
`}}),Je=new wt({props:{$$slots:{default:[nn]},$$scope:{ctx:x}}}),gt=new $t({props:{anchor:"transformers.TFBlipForConditionalGeneration.call.example",$$slots:{default:[sn]},$$scope:{ctx:x}}}),O=new ve({props:{title:"TFBlipForImageTextRetrieval",local:"transformers.TFBlipForImageTextRetrieval",headingTag:"h2"}}),se=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1530"}}),Ce=new F({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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1582",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 wt({props:{$$slots:{default:[rn]},$$scope:{ctx:x}}}),Me=new $t({props:{anchor:"transformers.TFBlipForImageTextRetrieval.call.example",$$slots:{default:[an]},$$scope:{ctx:x}}}),Y=new ve({props:{title:"TFBlipForQuestionAnswering",local:"transformers.TFBlipForQuestionAnswering",headingTag:"h2"}}),Ie=new F({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/pr_31098/ja/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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1275"}}),V=new F({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/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/pr_31098/ja/model_doc/deformable_detr#transformers.DeformableDetrFeatureExtractor.__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/pr_31098/ja/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/modeling_tf_blip.py#L1326",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>
`}}),nt=new wt({props:{$$slots:{default:[ln]},$$scope:{ctx:x}}}),ao=new $t({props:{anchor:"transformers.TFBlipForQuestionAnswering.call.example",$$slots:{default:[dn]},$$scope:{ctx:x}}}),{c(){h(e.$$.fragment),g=a(),o=p("div"),h(n.$$.fragment),v=a(),t=p("div"),h($.$$.fragment),Qt=a(),ae=p("p"),ae.innerHTML=Mo,Yt=a(),h(A.$$.fragment),uo=a(),h(Qe.$$.fragment),q=a(),D=p("div"),h(st.$$.fragment),ze=a(),At=p("p"),At.innerHTML=to,fe=a(),h(ct.$$.fragment),Ye=a(),h(ge.$$.fragment),ye=a(),H=p("div"),h(we.$$.fragment),Vt=a(),xt=p("p"),xt.innerHTML=jt,Ae=a(),h(he.$$.fragment),pt=a(),h(De.$$.fragment),P=a(),h(ue.$$.fragment),E=a(),Z=p("div"),h(Jt.$$.fragment),Ct=a(),We=p("p"),We.innerHTML=mo,$e=a(),Ze=p("div"),h(Be.$$.fragment),Oe=a(),te=p("p"),te.innerHTML=xe,mt=a(),h(je.$$.fragment),Ft=a(),h(It.$$.fragment),_e=a(),R=p("div"),h(rt.$$.fragment),L=a(),le=p("div"),h(ft.$$.fragment),Ke=a(),Dt=p("p"),Dt.innerHTML=oo,Ne=a(),h(at.$$.fragment),Ve=a(),h(X.$$.fragment),Ht=a(),I=p("div"),h(be.$$.fragment),ie=a(),de=p("p"),de.innerHTML=_o,Ut=a(),He=p("p"),He.innerHTML=no,Pe=a(),kt=p("p"),kt.innerHTML=oe,Te=a(),ce=p("div"),h(ne.$$.fragment),so=a(),N=p("p"),N.innerHTML=et,fo=a(),h(Je.$$.fragment),Pt=a(),h(gt.$$.fragment),ht=a(),h(O.$$.fragment),lt=a(),z=p("div"),h(se.$$.fragment),go=a(),tt=p("p"),tt.textContent=zt,ro=a(),S=p("p"),S.innerHTML=ut,_t=a(),Re=p("p"),Re.innerHTML=pe,it=a(),Q=p("div"),h(Ce.$$.fragment),Ge=a(),qe=p("p"),qe.innerHTML=Rt,Gt=a(),h(bt.$$.fragment),Wt=a(),h(Me.$$.fragment),dt=a(),h(Y.$$.fragment),Fe=a(),re=p("div"),h(Ie.$$.fragment),Tt=a(),Mt=p("p"),Mt.textContent=Ue,Ot=a(),me=p("p"),me.innerHTML=Kt,r=a(),B=p("p"),B.innerHTML=U,ke=a(),W=p("div"),h(V.$$.fragment),ot=a(),vt=p("p"),vt.innerHTML=Zt,qt=a(),h(nt.$$.fragment),ho=a(),h(ao.$$.fragment),this.h()},l(d){u(e.$$.fragment,d),g=l(d),o=m(d,"DIV",{class:!0});var j=J(o);u(n.$$.fragment,j),v=l(j),t=m(j,"DIV",{class:!0});var yt=J(t);u($.$$.fragment,yt),Qt=l(yt),ae=m(yt,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1li3fcr"&&(ae.innerHTML=Mo),Yt=l(yt),u(A.$$.fragment,yt),uo=l(yt),u(Qe.$$.fragment,yt),yt.forEach(i),q=l(j),D=m(j,"DIV",{class:!0});var Ee=J(D);u(st.$$.fragment,Ee),ze=l(Ee),At=m(Ee,"P",{"data-svelte-h":!0}),y(At)!=="svelte-1li3fcr"&&(At.innerHTML=to),fe=l(Ee),u(ct.$$.fragment,Ee),Ye=l(Ee),u(ge.$$.fragment,Ee),Ee.forEach(i),ye=l(j),H=m(j,"DIV",{class:!0});var Nt=J(H);u(we.$$.fragment,Nt),Vt=l(Nt),xt=m(Nt,"P",{"data-svelte-h":!0}),y(xt)!=="svelte-1li3fcr"&&(xt.innerHTML=jt),Ae=l(Nt),u(he.$$.fragment,Nt),pt=l(Nt),u(De.$$.fragment,Nt),Nt.forEach(i),j.forEach(i),P=l(d),u(ue.$$.fragment,d),E=l(d),Z=m(d,"DIV",{class:!0});var Et=J(Z);u(Jt.$$.fragment,Et),Ct=l(Et),We=m(Et,"P",{"data-svelte-h":!0}),y(We)!=="svelte-ehxhk2"&&(We.innerHTML=mo),$e=l(Et),Ze=m(Et,"DIV",{class:!0});var Le=J(Ze);u(Be.$$.fragment,Le),Oe=l(Le),te=m(Le,"P",{"data-svelte-h":!0}),y(te)!=="svelte-1l0t4fv"&&(te.innerHTML=xe),mt=l(Le),u(je.$$.fragment,Le),Le.forEach(i),Et.forEach(i),Ft=l(d),u(It.$$.fragment,d),_e=l(d),R=m(d,"DIV",{class:!0});var lo=J(R);u(rt.$$.fragment,lo),L=l(lo),le=m(lo,"DIV",{class:!0});var Xe=J(le);u(ft.$$.fragment,Xe),Ke=l(Xe),Dt=m(Xe,"P",{"data-svelte-h":!0}),y(Dt)!=="svelte-10frvdf"&&(Dt.innerHTML=oo),Ne=l(Xe),u(at.$$.fragment,Xe),Xe.forEach(i),lo.forEach(i),Ve=l(d),u(X.$$.fragment,d),Ht=l(d),I=m(d,"DIV",{class:!0});var Se=J(I);u(be.$$.fragment,Se),ie=l(Se),de=m(Se,"P",{"data-svelte-h":!0}),y(de)!=="svelte-u9sua2"&&(de.innerHTML=_o),Ut=l(Se),He=m(Se,"P",{"data-svelte-h":!0}),y(He)!=="svelte-1j6h1a3"&&(He.innerHTML=no),Pe=l(Se),kt=m(Se,"P",{"data-svelte-h":!0}),y(kt)!=="svelte-1be7e3c"&&(kt.innerHTML=oe),Te=l(Se),ce=m(Se,"DIV",{class:!0});var c=J(ce);u(ne.$$.fragment,c),so=l(c),N=m(c,"P",{"data-svelte-h":!0}),y(N)!=="svelte-9mzpff"&&(N.innerHTML=et),fo=l(c),u(Je.$$.fragment,c),Pt=l(c),u(gt.$$.fragment,c),c.forEach(i),Se.forEach(i),ht=l(d),u(O.$$.fragment,d),lt=l(d),z=m(d,"DIV",{class:!0});var w=J(z);u(se.$$.fragment,w),go=l(w),tt=m(w,"P",{"data-svelte-h":!0}),y(tt)!=="svelte-1cwza0e"&&(tt.textContent=zt),ro=l(w),S=m(w,"P",{"data-svelte-h":!0}),y(S)!=="svelte-1j6h1a3"&&(S.innerHTML=ut),_t=l(w),Re=m(w,"P",{"data-svelte-h":!0}),y(Re)!=="svelte-1be7e3c"&&(Re.innerHTML=pe),it=l(w),Q=m(w,"DIV",{class:!0});var K=J(Q);u(Ce.$$.fragment,K),Ge=l(K),qe=m(K,"P",{"data-svelte-h":!0}),y(qe)!=="svelte-bdb38r"&&(qe.innerHTML=Rt),Gt=l(K),u(bt.$$.fragment,K),Wt=l(K),u(Me.$$.fragment,K),K.forEach(i),w.forEach(i),dt=l(d),u(Y.$$.fragment,d),Fe=l(d),re=m(d,"DIV",{class:!0});var G=J(re);u(Ie.$$.fragment,G),Tt=l(G),Mt=m(G,"P",{"data-svelte-h":!0}),y(Mt)!=="svelte-tf7otj"&&(Mt.textContent=Ue),Ot=l(G),me=m(G,"P",{"data-svelte-h":!0}),y(me)!=="svelte-1j6h1a3"&&(me.innerHTML=Kt),r=l(G),B=m(G,"P",{"data-svelte-h":!0}),y(B)!=="svelte-1be7e3c"&&(B.innerHTML=U),ke=l(G),W=m(G,"DIV",{class:!0});var ee=J(W);u(V.$$.fragment,ee),ot=l(ee),vt=m(ee,"P",{"data-svelte-h":!0}),y(vt)!=="svelte-zbclbb"&&(vt.innerHTML=Zt),qt=l(ee),u(nt.$$.fragment,ee),ho=l(ee),u(ao.$$.fragment,ee),ee.forEach(i),G.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(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(H,"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(Ze,"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(le,"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(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Q,"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(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(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,g,j),f(d,o,j),_(n,o,null),s(o,v),s(o,t),_($,t,null),s(t,Qt),s(t,ae),s(t,Yt),_(A,t,null),s(t,uo),_(Qe,t,null),s(o,q),s(o,D),_(st,D,null),s(D,ze),s(D,At),s(D,fe),_(ct,D,null),s(D,Ye),_(ge,D,null),s(o,ye),s(o,H),_(we,H,null),s(H,Vt),s(H,xt),s(H,Ae),_(he,H,null),s(H,pt),_(De,H,null),f(d,P,j),_(ue,d,j),f(d,E,j),f(d,Z,j),_(Jt,Z,null),s(Z,Ct),s(Z,We),s(Z,$e),s(Z,Ze),_(Be,Ze,null),s(Ze,Oe),s(Ze,te),s(Ze,mt),_(je,Ze,null),f(d,Ft,j),_(It,d,j),f(d,_e,j),f(d,R,j),_(rt,R,null),s(R,L),s(R,le),_(ft,le,null),s(le,Ke),s(le,Dt),s(le,Ne),_(at,le,null),f(d,Ve,j),_(X,d,j),f(d,Ht,j),f(d,I,j),_(be,I,null),s(I,ie),s(I,de),s(I,Ut),s(I,He),s(I,Pe),s(I,kt),s(I,Te),s(I,ce),_(ne,ce,null),s(ce,so),s(ce,N),s(ce,fo),_(Je,ce,null),s(ce,Pt),_(gt,ce,null),f(d,ht,j),_(O,d,j),f(d,lt,j),f(d,z,j),_(se,z,null),s(z,go),s(z,tt),s(z,ro),s(z,S),s(z,_t),s(z,Re),s(z,it),s(z,Q),_(Ce,Q,null),s(Q,Ge),s(Q,qe),s(Q,Gt),_(bt,Q,null),s(Q,Wt),_(Me,Q,null),f(d,dt,j),_(Y,d,j),f(d,Fe,j),f(d,re,j),_(Ie,re,null),s(re,Tt),s(re,Mt),s(re,Ot),s(re,me),s(re,r),s(re,B),s(re,ke),s(re,W),_(V,W,null),s(W,ot),s(W,vt),s(W,qt),_(nt,W,null),s(W,ho),_(ao,W,null),vo=!0},p(d,j){const yt={};j&2&&(yt.$$scope={dirty:j,ctx:d}),A.$set(yt);const Ee={};j&2&&(Ee.$$scope={dirty:j,ctx:d}),Qe.$set(Ee);const Nt={};j&2&&(Nt.$$scope={dirty:j,ctx:d}),ct.$set(Nt);const Et={};j&2&&(Et.$$scope={dirty:j,ctx:d}),ge.$set(Et);const Le={};j&2&&(Le.$$scope={dirty:j,ctx:d}),he.$set(Le);const lo={};j&2&&(lo.$$scope={dirty:j,ctx:d}),De.$set(lo);const Xe={};j&2&&(Xe.$$scope={dirty:j,ctx:d}),je.$set(Xe);const Se={};j&2&&(Se.$$scope={dirty:j,ctx:d}),at.$set(Se);const c={};j&2&&(c.$$scope={dirty:j,ctx:d}),Je.$set(c);const w={};j&2&&(w.$$scope={dirty:j,ctx:d}),gt.$set(w);const K={};j&2&&(K.$$scope={dirty:j,ctx:d}),bt.$set(K);const G={};j&2&&(G.$$scope={dirty:j,ctx:d}),Me.$set(G);const ee={};j&2&&(ee.$$scope={dirty:j,ctx:d}),nt.$set(ee);const eo={};j&2&&(eo.$$scope={dirty:j,ctx:d}),ao.$set(eo)},i(d){vo||(b(e.$$.fragment,d),b(n.$$.fragment,d),b($.$$.fragment,d),b(A.$$.fragment,d),b(Qe.$$.fragment,d),b(st.$$.fragment,d),b(ct.$$.fragment,d),b(ge.$$.fragment,d),b(we.$$.fragment,d),b(he.$$.fragment,d),b(De.$$.fragment,d),b(ue.$$.fragment,d),b(Jt.$$.fragment,d),b(Be.$$.fragment,d),b(je.$$.fragment,d),b(It.$$.fragment,d),b(rt.$$.fragment,d),b(ft.$$.fragment,d),b(at.$$.fragment,d),b(X.$$.fragment,d),b(be.$$.fragment,d),b(ne.$$.fragment,d),b(Je.$$.fragment,d),b(gt.$$.fragment,d),b(O.$$.fragment,d),b(se.$$.fragment,d),b(Ce.$$.fragment,d),b(bt.$$.fragment,d),b(Me.$$.fragment,d),b(Y.$$.fragment,d),b(Ie.$$.fragment,d),b(V.$$.fragment,d),b(nt.$$.fragment,d),b(ao.$$.fragment,d),vo=!0)},o(d){T(e.$$.fragment,d),T(n.$$.fragment,d),T($.$$.fragment,d),T(A.$$.fragment,d),T(Qe.$$.fragment,d),T(st.$$.fragment,d),T(ct.$$.fragment,d),T(ge.$$.fragment,d),T(we.$$.fragment,d),T(he.$$.fragment,d),T(De.$$.fragment,d),T(ue.$$.fragment,d),T(Jt.$$.fragment,d),T(Be.$$.fragment,d),T(je.$$.fragment,d),T(It.$$.fragment,d),T(rt.$$.fragment,d),T(ft.$$.fragment,d),T(at.$$.fragment,d),T(X.$$.fragment,d),T(be.$$.fragment,d),T(ne.$$.fragment,d),T(Je.$$.fragment,d),T(gt.$$.fragment,d),T(O.$$.fragment,d),T(se.$$.fragment,d),T(Ce.$$.fragment,d),T(bt.$$.fragment,d),T(Me.$$.fragment,d),T(Y.$$.fragment,d),T(Ie.$$.fragment,d),T(V.$$.fragment,d),T(nt.$$.fragment,d),T(ao.$$.fragment,d),vo=!1},d(d){d&&(i(g),i(o),i(P),i(E),i(Z),i(Ft),i(_e),i(R),i(Ve),i(Ht),i(I),i(ht),i(lt),i(z),i(dt),i(Fe),i(re)),M(e,d),M(n),M($),M(A),M(Qe),M(st),M(ct),M(ge),M(we),M(he),M(De),M(ue,d),M(Jt),M(Be),M(je),M(It,d),M(rt),M(ft),M(at),M(X,d),M(be),M(ne),M(Je),M(gt),M(O,d),M(se),M(Ce),M(bt),M(Me),M(Y,d),M(Ie),M(V),M(nt),M(ao)}}}function pn(x){let e,g;return e=new wo({props:{$$slots:{default:[cn]},$$scope:{ctx:x}}}),{c(){h(e.$$.fragment)},l(o){u(e.$$.fragment,o)},m(o,n){_(e,o,n),g=!0},p(o,n){const v={};n&2&&(v.$$scope={dirty:n,ctx:o}),e.$set(v)},i(o){g||(b(e.$$.fragment,o),g=!0)},o(o){T(e.$$.fragment,o),g=!1},d(o){M(e,o)}}}function mn(x){let e,g,o,n,v,t,$,Qt,ae,Mo='BLIP モデルは、<a href="https://arxiv.org/abs/2201.12086" rel="nofollow">BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation</a> で Junnan Li、Dongxu Li、Caiming Xiong、Steven Hoi によって提案されました。 。',Yt,A,uo="BLIP は、次のようなさまざまなマルチモーダル タスクを実行できるモデルです。",Qe,q,D="<li>視覚的な質問応答</li> <li>画像とテキストの検索（画像とテキストのマッチング）</li> <li>画像キャプション</li>",st,ze,At="論文の要約は次のとおりです。",to,fe,ct=`<em>視覚言語事前トレーニング (VLP) により、多くの視覚言語タスクのパフォーマンスが向上しました。
ただし、既存の事前トレーニング済みモデルのほとんどは、理解ベースのタスクまたは世代ベースのタスクのいずれかでのみ優れています。さらに、最適ではない監視ソースである Web から収集されたノイズの多い画像とテキストのペアを使用してデータセットをスケールアップすることで、パフォーマンスの向上が大幅に達成されました。この論文では、視覚言語の理解と生成タスクの両方に柔軟に移行する新しい VLP フレームワークである BLIP を提案します。 BLIP は、キャプションをブートストラップすることでノイズの多い Web データを効果的に利用します。キャプショナーが合成キャプションを生成し、フィルターがノイズの多いキャプションを除去します。画像テキスト検索 (平均再現率 +2.7%@1)、画像キャプション作成 (CIDEr で +2.8%)、VQA ( VQA スコアは +1.6%)。 BLIP は、ゼロショット方式でビデオ言語タスクに直接転送した場合にも、強力な一般化能力を発揮します。コード、モデル、データセットがリリースされています。</em>`,Ye,ge,ye='<img src="https://cdn-uploads.huggingface.co/production/uploads/1670928184033-62441d1d9fdefb55a0b7d12c.gif" alt="BLIP.gif"/>',H,we,Vt=`このモデルは <a href="https://huggingface.co/ybelkada" rel="nofollow">ybelkada</a> によって提供されました。
元のコードは <a href="https://github.com/salesforce/BLIP" rel="nofollow">ここ</a> にあります。`,xt,jt,Ae,he,pt='<li><a href="https://github.com/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb" rel="nofollow">Jupyter ノートブック</a> カスタム データセットの画像キャプション用に BLIP を微調整する方法</li>',De,P,ue,E,Z,Jt,Ct,We=`<a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipConfig">BlipConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/ja/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.`,mo,$e,Ze=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31098/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Be,Oe,te,xe,mt,je,Ft,It=`Instantiate a <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipConfig">BlipConfig</a> (or a derived class) from blip text model configuration and blip vision model
configuration.`,_e,R,rt,L,le,ft,Ke,Dt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/ja/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>.`,oo,Ne,at=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31098/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ve,X,Ht,I,be,ie,de,_o,Ut,He=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31098/ja/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.`,no,Pe,kt=`Configuration objects inherit from <a href="/docs/transformers/pr_31098/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31098/ja/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,oe,Te,ce,ne,so,N,et,fo,Je,Pt="Constructs a BLIP processor which wraps a BERT tokenizer and BLIP image processor into a single processor.",gt,ht,O=`<a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipProcessor">BlipProcessor</a> offers all the functionalities of <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a> and <a href="/docs/transformers/pr_31098/ja/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>. See the
docstring of <code>__call__()</code> and <a href="/docs/transformers/pr_31098/ja/model_doc/blip#transformers.BlipProcessor.decode">decode()</a> for more information.`,lt,z,se,go,tt,zt=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/pr_31098/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ro,S,ut,_t,Re,pe=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/pr_31098/ja/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,it,Q,Ce,Ge,qe,Rt,Gt,bt="Constructs a BLIP image processor.",Wt,Me,dt,Y,Fe,re="Preprocess an image or batch of images.",Ie,Tt,Mt,Ue,Ot,me,Kt;return v=new ve({props:{title:"BLIP",local:"blip",headingTag:"h1"}}),$=new ve({props:{title:"Overview",local:"overview",headingTag:"h2"}}),jt=new ve({props:{title:"Resources",local:"resources",headingTag:"h2"}}),P=new ve({props:{title:"BlipConfig",local:"transformers.BlipConfig",headingTag:"h2"}}),Z=new F({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/pr_31098/ja/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/pr_31098/ja/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;
Dimensionality 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 initial value of the <em>logit_scale</em> parameter. 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;
Dimensionality 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/vr_31098/src/transformers/models/blip/configuration_blip.py#L267"}}),Oe=new $t({props:{anchor:"transformers.BlipConfig.example",$$slots:{default:[Io]},$$scope:{ctx:x}}}),mt=new F({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/vr_31098/src/transformers/models/blip/configuration_blip.py#L352",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/pr_31098/ja/model_doc/blip#transformers.BlipConfig"
>BlipConfig</a></p>
`}}),R=new ve({props:{title:"BlipTextConfig",local:"transformers.BlipTextConfig",headingTag:"h2"}}),le=new F({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/pr_31098/ja/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/vr_31098/src/transformers/models/blip/configuration_blip.py#L27"}}),X=new $t({props:{anchor:"transformers.BlipTextConfig.example",$$slots:{default:[Uo]},$$scope:{ctx:x}}}),I=new ve({props:{title:"BlipVisionConfig",local:"transformers.BlipVisionConfig",headingTag:"h2"}}),de=new F({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/vr_31098/src/transformers/models/blip/configuration_blip.py#L168"}}),Te=new $t({props:{anchor:"transformers.BlipVisionConfig.example",$$slots:{default:[ko]},$$scope:{ctx:x}}}),ne=new ve({props:{title:"BlipProcessor",local:"transformers.BlipProcessor",headingTag:"h2"}}),et=new F({props:{name:"class transformers.BlipProcessor",anchor:"transformers.BlipProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipProcessor.image_processor",description:`<strong>image_processor</strong> (<code>BlipImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/pr_31098/ja/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/vr_31098/src/transformers/models/blip/processing_blip.py#L27"}}),se=new F({props:{name:"batch_decode",anchor:"transformers.BlipProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/processing_blip.py#L133"}}),ut=new F({props:{name:"decode",anchor:"transformers.BlipProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31098/src/transformers/models/blip/processing_blip.py#L140"}}),Q=new ve({props:{title:"BlipImageProcessor",local:"transformers.BlipImageProcessor",headingTag:"h2"}}),qe=new F({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/vr_31098/src/transformers/models/blip/image_processing_blip.py#L46"}}),dt=new F({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"}],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/vr_31098/src/transformers/models/blip/image_processing_blip.py#L159"}}),Tt=new Co({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[pn],pytorch:[Qo]},$$scope:{ctx:x}}}),Ue=new Fo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/model_doc/blip.md"}}),{c(){e=p("meta"),g=a(),o=p("p"),n=a(),h(v.$$.fragment),t=a(),h($.$$.fragment),Qt=a(),ae=p("p"),ae.innerHTML=Mo,Yt=a(),A=p("p"),A.textContent=uo,Qe=a(),q=p("ul"),q.innerHTML=D,st=a(),ze=p("p"),ze.textContent=At,to=a(),fe=p("p"),fe.innerHTML=ct,Ye=a(),ge=p("p"),ge.innerHTML=ye,H=a(),we=p("p"),we.innerHTML=Vt,xt=a(),h(jt.$$.fragment),Ae=a(),he=p("ul"),he.innerHTML=pt,De=a(),h(P.$$.fragment),ue=a(),E=p("div"),h(Z.$$.fragment),Jt=a(),Ct=p("p"),Ct.innerHTML=We,mo=a(),$e=p("p"),$e.innerHTML=Ze,Be=a(),h(Oe.$$.fragment),te=a(),xe=p("div"),h(mt.$$.fragment),je=a(),Ft=p("p"),Ft.innerHTML=It,_e=a(),h(R.$$.fragment),rt=a(),L=p("div"),h(le.$$.fragment),ft=a(),Ke=p("p"),Ke.innerHTML=Dt,oo=a(),Ne=p("p"),Ne.innerHTML=at,Ve=a(),h(X.$$.fragment),Ht=a(),h(I.$$.fragment),be=a(),ie=p("div"),h(de.$$.fragment),_o=a(),Ut=p("p"),Ut.innerHTML=He,no=a(),Pe=p("p"),Pe.innerHTML=kt,oe=a(),h(Te.$$.fragment),ce=a(),h(ne.$$.fragment),so=a(),N=p("div"),h(et.$$.fragment),fo=a(),Je=p("p"),Je.textContent=Pt,gt=a(),ht=p("p"),ht.innerHTML=O,lt=a(),z=p("div"),h(se.$$.fragment),go=a(),tt=p("p"),tt.innerHTML=zt,ro=a(),S=p("div"),h(ut.$$.fragment),_t=a(),Re=p("p"),Re.innerHTML=pe,it=a(),h(Q.$$.fragment),Ce=a(),Ge=p("div"),h(qe.$$.fragment),Rt=a(),Gt=p("p"),Gt.textContent=bt,Wt=a(),Me=p("div"),h(dt.$$.fragment),Y=a(),Fe=p("p"),Fe.textContent=re,Ie=a(),h(Tt.$$.fragment),Mt=a(),h(Ue.$$.fragment),Ot=a(),me=p("p"),this.h()},l(r){const B=Jo("svelte-u9bgzb",document.head);e=m(B,"META",{name:!0,content:!0}),B.forEach(i),g=l(r),o=m(r,"P",{}),J(o).forEach(i),n=l(r),u(v.$$.fragment,r),t=l(r),u($.$$.fragment,r),Qt=l(r),ae=m(r,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1xrfp3j"&&(ae.innerHTML=Mo),Yt=l(r),A=m(r,"P",{"data-svelte-h":!0}),y(A)!=="svelte-128dm41"&&(A.textContent=uo),Qe=l(r),q=m(r,"UL",{"data-svelte-h":!0}),y(q)!=="svelte-1l4maww"&&(q.innerHTML=D),st=l(r),ze=m(r,"P",{"data-svelte-h":!0}),y(ze)!=="svelte-1cv3nri"&&(ze.textContent=At),to=l(r),fe=m(r,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-xdcya2"&&(fe.innerHTML=ct),Ye=l(r),ge=m(r,"P",{"data-svelte-h":!0}),y(ge)!=="svelte-1nlkgp7"&&(ge.innerHTML=ye),H=l(r),we=m(r,"P",{"data-svelte-h":!0}),y(we)!=="svelte-rej0xj"&&(we.innerHTML=Vt),xt=l(r),u(jt.$$.fragment,r),Ae=l(r),he=m(r,"UL",{"data-svelte-h":!0}),y(he)!=="svelte-hspfmr"&&(he.innerHTML=pt),De=l(r),u(P.$$.fragment,r),ue=l(r),E=m(r,"DIV",{class:!0});var U=J(E);u(Z.$$.fragment,U),Jt=l(U),Ct=m(U,"P",{"data-svelte-h":!0}),y(Ct)!=="svelte-9wx269"&&(Ct.innerHTML=We),mo=l(U),$e=m(U,"P",{"data-svelte-h":!0}),y($e)!=="svelte-fgz6mb"&&($e.innerHTML=Ze),Be=l(U),u(Oe.$$.fragment,U),te=l(U),xe=m(U,"DIV",{class:!0});var ke=J(xe);u(mt.$$.fragment,ke),je=l(ke),Ft=m(ke,"P",{"data-svelte-h":!0}),y(Ft)!=="svelte-z7wzo6"&&(Ft.innerHTML=It),ke.forEach(i),U.forEach(i),_e=l(r),u(R.$$.fragment,r),rt=l(r),L=m(r,"DIV",{class:!0});var W=J(L);u(le.$$.fragment,W),ft=l(W),Ke=m(W,"P",{"data-svelte-h":!0}),y(Ke)!=="svelte-jqi487"&&(Ke.innerHTML=Dt),oo=l(W),Ne=m(W,"P",{"data-svelte-h":!0}),y(Ne)!=="svelte-fgz6mb"&&(Ne.innerHTML=at),Ve=l(W),u(X.$$.fragment,W),W.forEach(i),Ht=l(r),u(I.$$.fragment,r),be=l(r),ie=m(r,"DIV",{class:!0});var V=J(ie);u(de.$$.fragment,V),_o=l(V),Ut=m(V,"P",{"data-svelte-h":!0}),y(Ut)!=="svelte-djaw6c"&&(Ut.innerHTML=He),no=l(V),Pe=m(V,"P",{"data-svelte-h":!0}),y(Pe)!=="svelte-fgz6mb"&&(Pe.innerHTML=kt),oe=l(V),u(Te.$$.fragment,V),V.forEach(i),ce=l(r),u(ne.$$.fragment,r),so=l(r),N=m(r,"DIV",{class:!0});var ot=J(N);u(et.$$.fragment,ot),fo=l(ot),Je=m(ot,"P",{"data-svelte-h":!0}),y(Je)!=="svelte-4ee3u1"&&(Je.textContent=Pt),gt=l(ot),ht=m(ot,"P",{"data-svelte-h":!0}),y(ht)!=="svelte-1wmrxwl"&&(ht.innerHTML=O),lt=l(ot),z=m(ot,"DIV",{class:!0});var vt=J(z);u(se.$$.fragment,vt),go=l(vt),tt=m(vt,"P",{"data-svelte-h":!0}),y(tt)!=="svelte-q88loj"&&(tt.innerHTML=zt),vt.forEach(i),ro=l(ot),S=m(ot,"DIV",{class:!0});var Zt=J(S);u(ut.$$.fragment,Zt),_t=l(Zt),Re=m(Zt,"P",{"data-svelte-h":!0}),y(Re)!=="svelte-1pekt41"&&(Re.innerHTML=pe),Zt.forEach(i),ot.forEach(i),it=l(r),u(Q.$$.fragment,r),Ce=l(r),Ge=m(r,"DIV",{class:!0});var qt=J(Ge);u(qe.$$.fragment,qt),Rt=l(qt),Gt=m(qt,"P",{"data-svelte-h":!0}),y(Gt)!=="svelte-17e80zr"&&(Gt.textContent=bt),Wt=l(qt),Me=m(qt,"DIV",{class:!0});var nt=J(Me);u(dt.$$.fragment,nt),Y=l(nt),Fe=m(nt,"P",{"data-svelte-h":!0}),y(Fe)!=="svelte-1x3yxsa"&&(Fe.textContent=re),nt.forEach(i),qt.forEach(i),Ie=l(r),u(Tt.$$.fragment,r),Mt=l(r),u(Ue.$$.fragment,r),Ot=l(r),me=m(r,"P",{}),J(me).forEach(i),this.h()},h(){C(e,"name","hf:doc:metadata"),C(e,"content",fn),C(xe,"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(L,"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(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(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(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(Me,"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")},m(r,B){s(document.head,e),f(r,g,B),f(r,o,B),f(r,n,B),_(v,r,B),f(r,t,B),_($,r,B),f(r,Qt,B),f(r,ae,B),f(r,Yt,B),f(r,A,B),f(r,Qe,B),f(r,q,B),f(r,st,B),f(r,ze,B),f(r,to,B),f(r,fe,B),f(r,Ye,B),f(r,ge,B),f(r,H,B),f(r,we,B),f(r,xt,B),_(jt,r,B),f(r,Ae,B),f(r,he,B),f(r,De,B),_(P,r,B),f(r,ue,B),f(r,E,B),_(Z,E,null),s(E,Jt),s(E,Ct),s(E,mo),s(E,$e),s(E,Be),_(Oe,E,null),s(E,te),s(E,xe),_(mt,xe,null),s(xe,je),s(xe,Ft),f(r,_e,B),_(R,r,B),f(r,rt,B),f(r,L,B),_(le,L,null),s(L,ft),s(L,Ke),s(L,oo),s(L,Ne),s(L,Ve),_(X,L,null),f(r,Ht,B),_(I,r,B),f(r,be,B),f(r,ie,B),_(de,ie,null),s(ie,_o),s(ie,Ut),s(ie,no),s(ie,Pe),s(ie,oe),_(Te,ie,null),f(r,ce,B),_(ne,r,B),f(r,so,B),f(r,N,B),_(et,N,null),s(N,fo),s(N,Je),s(N,gt),s(N,ht),s(N,lt),s(N,z),_(se,z,null),s(z,go),s(z,tt),s(N,ro),s(N,S),_(ut,S,null),s(S,_t),s(S,Re),f(r,it,B),_(Q,r,B),f(r,Ce,B),f(r,Ge,B),_(qe,Ge,null),s(Ge,Rt),s(Ge,Gt),s(Ge,Wt),s(Ge,Me),_(dt,Me,null),s(Me,Y),s(Me,Fe),f(r,Ie,B),_(Tt,r,B),f(r,Mt,B),_(Ue,r,B),f(r,Ot,B),f(r,me,B),Kt=!0},p(r,[B]){const U={};B&2&&(U.$$scope={dirty:B,ctx:r}),Oe.$set(U);const ke={};B&2&&(ke.$$scope={dirty:B,ctx:r}),X.$set(ke);const W={};B&2&&(W.$$scope={dirty:B,ctx:r}),Te.$set(W);const V={};B&2&&(V.$$scope={dirty:B,ctx:r}),Tt.$set(V)},i(r){Kt||(b(v.$$.fragment,r),b($.$$.fragment,r),b(jt.$$.fragment,r),b(P.$$.fragment,r),b(Z.$$.fragment,r),b(Oe.$$.fragment,r),b(mt.$$.fragment,r),b(R.$$.fragment,r),b(le.$$.fragment,r),b(X.$$.fragment,r),b(I.$$.fragment,r),b(de.$$.fragment,r),b(Te.$$.fragment,r),b(ne.$$.fragment,r),b(et.$$.fragment,r),b(se.$$.fragment,r),b(ut.$$.fragment,r),b(Q.$$.fragment,r),b(qe.$$.fragment,r),b(dt.$$.fragment,r),b(Tt.$$.fragment,r),b(Ue.$$.fragment,r),Kt=!0)},o(r){T(v.$$.fragment,r),T($.$$.fragment,r),T(jt.$$.fragment,r),T(P.$$.fragment,r),T(Z.$$.fragment,r),T(Oe.$$.fragment,r),T(mt.$$.fragment,r),T(R.$$.fragment,r),T(le.$$.fragment,r),T(X.$$.fragment,r),T(I.$$.fragment,r),T(de.$$.fragment,r),T(Te.$$.fragment,r),T(ne.$$.fragment,r),T(et.$$.fragment,r),T(se.$$.fragment,r),T(ut.$$.fragment,r),T(Q.$$.fragment,r),T(qe.$$.fragment,r),T(dt.$$.fragment,r),T(Tt.$$.fragment,r),T(Ue.$$.fragment,r),Kt=!1},d(r){r&&(i(g),i(o),i(n),i(t),i(Qt),i(ae),i(Yt),i(A),i(Qe),i(q),i(st),i(ze),i(to),i(fe),i(Ye),i(ge),i(H),i(we),i(xt),i(Ae),i(he),i(De),i(ue),i(E),i(_e),i(rt),i(L),i(Ht),i(be),i(ie),i(ce),i(so),i(N),i(it),i(Ce),i(Ge),i(Ie),i(Mt),i(Ot),i(me)),i(e),M(v,r),M($,r),M(jt,r),M(P,r),M(Z),M(Oe),M(mt),M(R,r),M(le),M(X),M(I,r),M(de),M(Te),M(ne,r),M(et),M(se),M(ut),M(Q,r),M(qe),M(dt),M(Tt,r),M(Ue,r)}}}const fn='{"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 gn(x){return Bo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wn extends xo{constructor(e){super(),jo(this,e,gn,mn,$o,{})}}export{wn as component};
