import{S as Df,i as Nf,s as Rf,e as s,k as p,w as $,t as n,M as Wf,c as a,d as o,m,a as i,x as w,h as r,b as c,N as Gf,G as e,g as _,y,q as B,o as x,B as T,v as Uf,L as Oe}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ro}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ve}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as O}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Se}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Qf(P){let d,b,u,h,v;return h=new Ve({props:{code:`from transformers import BlipConfig, BlipModel

# Initializing a BlipConfig with Salesforce/blip-vqa-base style configuration
configuration = BlipConfig()

# Initializing a BlipPModel (with random weights) from the Salesforce/blip-vqa-base style configuration
model = BlipModel(configuration)

# Accessing the model configuration
configuration = model.config

# We can also initialize a BlipConfig from a BlipTextConfig and a BlipVisionConfig

# Initializing a BLIPText and BLIPVision configuration
config_text = BlipTextConfig()
config_vision = BlipVisionConfig()

config = BlipConfig.from_text_vision_configs(config_text, config_vision)`,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)`}}),{c(){d=s("p"),b=n("Example:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Example:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function Hf(P){let d,b,u,h,v;return h=new Ve({props:{code:`from transformers import BlipTextConfig, BlipTextModel

# Initializing a BlipTextConfig with Salesforce/blip-vqa-base style configuration
configuration = BlipTextConfig()

# Initializing a BlipTextModel (with random weights) from the Salesforce/blip-vqa-base style configuration
model = BlipTextModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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`}}),{c(){d=s("p"),b=n("Example:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Example:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function Jf(P){let d,b,u,h,v;return h=new Ve({props:{code:`from transformers import BlipVisionConfig, BlipVisionModel

# Initializing a BlipVisionConfig with Salesforce/blip-vqa-base style configuration
configuration = BlipVisionConfig()

# Initializing a BlipVisionModel (with random weights) from the Salesforce/blip-vqa-base style configuration
model = BlipVisionModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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`}}),{c(){d=s("p"),b=n("Example:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Example:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function Xf(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function Kf(P){let d,b,u,h,v;return h=new Ve({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, BlipModel

model = BlipModel.from_pretrained("Salesforce/blip-image-captioning-base")
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")

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

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

outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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>`}}),{c(){d=s("p"),b=n("Examples:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Examples:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function Yf(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function Zf(P){let d,b,u,h,v;return h=new Ve({props:{code:`from transformers import AutoProcessor, BlipModel

model = BlipModel.from_pretrained("Salesforce/blip-image-captioning-base")
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")

inputs = processor(text=["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")
text_features = model.get_text_features(**inputs)`,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)`}}),{c(){d=s("p"),b=n("Examples:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Examples:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function eh(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function th(P){let d,b,u,h,v;return h=new Ve({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, BlipModel

model = BlipModel.from_pretrained("Salesforce/blip-image-captioning-base")
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")

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

inputs = processor(images=image, return_tensors="pt")

image_features = model.get_image_features(**inputs)`,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)`}}),{c(){d=s("p"),b=n("Examples:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Examples:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function oh(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function nh(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function rh(P){let d,b,u,h,v;return h=new Ve({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, BlipForConditionalGeneration

processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base")

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

inputs = processor(images=image, text=text, return_tensors="pt")

outputs = model(**inputs)`,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)`}}),{c(){d=s("p"),b=n("Examples:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Examples:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function sh(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function ah(P){let d,b,u,h,v;return h=new Ve({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, BlipForImageTextRetrieval

model = BlipForImageTextRetrieval.from_pretrained("Salesforce/blip-itm-base-coco")
processor = AutoProcessor.from_pretrained("Salesforce/blip-itm-base-coco")

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

inputs = processor(images=image, text=text, return_tensors="pt")
outputs = model(**inputs)`,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)`}}),{c(){d=s("p"),b=n("Examples:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Examples:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function ih(P){let d,b,u,h,v;return{c(){d=s("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(f,"CODE",{});var I=i(u);h=r(I,"Module"),I.forEach(o),v=r(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){_(l,d,f),e(d,b),e(d,u),e(u,h),e(d,v)},d(l){l&&o(d)}}}function lh(P){let d,b,u,h,v;return h=new Ve({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, BlipForQuestionAnswering

model = BlipForQuestionAnswering.from_pretrained("Salesforce/blip-vqa-base")
processor = AutoProcessor.from_pretrained("Salesforce/blip-vqa-base")

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

# training
text = "How many cats are in the picture?"
label = "2"
inputs = processor(images=image, text=text, return_tensors="pt")
labels = processor(text=label, return_tensors="pt").input_ids

inputs["labels"] = labels
outputs = model(**inputs)
loss = outputs.loss
loss.backward()

# inference
text = "How many cats are in the picture?"
inputs = processor(images=image, text=text, return_tensors="pt")
outputs = model.generate(**inputs)
print(processor.decode(outputs[0], skip_special_tokens=True))`,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>`}}),{c(){d=s("p"),b=n("Examples:"),u=p(),$(h.$$.fragment)},l(l){d=a(l,"P",{});var f=i(d);b=r(f,"Examples:"),f.forEach(o),u=m(l),w(h.$$.fragment,l)},m(l,f){_(l,d,f),e(d,b),_(l,u,f),y(h,l,f),v=!0},p:Oe,i(l){v||(B(h.$$.fragment,l),v=!0)},o(l){x(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(u),T(h,l)}}}function dh(P){let d,b,u,h,v,l,f,I,Ba,fs,me,De,Nn,Ct,xa,Rn,Ta,hs,Ne,Pa,Mt,ka,Ea,gs,Wo,Ia,us,te,Wn,Ca,Ma,Gn,ja,za,Un,qa,_s,Go,Aa,vs,Uo,Qn,Fa,bs,Qo,Ho,Mp,$s,oe,La,jt,Sa,Oa,zt,Va,Da,ws,fe,Re,Hn,qt,Na,Jn,Ra,ys,Jo,Xo,At,Wa,Ga,Bs,he,We,Xn,Ft,Ua,Kn,Qa,xs,j,Lt,Ha,ne,Ko,Ja,Xa,Yo,Ka,Ya,St,Za,ei,ti,ge,oi,Zo,ni,ri,en,si,ai,ii,Ge,li,Ue,Ot,di,Vt,ci,tn,pi,mi,Ts,ue,Qe,Yn,Dt,fi,Zn,hi,Ps,V,Nt,gi,K,ui,on,_i,vi,er,bi,$i,Rt,wi,yi,Bi,_e,xi,nn,Ti,Pi,rn,ki,Ei,Ii,He,ks,ve,Je,tr,Wt,Ci,or,Mi,Es,D,Gt,ji,be,zi,sn,qi,Ai,Ut,Fi,Li,Si,$e,Oi,an,Vi,Di,ln,Ni,Ri,Wi,Xe,Is,we,Ke,nr,Qt,Gi,rr,Ui,Cs,z,Ht,Qi,sr,Hi,Ji,S,dn,Xi,Ki,cn,Yi,Zi,pn,el,tl,ar,ol,nl,mn,rl,sl,al,Ye,Jt,il,Xt,ll,fn,dl,cl,pl,Ze,Kt,ml,Yt,fl,hn,hl,gl,Ms,ye,et,ir,Zt,ul,lr,_l,js,Y,eo,vl,dr,bl,$l,tt,to,wl,cr,yl,zs,Be,ot,pr,oo,Bl,mr,xl,qs,M,no,Tl,ro,Pl,gn,kl,El,Il,so,Cl,ao,Ml,jl,zl,R,io,ql,xe,Al,un,Fl,Ll,fr,Sl,Ol,Vl,nt,Dl,rt,Nl,W,lo,Rl,Te,Wl,_n,Gl,Ul,hr,Ql,Hl,Jl,st,Xl,at,Kl,G,co,Yl,Pe,Zl,vn,ed,td,gr,od,nd,rd,it,sd,lt,As,ke,dt,ur,po,ad,_r,id,Fs,Z,mo,ld,N,dd,fo,cd,pd,vr,md,fd,br,hd,gd,$r,ud,_d,vd,re,ho,bd,q,$d,wr,wd,yd,yr,Bd,xd,Br,Td,Pd,xr,kd,Ed,Tr,Id,Cd,Md,go,uo,jd,Pr,zd,qd,Ad,k,Fd,kr,Ld,Sd,Er,Od,Vd,Ir,Dd,Nd,Cr,Rd,Wd,Mr,Gd,Ud,jr,Qd,Hd,zr,Jd,Xd,qr,Kd,Yd,Ar,Zd,ec,Fr,tc,oc,Lr,nc,rc,Sr,sc,ac,Or,ic,lc,Ls,Ee,ct,Vr,_o,dc,Dr,cc,Ss,Ie,vo,pc,se,bo,mc,Ce,fc,bn,hc,gc,Nr,uc,_c,vc,pt,Os,Me,mt,Rr,$o,bc,Wr,$c,Vs,A,wo,wc,yo,yc,Gr,Bc,xc,Tc,Bo,Pc,$n,kc,Ec,Ic,xo,Cc,To,Mc,jc,zc,U,Po,qc,je,Ac,wn,Fc,Lc,Ur,Sc,Oc,Vc,ft,Dc,ht,Ds,ze,gt,Qr,ko,Nc,Hr,Rc,Ns,F,Eo,Wc,Jr,Gc,Uc,Io,Qc,yn,Hc,Jc,Xc,Co,Kc,Mo,Yc,Zc,ep,Q,jo,tp,qe,op,Bn,np,rp,Xr,sp,ap,ip,ut,lp,_t,Rs,Ae,vt,Kr,zo,dp,Yr,cp,Ws,L,qo,pp,Zr,mp,fp,Ao,hp,xn,gp,up,_p,Fo,vp,Lo,bp,$p,wp,H,So,yp,Fe,Bp,Tn,xp,Tp,es,Pp,kp,Ep,bt,Ip,$t,Gs;return l=new O({}),Ct=new O({}),qt=new O({}),Ft=new O({}),Lt=new C({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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipTextConfig">BlipTextConfig</a>.`,name:"text_config"},{anchor:"transformers.BlipConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipVisionConfig">BlipVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.BlipConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.BlipConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original BLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.BlipConfig.image_text_hidden_size",description:`<strong>image_text_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimentionality of the hidden state of the image-text fusion layer.`,name:"image_text_hidden_size"},{anchor:"transformers.BlipConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/configuration_blip.py#L278"}}),Ge=new Se({props:{anchor:"transformers.BlipConfig.example",$$slots:{default:[Qf]},$$scope:{ctx:P}}}),Ot=new C({props:{name:"from_text_vision_configs",anchor:"transformers.BlipConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": BlipTextConfig"},{name:"vision_config",val:": BlipVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/configuration_blip.py#L358",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig"
>BlipConfig</a></p>
`}}),Dt=new O({}),Nt=new C({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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the <code>Blip</code> text model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipModel">BlipModel</a>.`,name:"vocab_size"},{anchor:"transformers.BlipTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BlipTextConfig.encoder_hidden_size",description:`<strong>encoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers from the vision model.`,name:"encoder_hidden_size"},{anchor:"transformers.BlipTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BlipTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.BlipTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.BlipTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#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>False</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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/configuration_blip.py#L47"}}),He=new Se({props:{anchor:"transformers.BlipTextConfig.example",$$slots:{default:[Hf]},$$scope:{ctx:P}}}),Wt=new O({}),Gt=new C({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:"num_channels",val:" = 3"},{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 224) &#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 32) &#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 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/configuration_blip.py#L179"}}),Xe=new Se({props:{anchor:"transformers.BlipVisionConfig.example",$$slots:{default:[Jf]},$$scope:{ctx:P}}}),Qt=new O({}),Ht=new C({props:{name:"class transformers.BlipProcessor",anchor:"transformers.BlipProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.BlipProcessor.image_processor",description:`<strong>image_processor</strong> (<code>BlipImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.BlipProcessor.tokenizer",description:"<strong>tokenizer</strong> (<code>BertTokenizerFast</code>) &#x2014;\nAn instance of [&#x2018;BertTokenizerFast`]. The tokenizer is a required input.",name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/processing_blip.py#L26"}}),Jt=new C({props:{name:"batch_decode",anchor:"transformers.BlipProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/processing_blip.py#L130"}}),Kt=new C({props:{name:"decode",anchor:"transformers.BlipProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/processing_blip.py#L137"}}),Zt=new O({}),eo=new C({props:{name:"class transformers.BlipImageProcessor",anchor:"transformers.BlipImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = 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>PILImageResampling.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;
Wwhether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the
<code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.BlipImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.BlipImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.BlipImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.BlipImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.BlipImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/image_processing_blip.py#L43"}}),to=new C({props:{name:"preprocess",anchor:"transformers.BlipImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlipImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,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>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/image_processing_blip.py#L179"}}),oo=new O({}),no=new C({props:{name:"class transformers.BlipModel",anchor:"transformers.BlipModel",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig">BlipConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L724"}}),io=new C({props:{name:"forward",anchor:"transformers.BlipModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlipModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BlipModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BlipModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.BlipModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L837",returnDescription:`
<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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_blip.BlipOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),nt=new Ro({props:{$$slots:{default:[Xf]},$$scope:{ctx:P}}}),rt=new Se({props:{anchor:"transformers.BlipModel.forward.example",$$slots:{default:[Kf]},$$scope:{ctx:P}}}),lo=new C({props:{name:"get_text_features",anchor:"transformers.BlipModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlipModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BlipModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BlipModel.get_text_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipModel.get_text_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L759",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),st=new Ro({props:{$$slots:{default:[Yf]},$$scope:{ctx:P}}}),at=new Se({props:{anchor:"transformers.BlipModel.get_text_features.example",$$slots:{default:[Zf]},$$scope:{ctx:P}}}),co=new C({props:{name:"get_image_features",anchor:"transformers.BlipModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipModel.get_image_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipModel.get_image_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L797",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),it=new Ro({props:{$$slots:{default:[eh]},$$scope:{ctx:P}}}),lt=new Se({props:{anchor:"transformers.BlipModel.get_image_features.example",$$slots:{default:[th]},$$scope:{ctx:P}}}),po=new O({}),mo=new C({props:{name:"class transformers.BlipTextModel",anchor:"transformers.BlipTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip_text.py#L564"}}),ho=new C({props:{name:"forward",anchor:"transformers.BlipTextModel.forward",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"head_mask",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"encoder_embeds",val:" = None"},{name:"encoder_hidden_states",val:" = None"},{name:"encoder_attention_mask",val:" = None"},{name:"past_key_values",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"is_decoder",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip_text.py#L663"}}),_o=new O({}),vo=new C({props:{name:"class transformers.BlipVisionModel",anchor:"transformers.BlipVisionModel",parameters:[{name:"config",val:": BlipVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L657"}}),bo=new C({props:{name:"forward",anchor:"transformers.BlipVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipVisionModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipVisionModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L672",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<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>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new Ro({props:{$$slots:{default:[oh]},$$scope:{ctx:P}}}),$o=new O({}),wo=new C({props:{name:"class transformers.BlipForConditionalGeneration",anchor:"transformers.BlipForConditionalGeneration",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig">BlipConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L940"}}),Po=new C({props:{name:"forward",anchor:"transformers.BlipForConditionalGeneration.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipForConditionalGeneration.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L961",returnDescription:`
<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>) \u2014 Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>decoder_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>, <em>optional</em>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_blip.BlipForConditionalGenerationModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new Ro({props:{$$slots:{default:[nh]},$$scope:{ctx:P}}}),ht=new Se({props:{anchor:"transformers.BlipForConditionalGeneration.forward.example",$$slots:{default:[rh]},$$scope:{ctx:P}}}),ko=new O({}),Eo=new C({props:{name:"class transformers.BlipForImageTextRetrieval",anchor:"transformers.BlipForImageTextRetrieval",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForImageTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig">BlipConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L1345"}}),jo=new C({props:{name:"forward",anchor:"transformers.BlipForImageTextRetrieval.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"pixel_values",val:": FloatTensor"},{name:"use_itm_head",val:": typing.Optional[bool] = True"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipForImageTextRetrieval.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipForImageTextRetrieval.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipForImageTextRetrieval.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipForImageTextRetrieval.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L1381",returnDescription:`
<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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_blip.BlipTextVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ut=new Ro({props:{$$slots:{default:[sh]},$$scope:{ctx:P}}}),_t=new Se({props:{anchor:"transformers.BlipForImageTextRetrieval.forward.example",$$slots:{default:[ah]},$$scope:{ctx:P}}}),zo=new O({}),qo=new C({props:{name:"class transformers.BlipForQuestionAnswering",anchor:"transformers.BlipForQuestionAnswering",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig">BlipConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L1110"}}),So=new C({props:{name:"forward",anchor:"transformers.BlipForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"pixel_values",val:": FloatTensor"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BlipForQuestionAnswering.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.BlipForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BlipForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BlipForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/blip/modeling_blip.py#L1145",returnDescription:`
<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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_blip.BlipTextVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),bt=new Ro({props:{$$slots:{default:[ih]},$$scope:{ctx:P}}}),$t=new Se({props:{anchor:"transformers.BlipForQuestionAnswering.forward.example",$$slots:{default:[lh]},$$scope:{ctx:P}}}),{c(){d=s("meta"),b=p(),u=s("h1"),h=s("a"),v=s("span"),$(l.$$.fragment),f=p(),I=s("span"),Ba=n("BLIP"),fs=p(),me=s("h2"),De=s("a"),Nn=s("span"),$(Ct.$$.fragment),xa=p(),Rn=s("span"),Ta=n("Overview"),hs=p(),Ne=s("p"),Pa=n("The BLIP model was proposed in "),Mt=s("a"),ka=n("BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation"),Ea=n(" by Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi."),gs=p(),Wo=s("p"),Ia=n("BLIP is a model that is able to perform various multi-modal tasks including"),us=p(),te=s("ul"),Wn=s("li"),Ca=n("Visual Question Answering"),Ma=p(),Gn=s("li"),ja=n("Image-Text retrieval (Image-text matching)"),za=p(),Un=s("li"),qa=n("Image Captioning"),_s=p(),Go=s("p"),Aa=n("The abstract from the paper is the following:"),vs=p(),Uo=s("p"),Qn=s("em"),Fa=n(`Vision-Language Pre-training (VLP) has advanced the performance for many vision-language tasks.
However, most existing pre-trained models only excel in either understanding-based tasks or generation-based tasks. Furthermore, performance improvement has been largely achieved by scaling up the dataset with noisy image-text pairs collected from the web, which is a suboptimal source of supervision. In this paper, we propose BLIP, a new VLP framework which transfers flexibly to both vision-language understanding and generation tasks. BLIP effectively utilizes the noisy web data by bootstrapping the captions, where a captioner generates synthetic captions and a filter removes the noisy ones. We achieve state-of-the-art results on a wide range of vision-language tasks, such as image-text retrieval (+2.7% in average recall@1), image captioning (+2.8% in CIDEr), and VQA (+1.6% in VQA score). BLIP also demonstrates strong generalization ability when directly transferred to videolanguage tasks in a zero-shot manner. Code, models, and datasets are released.`),bs=p(),Qo=s("p"),Ho=s("img"),$s=p(),oe=s("p"),La=n("This model was contributed by "),jt=s("a"),Sa=n("ybelkada"),Oa=n(`.
The original code can be found `),zt=s("a"),Va=n("here"),Da=n("."),ws=p(),fe=s("h2"),Re=s("a"),Hn=s("span"),$(qt.$$.fragment),Na=p(),Jn=s("span"),Ra=n("Resources"),ys=p(),Jo=s("ul"),Xo=s("li"),At=s("a"),Wa=n("Jupyter notebook"),Ga=n(" on how to fine-tune BLIP for image captioning on a custom dataset"),Bs=p(),he=s("h2"),We=s("a"),Xn=s("span"),$(Ft.$$.fragment),Ua=p(),Kn=s("span"),Qa=n("BlipConfig"),xs=p(),j=s("div"),$(Lt.$$.fragment),Ha=p(),ne=s("p"),Ko=s("a"),Ja=n("BlipConfig"),Xa=n(" is the configuration class to store the configuration of a "),Yo=s("a"),Ka=n("BlipModel"),Ya=n(`. 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
`),St=s("a"),Za=n("Salesforce/blip-vqa-base"),ei=n(" architecture."),ti=p(),ge=s("p"),oi=n("Configuration objects inherit from "),Zo=s("a"),ni=n("PretrainedConfig"),ri=n(` and can be used to control the model outputs. Read the
documentation from `),en=s("a"),si=n("PretrainedConfig"),ai=n(" for more information."),ii=p(),$(Ge.$$.fragment),li=p(),Ue=s("div"),$(Ot.$$.fragment),di=p(),Vt=s("p"),ci=n("Instantiate a "),tn=s("a"),pi=n("BlipConfig"),mi=n(` (or a derived class) from blip text model configuration and blip vision model
configuration.`),Ts=p(),ue=s("h2"),Qe=s("a"),Yn=s("span"),$(Dt.$$.fragment),fi=p(),Zn=s("span"),hi=n("BlipTextConfig"),Ps=p(),V=s("div"),$(Nt.$$.fragment),gi=p(),K=s("p"),ui=n("This is the configuration class to store the configuration of a "),on=s("a"),_i=n("BlipTextModel"),vi=n(`. 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 `),er=s("code"),bi=n("BlipText"),$i=n(" used by the "),Rt=s("a"),wi=n(`base
architectures`),yi=n("."),Bi=p(),_e=s("p"),xi=n("Configuration objects inherit from "),nn=s("a"),Ti=n("PretrainedConfig"),Pi=n(` and can be used to control the model outputs. Read the
documentation from `),rn=s("a"),ki=n("PretrainedConfig"),Ei=n(" for more information."),Ii=p(),$(He.$$.fragment),ks=p(),ve=s("h2"),Je=s("a"),tr=s("span"),$(Wt.$$.fragment),Ci=p(),or=s("span"),Mi=n("BlipVisionConfig"),Es=p(),D=s("div"),$(Gt.$$.fragment),ji=p(),be=s("p"),zi=n("This is the configuration class to store the configuration of a "),sn=s("a"),qi=n("BlipVisionModel"),Ai=n(`. 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
`),Ut=s("a"),Fi=n("Salesforce/blip-vqa-base"),Li=n(" architecture."),Si=p(),$e=s("p"),Oi=n("Configuration objects inherit from "),an=s("a"),Vi=n("PretrainedConfig"),Di=n(` and can be used to control the model outputs. Read the
documentation from `),ln=s("a"),Ni=n("PretrainedConfig"),Ri=n(" for more information."),Wi=p(),$(Xe.$$.fragment),Is=p(),we=s("h2"),Ke=s("a"),nr=s("span"),$(Qt.$$.fragment),Gi=p(),rr=s("span"),Ui=n("BlipProcessor"),Cs=p(),z=s("div"),$(Ht.$$.fragment),Qi=p(),sr=s("p"),Hi=n("Constructs a BLIP processor which wraps a BERT tokenizer and BLIP image processor into a single processor."),Ji=p(),S=s("p"),dn=s("a"),Xi=n("BlipProcessor"),Ki=n(" offers all the functionalities of "),cn=s("a"),Yi=n("BlipImageProcessor"),Zi=n(" and "),pn=s("a"),el=n("BertTokenizerFast"),tl=n(`. See the
docstring of `),ar=s("code"),ol=n("__call__()"),nl=n(" and "),mn=s("a"),rl=n("decode()"),sl=n(" for more information."),al=p(),Ye=s("div"),$(Jt.$$.fragment),il=p(),Xt=s("p"),ll=n("This method forwards all its arguments to BertTokenizerFast\u2019s "),fn=s("a"),dl=n("batch_decode()"),cl=n(`. Please
refer to the docstring of this method for more information.`),pl=p(),Ze=s("div"),$(Kt.$$.fragment),ml=p(),Yt=s("p"),fl=n("This method forwards all its arguments to BertTokenizerFast\u2019s "),hn=s("a"),hl=n("decode()"),gl=n(`. Please refer to
the docstring of this method for more information.`),Ms=p(),ye=s("h2"),et=s("a"),ir=s("span"),$(Zt.$$.fragment),ul=p(),lr=s("span"),_l=n("BlipImageProcessor"),js=p(),Y=s("div"),$(eo.$$.fragment),vl=p(),dr=s("p"),bl=n("Constructs a BLIP image processor."),$l=p(),tt=s("div"),$(to.$$.fragment),wl=p(),cr=s("p"),yl=n("Preprocess an image or batch of images."),zs=p(),Be=s("h2"),ot=s("a"),pr=s("span"),$(oo.$$.fragment),Bl=p(),mr=s("span"),xl=n("BlipModel"),qs=p(),M=s("div"),$(no.$$.fragment),Tl=p(),ro=s("p"),Pl=n("This model inherits from "),gn=s("a"),kl=n("PreTrainedModel"),El=n(`. 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.)`),Il=p(),so=s("p"),Cl=n("This model is also a PyTorch "),ao=s("a"),Ml=n("torch.nn.Module"),jl=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zl=p(),R=s("div"),$(io.$$.fragment),ql=p(),xe=s("p"),Al=n("The "),un=s("a"),Fl=n("BlipModel"),Ll=n(" forward method, overrides the "),fr=s("code"),Sl=n("__call__"),Ol=n(" special method."),Vl=p(),$(nt.$$.fragment),Dl=p(),$(rt.$$.fragment),Nl=p(),W=s("div"),$(lo.$$.fragment),Rl=p(),Te=s("p"),Wl=n("The "),_n=s("a"),Gl=n("BlipModel"),Ul=n(" forward method, overrides the "),hr=s("code"),Ql=n("__call__"),Hl=n(" special method."),Jl=p(),$(st.$$.fragment),Xl=p(),$(at.$$.fragment),Kl=p(),G=s("div"),$(co.$$.fragment),Yl=p(),Pe=s("p"),Zl=n("The "),vn=s("a"),ed=n("BlipModel"),td=n(" forward method, overrides the "),gr=s("code"),od=n("__call__"),nd=n(" special method."),rd=p(),$(it.$$.fragment),sd=p(),$(lt.$$.fragment),As=p(),ke=s("h2"),dt=s("a"),ur=s("span"),$(po.$$.fragment),ad=p(),_r=s("span"),id=n("BlipTextModel"),Fs=p(),Z=s("div"),$(mo.$$.fragment),ld=p(),N=s("p"),dd=n(`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 `),fo=s("a"),cd=n(`Attention is
all you need`),pd=n(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and `),vr=s("code"),md=n("is_decoder"),fd=n(" set to "),br=s("code"),hd=n("True"),gd=n(`; an
`),$r=s("code"),ud=n("encoder_hidden_states"),_d=n(" is then expected as an input to the forward pass."),vd=p(),re=s("div"),$(ho.$$.fragment),bd=p(),q=s("p"),$d=n("encoder_hidden_states  ("),wr=s("code"),wd=n("torch.FloatTensor"),yd=n(", "),yr=s("em"),Bd=n("optional"),xd=n(`):
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 (`),Br=s("code"),Td=n("torch.FloatTensor"),Pd=n(", "),xr=s("em"),kd=n("optional"),Ed=n(`):
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 `),Tr=s("code"),Id=n("[0, 1]"),Cd=n(":"),Md=p(),go=s("ul"),uo=s("li"),jd=n("1 for tokens that are "),Pr=s("strong"),zd=n("not masked"),qd=n(","),Ad=p(),k=s("li"),Fd=n("0 for tokens that are "),kr=s("strong"),Ld=n("masked"),Sd=n(`.
past_key_values (`),Er=s("code"),Od=n("tuple(tuple(torch.FloatTensor))"),Vd=n(", "),Ir=s("em"),Dd=n("optional"),Nd=n(`):
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),Cr=s("code"),Rd=n("past_key_values"),Wd=n(" are used, the user can optionally input only the last "),Mr=s("code"),Gd=n("decoder_input_ids"),Ud=n(` (those that
don\u2019t have their past key value states given to this model) of shape `),jr=s("code"),Qd=n("(batch_size, 1)"),Hd=n(` instead of all
`),zr=s("code"),Jd=n("decoder_input_ids"),Xd=n(" of shape "),qr=s("code"),Kd=n("(batch_size, sequence_length)"),Yd=n(`.
use_cache (`),Ar=s("code"),Zd=n("bool"),ec=n(", "),Fr=s("em"),tc=n("optional"),oc=n(`):
If set to `),Lr=s("code"),nc=n("True"),rc=n(", "),Sr=s("code"),sc=n("past_key_values"),ac=n(` key value states are returned and can be used to speed up decoding (see
`),Or=s("code"),ic=n("past_key_values"),lc=n(")."),Ls=p(),Ee=s("h2"),ct=s("a"),Vr=s("span"),$(_o.$$.fragment),dc=p(),Dr=s("span"),cc=n("BlipVisionModel"),Ss=p(),Ie=s("div"),$(vo.$$.fragment),pc=p(),se=s("div"),$(bo.$$.fragment),mc=p(),Ce=s("p"),fc=n("The "),bn=s("a"),hc=n("BlipVisionModel"),gc=n(" forward method, overrides the "),Nr=s("code"),uc=n("__call__"),_c=n(" special method."),vc=p(),$(pt.$$.fragment),Os=p(),Me=s("h2"),mt=s("a"),Rr=s("span"),$($o.$$.fragment),bc=p(),Wr=s("span"),$c=n("BlipForConditionalGeneration"),Vs=p(),A=s("div"),$(wo.$$.fragment),wc=p(),yo=s("p"),yc=n(`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
`),Gr=s("code"),Bc=n("input_ids"),xc=n(` 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.`),Tc=p(),Bo=s("p"),Pc=n("This model inherits from "),$n=s("a"),kc=n("PreTrainedModel"),Ec=n(`. 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.)`),Ic=p(),xo=s("p"),Cc=n("This model is also a PyTorch "),To=s("a"),Mc=n("torch.nn.Module"),jc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zc=p(),U=s("div"),$(Po.$$.fragment),qc=p(),je=s("p"),Ac=n("The "),wn=s("a"),Fc=n("BlipForConditionalGeneration"),Lc=n(" forward method, overrides the "),Ur=s("code"),Sc=n("__call__"),Oc=n(" special method."),Vc=p(),$(ft.$$.fragment),Dc=p(),$(ht.$$.fragment),Ds=p(),ze=s("h2"),gt=s("a"),Qr=s("span"),$(ko.$$.fragment),Nc=p(),Hr=s("span"),Rc=n("BlipForImageTextRetrieval"),Ns=p(),F=s("div"),$(Eo.$$.fragment),Wc=p(),Jr=s("p"),Gc=n(`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.`),Uc=p(),Io=s("p"),Qc=n("This model inherits from "),yn=s("a"),Hc=n("PreTrainedModel"),Jc=n(`. 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.)`),Xc=p(),Co=s("p"),Kc=n("This model is also a PyTorch "),Mo=s("a"),Yc=n("torch.nn.Module"),Zc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ep=p(),Q=s("div"),$(jo.$$.fragment),tp=p(),qe=s("p"),op=n("The "),Bn=s("a"),np=n("BlipForImageTextRetrieval"),rp=n(" forward method, overrides the "),Xr=s("code"),sp=n("__call__"),ap=n(" special method."),ip=p(),$(ut.$$.fragment),lp=p(),$(_t.$$.fragment),Rs=p(),Ae=s("h2"),vt=s("a"),Kr=s("span"),$(zo.$$.fragment),dp=p(),Yr=s("span"),cp=n("BlipForQuestionAnswering"),Ws=p(),L=s("div"),$(qo.$$.fragment),pp=p(),Zr=s("p"),mp=n(`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.`),fp=p(),Ao=s("p"),hp=n("This model inherits from "),xn=s("a"),gp=n("PreTrainedModel"),up=n(`. 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.)`),_p=p(),Fo=s("p"),vp=n("This model is also a PyTorch "),Lo=s("a"),bp=n("torch.nn.Module"),$p=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wp=p(),H=s("div"),$(So.$$.fragment),yp=p(),Fe=s("p"),Bp=n("The "),Tn=s("a"),xp=n("BlipForQuestionAnswering"),Tp=n(" forward method, overrides the "),es=s("code"),Pp=n("__call__"),kp=n(" special method."),Ep=p(),$(bt.$$.fragment),Ip=p(),$($t.$$.fragment),this.h()},l(t){const g=Wf('[data-svelte="svelte-1phssyn"]',document.head);d=a(g,"META",{name:!0,content:!0}),g.forEach(o),b=m(t),u=a(t,"H1",{class:!0});var Oo=i(u);h=a(Oo,"A",{id:!0,class:!0,href:!0});var ts=i(h);v=a(ts,"SPAN",{});var os=i(v);w(l.$$.fragment,os),os.forEach(o),ts.forEach(o),f=m(Oo),I=a(Oo,"SPAN",{});var ns=i(I);Ba=r(ns,"BLIP"),ns.forEach(o),Oo.forEach(o),fs=m(t),me=a(t,"H2",{class:!0});var Vo=i(me);De=a(Vo,"A",{id:!0,class:!0,href:!0});var rs=i(De);Nn=a(rs,"SPAN",{});var ss=i(Nn);w(Ct.$$.fragment,ss),ss.forEach(o),rs.forEach(o),xa=m(Vo),Rn=a(Vo,"SPAN",{});var as=i(Rn);Ta=r(as,"Overview"),as.forEach(o),Vo.forEach(o),hs=m(t),Ne=a(t,"P",{});var Do=i(Ne);Pa=r(Do,"The BLIP model was proposed in "),Mt=a(Do,"A",{href:!0,rel:!0});var is=i(Mt);ka=r(is,"BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation"),is.forEach(o),Ea=r(Do," by Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi."),Do.forEach(o),gs=m(t),Wo=a(t,"P",{});var ls=i(Wo);Ia=r(ls,"BLIP is a model that is able to perform various multi-modal tasks including"),ls.forEach(o),us=m(t),te=a(t,"UL",{});var Le=i(te);Wn=a(Le,"LI",{});var ds=i(Wn);Ca=r(ds,"Visual Question Answering"),ds.forEach(o),Ma=m(Le),Gn=a(Le,"LI",{});var cs=i(Gn);ja=r(cs,"Image-Text retrieval (Image-text matching)"),cs.forEach(o),za=m(Le),Un=a(Le,"LI",{});var ps=i(Un);qa=r(ps,"Image Captioning"),ps.forEach(o),Le.forEach(o),_s=m(t),Go=a(t,"P",{});var ms=i(Go);Aa=r(ms,"The abstract from the paper is the following:"),ms.forEach(o),vs=m(t),Uo=a(t,"P",{});var jp=i(Uo);Qn=a(jp,"EM",{});var zp=i(Qn);Fa=r(zp,`Vision-Language Pre-training (VLP) has advanced the performance for many vision-language tasks.
However, most existing pre-trained models only excel in either understanding-based tasks or generation-based tasks. Furthermore, performance improvement has been largely achieved by scaling up the dataset with noisy image-text pairs collected from the web, which is a suboptimal source of supervision. In this paper, we propose BLIP, a new VLP framework which transfers flexibly to both vision-language understanding and generation tasks. BLIP effectively utilizes the noisy web data by bootstrapping the captions, where a captioner generates synthetic captions and a filter removes the noisy ones. We achieve state-of-the-art results on a wide range of vision-language tasks, such as image-text retrieval (+2.7% in average recall@1), image captioning (+2.8% in CIDEr), and VQA (+1.6% in VQA score). BLIP also demonstrates strong generalization ability when directly transferred to videolanguage tasks in a zero-shot manner. Code, models, and datasets are released.`),zp.forEach(o),jp.forEach(o),bs=m(t),Qo=a(t,"P",{});var qp=i(Qo);Ho=a(qp,"IMG",{src:!0,alt:!0}),qp.forEach(o),$s=m(t),oe=a(t,"P",{});var Pn=i(oe);La=r(Pn,"This model was contributed by "),jt=a(Pn,"A",{href:!0,rel:!0});var Ap=i(jt);Sa=r(Ap,"ybelkada"),Ap.forEach(o),Oa=r(Pn,`.
The original code can be found `),zt=a(Pn,"A",{href:!0,rel:!0});var Fp=i(zt);Va=r(Fp,"here"),Fp.forEach(o),Da=r(Pn,"."),Pn.forEach(o),ws=m(t),fe=a(t,"H2",{class:!0});var Us=i(fe);Re=a(Us,"A",{id:!0,class:!0,href:!0});var Lp=i(Re);Hn=a(Lp,"SPAN",{});var Sp=i(Hn);w(qt.$$.fragment,Sp),Sp.forEach(o),Lp.forEach(o),Na=m(Us),Jn=a(Us,"SPAN",{});var Op=i(Jn);Ra=r(Op,"Resources"),Op.forEach(o),Us.forEach(o),ys=m(t),Jo=a(t,"UL",{});var Vp=i(Jo);Xo=a(Vp,"LI",{});var Cp=i(Xo);At=a(Cp,"A",{href:!0,rel:!0});var Dp=i(At);Wa=r(Dp,"Jupyter notebook"),Dp.forEach(o),Ga=r(Cp," on how to fine-tune BLIP for image captioning on a custom dataset"),Cp.forEach(o),Vp.forEach(o),Bs=m(t),he=a(t,"H2",{class:!0});var Qs=i(he);We=a(Qs,"A",{id:!0,class:!0,href:!0});var Np=i(We);Xn=a(Np,"SPAN",{});var Rp=i(Xn);w(Ft.$$.fragment,Rp),Rp.forEach(o),Np.forEach(o),Ua=m(Qs),Kn=a(Qs,"SPAN",{});var Wp=i(Kn);Qa=r(Wp,"BlipConfig"),Wp.forEach(o),Qs.forEach(o),xs=m(t),j=a(t,"DIV",{class:!0});var ae=i(j);w(Lt.$$.fragment,ae),Ha=m(ae),ne=a(ae,"P",{});var No=i(ne);Ko=a(No,"A",{href:!0});var Gp=i(Ko);Ja=r(Gp,"BlipConfig"),Gp.forEach(o),Xa=r(No," is the configuration class to store the configuration of a "),Yo=a(No,"A",{href:!0});var Up=i(Yo);Ka=r(Up,"BlipModel"),Up.forEach(o),Ya=r(No,`. 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
`),St=a(No,"A",{href:!0,rel:!0});var Qp=i(St);Za=r(Qp,"Salesforce/blip-vqa-base"),Qp.forEach(o),ei=r(No," architecture."),No.forEach(o),ti=m(ae),ge=a(ae,"P",{});var kn=i(ge);oi=r(kn,"Configuration objects inherit from "),Zo=a(kn,"A",{href:!0});var Hp=i(Zo);ni=r(Hp,"PretrainedConfig"),Hp.forEach(o),ri=r(kn,` and can be used to control the model outputs. Read the
documentation from `),en=a(kn,"A",{href:!0});var Jp=i(en);si=r(Jp,"PretrainedConfig"),Jp.forEach(o),ai=r(kn," for more information."),kn.forEach(o),ii=m(ae),w(Ge.$$.fragment,ae),li=m(ae),Ue=a(ae,"DIV",{class:!0});var Hs=i(Ue);w(Ot.$$.fragment,Hs),di=m(Hs),Vt=a(Hs,"P",{});var Js=i(Vt);ci=r(Js,"Instantiate a "),tn=a(Js,"A",{href:!0});var Xp=i(tn);pi=r(Xp,"BlipConfig"),Xp.forEach(o),mi=r(Js,` (or a derived class) from blip text model configuration and blip vision model
configuration.`),Js.forEach(o),Hs.forEach(o),ae.forEach(o),Ts=m(t),ue=a(t,"H2",{class:!0});var Xs=i(ue);Qe=a(Xs,"A",{id:!0,class:!0,href:!0});var Kp=i(Qe);Yn=a(Kp,"SPAN",{});var Yp=i(Yn);w(Dt.$$.fragment,Yp),Yp.forEach(o),Kp.forEach(o),fi=m(Xs),Zn=a(Xs,"SPAN",{});var Zp=i(Zn);hi=r(Zp,"BlipTextConfig"),Zp.forEach(o),Xs.forEach(o),Ps=m(t),V=a(t,"DIV",{class:!0});var wt=i(V);w(Nt.$$.fragment,wt),gi=m(wt),K=a(wt,"P",{});var yt=i(K);ui=r(yt,"This is the configuration class to store the configuration of a "),on=a(yt,"A",{href:!0});var em=i(on);_i=r(em,"BlipTextModel"),em.forEach(o),vi=r(yt,`. 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 `),er=a(yt,"CODE",{});var tm=i(er);bi=r(tm,"BlipText"),tm.forEach(o),$i=r(yt," used by the "),Rt=a(yt,"A",{href:!0,rel:!0});var om=i(Rt);wi=r(om,`base
architectures`),om.forEach(o),yi=r(yt,"."),yt.forEach(o),Bi=m(wt),_e=a(wt,"P",{});var En=i(_e);xi=r(En,"Configuration objects inherit from "),nn=a(En,"A",{href:!0});var nm=i(nn);Ti=r(nm,"PretrainedConfig"),nm.forEach(o),Pi=r(En,` and can be used to control the model outputs. Read the
documentation from `),rn=a(En,"A",{href:!0});var rm=i(rn);ki=r(rm,"PretrainedConfig"),rm.forEach(o),Ei=r(En," for more information."),En.forEach(o),Ii=m(wt),w(He.$$.fragment,wt),wt.forEach(o),ks=m(t),ve=a(t,"H2",{class:!0});var Ks=i(ve);Je=a(Ks,"A",{id:!0,class:!0,href:!0});var sm=i(Je);tr=a(sm,"SPAN",{});var am=i(tr);w(Wt.$$.fragment,am),am.forEach(o),sm.forEach(o),Ci=m(Ks),or=a(Ks,"SPAN",{});var im=i(or);Mi=r(im,"BlipVisionConfig"),im.forEach(o),Ks.forEach(o),Es=m(t),D=a(t,"DIV",{class:!0});var Bt=i(D);w(Gt.$$.fragment,Bt),ji=m(Bt),be=a(Bt,"P",{});var In=i(be);zi=r(In,"This is the configuration class to store the configuration of a "),sn=a(In,"A",{href:!0});var lm=i(sn);qi=r(lm,"BlipVisionModel"),lm.forEach(o),Ai=r(In,`. 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
`),Ut=a(In,"A",{href:!0,rel:!0});var dm=i(Ut);Fi=r(dm,"Salesforce/blip-vqa-base"),dm.forEach(o),Li=r(In," architecture."),In.forEach(o),Si=m(Bt),$e=a(Bt,"P",{});var Cn=i($e);Oi=r(Cn,"Configuration objects inherit from "),an=a(Cn,"A",{href:!0});var cm=i(an);Vi=r(cm,"PretrainedConfig"),cm.forEach(o),Di=r(Cn,` and can be used to control the model outputs. Read the
documentation from `),ln=a(Cn,"A",{href:!0});var pm=i(ln);Ni=r(pm,"PretrainedConfig"),pm.forEach(o),Ri=r(Cn," for more information."),Cn.forEach(o),Wi=m(Bt),w(Xe.$$.fragment,Bt),Bt.forEach(o),Is=m(t),we=a(t,"H2",{class:!0});var Ys=i(we);Ke=a(Ys,"A",{id:!0,class:!0,href:!0});var mm=i(Ke);nr=a(mm,"SPAN",{});var fm=i(nr);w(Qt.$$.fragment,fm),fm.forEach(o),mm.forEach(o),Gi=m(Ys),rr=a(Ys,"SPAN",{});var hm=i(rr);Ui=r(hm,"BlipProcessor"),hm.forEach(o),Ys.forEach(o),Cs=m(t),z=a(t,"DIV",{class:!0});var ie=i(z);w(Ht.$$.fragment,ie),Qi=m(ie),sr=a(ie,"P",{});var gm=i(sr);Hi=r(gm,"Constructs a BLIP processor which wraps a BERT tokenizer and BLIP image processor into a single processor."),gm.forEach(o),Ji=m(ie),S=a(ie,"P",{});var ee=i(S);dn=a(ee,"A",{href:!0});var um=i(dn);Xi=r(um,"BlipProcessor"),um.forEach(o),Ki=r(ee," offers all the functionalities of "),cn=a(ee,"A",{href:!0});var _m=i(cn);Yi=r(_m,"BlipImageProcessor"),_m.forEach(o),Zi=r(ee," and "),pn=a(ee,"A",{href:!0});var vm=i(pn);el=r(vm,"BertTokenizerFast"),vm.forEach(o),tl=r(ee,`. See the
docstring of `),ar=a(ee,"CODE",{});var bm=i(ar);ol=r(bm,"__call__()"),bm.forEach(o),nl=r(ee," and "),mn=a(ee,"A",{href:!0});var $m=i(mn);rl=r($m,"decode()"),$m.forEach(o),sl=r(ee," for more information."),ee.forEach(o),al=m(ie),Ye=a(ie,"DIV",{class:!0});var Zs=i(Ye);w(Jt.$$.fragment,Zs),il=m(Zs),Xt=a(Zs,"P",{});var ea=i(Xt);ll=r(ea,"This method forwards all its arguments to BertTokenizerFast\u2019s "),fn=a(ea,"A",{href:!0});var wm=i(fn);dl=r(wm,"batch_decode()"),wm.forEach(o),cl=r(ea,`. Please
refer to the docstring of this method for more information.`),ea.forEach(o),Zs.forEach(o),pl=m(ie),Ze=a(ie,"DIV",{class:!0});var ta=i(Ze);w(Kt.$$.fragment,ta),ml=m(ta),Yt=a(ta,"P",{});var oa=i(Yt);fl=r(oa,"This method forwards all its arguments to BertTokenizerFast\u2019s "),hn=a(oa,"A",{href:!0});var ym=i(hn);hl=r(ym,"decode()"),ym.forEach(o),gl=r(oa,`. Please refer to
the docstring of this method for more information.`),oa.forEach(o),ta.forEach(o),ie.forEach(o),Ms=m(t),ye=a(t,"H2",{class:!0});var na=i(ye);et=a(na,"A",{id:!0,class:!0,href:!0});var Bm=i(et);ir=a(Bm,"SPAN",{});var xm=i(ir);w(Zt.$$.fragment,xm),xm.forEach(o),Bm.forEach(o),ul=m(na),lr=a(na,"SPAN",{});var Tm=i(lr);_l=r(Tm,"BlipImageProcessor"),Tm.forEach(o),na.forEach(o),js=m(t),Y=a(t,"DIV",{class:!0});var Mn=i(Y);w(eo.$$.fragment,Mn),vl=m(Mn),dr=a(Mn,"P",{});var Pm=i(dr);bl=r(Pm,"Constructs a BLIP image processor."),Pm.forEach(o),$l=m(Mn),tt=a(Mn,"DIV",{class:!0});var ra=i(tt);w(to.$$.fragment,ra),wl=m(ra),cr=a(ra,"P",{});var km=i(cr);yl=r(km,"Preprocess an image or batch of images."),km.forEach(o),ra.forEach(o),Mn.forEach(o),zs=m(t),Be=a(t,"H2",{class:!0});var sa=i(Be);ot=a(sa,"A",{id:!0,class:!0,href:!0});var Em=i(ot);pr=a(Em,"SPAN",{});var Im=i(pr);w(oo.$$.fragment,Im),Im.forEach(o),Em.forEach(o),Bl=m(sa),mr=a(sa,"SPAN",{});var Cm=i(mr);xl=r(Cm,"BlipModel"),Cm.forEach(o),sa.forEach(o),qs=m(t),M=a(t,"DIV",{class:!0});var J=i(M);w(no.$$.fragment,J),Tl=m(J),ro=a(J,"P",{});var aa=i(ro);Pl=r(aa,"This model inherits from "),gn=a(aa,"A",{href:!0});var Mm=i(gn);kl=r(Mm,"PreTrainedModel"),Mm.forEach(o),El=r(aa,`. 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.)`),aa.forEach(o),Il=m(J),so=a(J,"P",{});var ia=i(so);Cl=r(ia,"This model is also a PyTorch "),ao=a(ia,"A",{href:!0,rel:!0});var jm=i(ao);Ml=r(jm,"torch.nn.Module"),jm.forEach(o),jl=r(ia,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ia.forEach(o),zl=m(J),R=a(J,"DIV",{class:!0});var xt=i(R);w(io.$$.fragment,xt),ql=m(xt),xe=a(xt,"P",{});var jn=i(xe);Al=r(jn,"The "),un=a(jn,"A",{href:!0});var zm=i(un);Fl=r(zm,"BlipModel"),zm.forEach(o),Ll=r(jn," forward method, overrides the "),fr=a(jn,"CODE",{});var qm=i(fr);Sl=r(qm,"__call__"),qm.forEach(o),Ol=r(jn," special method."),jn.forEach(o),Vl=m(xt),w(nt.$$.fragment,xt),Dl=m(xt),w(rt.$$.fragment,xt),xt.forEach(o),Nl=m(J),W=a(J,"DIV",{class:!0});var Tt=i(W);w(lo.$$.fragment,Tt),Rl=m(Tt),Te=a(Tt,"P",{});var zn=i(Te);Wl=r(zn,"The "),_n=a(zn,"A",{href:!0});var Am=i(_n);Gl=r(Am,"BlipModel"),Am.forEach(o),Ul=r(zn," forward method, overrides the "),hr=a(zn,"CODE",{});var Fm=i(hr);Ql=r(Fm,"__call__"),Fm.forEach(o),Hl=r(zn," special method."),zn.forEach(o),Jl=m(Tt),w(st.$$.fragment,Tt),Xl=m(Tt),w(at.$$.fragment,Tt),Tt.forEach(o),Kl=m(J),G=a(J,"DIV",{class:!0});var Pt=i(G);w(co.$$.fragment,Pt),Yl=m(Pt),Pe=a(Pt,"P",{});var qn=i(Pe);Zl=r(qn,"The "),vn=a(qn,"A",{href:!0});var Lm=i(vn);ed=r(Lm,"BlipModel"),Lm.forEach(o),td=r(qn," forward method, overrides the "),gr=a(qn,"CODE",{});var Sm=i(gr);od=r(Sm,"__call__"),Sm.forEach(o),nd=r(qn," special method."),qn.forEach(o),rd=m(Pt),w(it.$$.fragment,Pt),sd=m(Pt),w(lt.$$.fragment,Pt),Pt.forEach(o),J.forEach(o),As=m(t),ke=a(t,"H2",{class:!0});var la=i(ke);dt=a(la,"A",{id:!0,class:!0,href:!0});var Om=i(dt);ur=a(Om,"SPAN",{});var Vm=i(ur);w(po.$$.fragment,Vm),Vm.forEach(o),Om.forEach(o),ad=m(la),_r=a(la,"SPAN",{});var Dm=i(_r);id=r(Dm,"BlipTextModel"),Dm.forEach(o),la.forEach(o),Fs=m(t),Z=a(t,"DIV",{class:!0});var An=i(Z);w(mo.$$.fragment,An),ld=m(An),N=a(An,"P",{});var le=i(N);dd=r(le,`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 `),fo=a(le,"A",{href:!0,rel:!0});var Nm=i(fo);cd=r(Nm,`Attention is
all you need`),Nm.forEach(o),pd=r(le,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and `),vr=a(le,"CODE",{});var Rm=i(vr);md=r(Rm,"is_decoder"),Rm.forEach(o),fd=r(le," set to "),br=a(le,"CODE",{});var Wm=i(br);hd=r(Wm,"True"),Wm.forEach(o),gd=r(le,`; an
`),$r=a(le,"CODE",{});var Gm=i($r);ud=r(Gm,"encoder_hidden_states"),Gm.forEach(o),_d=r(le," is then expected as an input to the forward pass."),le.forEach(o),vd=m(An),re=a(An,"DIV",{class:!0});var Fn=i(re);w(ho.$$.fragment,Fn),bd=m(Fn),q=a(Fn,"P",{});var X=i(q);$d=r(X,"encoder_hidden_states  ("),wr=a(X,"CODE",{});var Um=i(wr);wd=r(Um,"torch.FloatTensor"),Um.forEach(o),yd=r(X,", "),yr=a(X,"EM",{});var Qm=i(yr);Bd=r(Qm,"optional"),Qm.forEach(o),xd=r(X,`):
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 (`),Br=a(X,"CODE",{});var Hm=i(Br);Td=r(Hm,"torch.FloatTensor"),Hm.forEach(o),Pd=r(X,", "),xr=a(X,"EM",{});var Jm=i(xr);kd=r(Jm,"optional"),Jm.forEach(o),Ed=r(X,`):
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 `),Tr=a(X,"CODE",{});var Xm=i(Tr);Id=r(Xm,"[0, 1]"),Xm.forEach(o),Cd=r(X,":"),X.forEach(o),Md=m(Fn),go=a(Fn,"UL",{});var da=i(go);uo=a(da,"LI",{});var ca=i(uo);jd=r(ca,"1 for tokens that are "),Pr=a(ca,"STRONG",{});var Km=i(Pr);zd=r(Km,"not masked"),Km.forEach(o),qd=r(ca,","),ca.forEach(o),Ad=m(da),k=a(da,"LI",{});var E=i(k);Fd=r(E,"0 for tokens that are "),kr=a(E,"STRONG",{});var Ym=i(kr);Ld=r(Ym,"masked"),Ym.forEach(o),Sd=r(E,`.
past_key_values (`),Er=a(E,"CODE",{});var Zm=i(Er);Od=r(Zm,"tuple(tuple(torch.FloatTensor))"),Zm.forEach(o),Vd=r(E,", "),Ir=a(E,"EM",{});var ef=i(Ir);Dd=r(ef,"optional"),ef.forEach(o),Nd=r(E,`):
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),Cr=a(E,"CODE",{});var tf=i(Cr);Rd=r(tf,"past_key_values"),tf.forEach(o),Wd=r(E," are used, the user can optionally input only the last "),Mr=a(E,"CODE",{});var of=i(Mr);Gd=r(of,"decoder_input_ids"),of.forEach(o),Ud=r(E,` (those that
don\u2019t have their past key value states given to this model) of shape `),jr=a(E,"CODE",{});var nf=i(jr);Qd=r(nf,"(batch_size, 1)"),nf.forEach(o),Hd=r(E,` instead of all
`),zr=a(E,"CODE",{});var rf=i(zr);Jd=r(rf,"decoder_input_ids"),rf.forEach(o),Xd=r(E," of shape "),qr=a(E,"CODE",{});var sf=i(qr);Kd=r(sf,"(batch_size, sequence_length)"),sf.forEach(o),Yd=r(E,`.
use_cache (`),Ar=a(E,"CODE",{});var af=i(Ar);Zd=r(af,"bool"),af.forEach(o),ec=r(E,", "),Fr=a(E,"EM",{});var lf=i(Fr);tc=r(lf,"optional"),lf.forEach(o),oc=r(E,`):
If set to `),Lr=a(E,"CODE",{});var df=i(Lr);nc=r(df,"True"),df.forEach(o),rc=r(E,", "),Sr=a(E,"CODE",{});var cf=i(Sr);sc=r(cf,"past_key_values"),cf.forEach(o),ac=r(E,` key value states are returned and can be used to speed up decoding (see
`),Or=a(E,"CODE",{});var pf=i(Or);ic=r(pf,"past_key_values"),pf.forEach(o),lc=r(E,")."),E.forEach(o),da.forEach(o),Fn.forEach(o),An.forEach(o),Ls=m(t),Ee=a(t,"H2",{class:!0});var pa=i(Ee);ct=a(pa,"A",{id:!0,class:!0,href:!0});var mf=i(ct);Vr=a(mf,"SPAN",{});var ff=i(Vr);w(_o.$$.fragment,ff),ff.forEach(o),mf.forEach(o),dc=m(pa),Dr=a(pa,"SPAN",{});var hf=i(Dr);cc=r(hf,"BlipVisionModel"),hf.forEach(o),pa.forEach(o),Ss=m(t),Ie=a(t,"DIV",{class:!0});var ma=i(Ie);w(vo.$$.fragment,ma),pc=m(ma),se=a(ma,"DIV",{class:!0});var Ln=i(se);w(bo.$$.fragment,Ln),mc=m(Ln),Ce=a(Ln,"P",{});var Sn=i(Ce);fc=r(Sn,"The "),bn=a(Sn,"A",{href:!0});var gf=i(bn);hc=r(gf,"BlipVisionModel"),gf.forEach(o),gc=r(Sn," forward method, overrides the "),Nr=a(Sn,"CODE",{});var uf=i(Nr);uc=r(uf,"__call__"),uf.forEach(o),_c=r(Sn," special method."),Sn.forEach(o),vc=m(Ln),w(pt.$$.fragment,Ln),Ln.forEach(o),ma.forEach(o),Os=m(t),Me=a(t,"H2",{class:!0});var fa=i(Me);mt=a(fa,"A",{id:!0,class:!0,href:!0});var _f=i(mt);Rr=a(_f,"SPAN",{});var vf=i(Rr);w($o.$$.fragment,vf),vf.forEach(o),_f.forEach(o),bc=m(fa),Wr=a(fa,"SPAN",{});var bf=i(Wr);$c=r(bf,"BlipForConditionalGeneration"),bf.forEach(o),fa.forEach(o),Vs=m(t),A=a(t,"DIV",{class:!0});var de=i(A);w(wo.$$.fragment,de),wc=m(de),yo=a(de,"P",{});var ha=i(yo);yc=r(ha,`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
`),Gr=a(ha,"CODE",{});var $f=i(Gr);Bc=r($f,"input_ids"),$f.forEach(o),xc=r(ha,` 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.`),ha.forEach(o),Tc=m(de),Bo=a(de,"P",{});var ga=i(Bo);Pc=r(ga,"This model inherits from "),$n=a(ga,"A",{href:!0});var wf=i($n);kc=r(wf,"PreTrainedModel"),wf.forEach(o),Ec=r(ga,`. 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.)`),ga.forEach(o),Ic=m(de),xo=a(de,"P",{});var ua=i(xo);Cc=r(ua,"This model is also a PyTorch "),To=a(ua,"A",{href:!0,rel:!0});var yf=i(To);Mc=r(yf,"torch.nn.Module"),yf.forEach(o),jc=r(ua,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ua.forEach(o),zc=m(de),U=a(de,"DIV",{class:!0});var kt=i(U);w(Po.$$.fragment,kt),qc=m(kt),je=a(kt,"P",{});var On=i(je);Ac=r(On,"The "),wn=a(On,"A",{href:!0});var Bf=i(wn);Fc=r(Bf,"BlipForConditionalGeneration"),Bf.forEach(o),Lc=r(On," forward method, overrides the "),Ur=a(On,"CODE",{});var xf=i(Ur);Sc=r(xf,"__call__"),xf.forEach(o),Oc=r(On," special method."),On.forEach(o),Vc=m(kt),w(ft.$$.fragment,kt),Dc=m(kt),w(ht.$$.fragment,kt),kt.forEach(o),de.forEach(o),Ds=m(t),ze=a(t,"H2",{class:!0});var _a=i(ze);gt=a(_a,"A",{id:!0,class:!0,href:!0});var Tf=i(gt);Qr=a(Tf,"SPAN",{});var Pf=i(Qr);w(ko.$$.fragment,Pf),Pf.forEach(o),Tf.forEach(o),Nc=m(_a),Hr=a(_a,"SPAN",{});var kf=i(Hr);Rc=r(kf,"BlipForImageTextRetrieval"),kf.forEach(o),_a.forEach(o),Ns=m(t),F=a(t,"DIV",{class:!0});var ce=i(F);w(Eo.$$.fragment,ce),Wc=m(ce),Jr=a(ce,"P",{});var Ef=i(Jr);Gc=r(Ef,`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.`),Ef.forEach(o),Uc=m(ce),Io=a(ce,"P",{});var va=i(Io);Qc=r(va,"This model inherits from "),yn=a(va,"A",{href:!0});var If=i(yn);Hc=r(If,"PreTrainedModel"),If.forEach(o),Jc=r(va,`. 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.)`),va.forEach(o),Xc=m(ce),Co=a(ce,"P",{});var ba=i(Co);Kc=r(ba,"This model is also a PyTorch "),Mo=a(ba,"A",{href:!0,rel:!0});var Cf=i(Mo);Yc=r(Cf,"torch.nn.Module"),Cf.forEach(o),Zc=r(ba,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ba.forEach(o),ep=m(ce),Q=a(ce,"DIV",{class:!0});var Et=i(Q);w(jo.$$.fragment,Et),tp=m(Et),qe=a(Et,"P",{});var Vn=i(qe);op=r(Vn,"The "),Bn=a(Vn,"A",{href:!0});var Mf=i(Bn);np=r(Mf,"BlipForImageTextRetrieval"),Mf.forEach(o),rp=r(Vn," forward method, overrides the "),Xr=a(Vn,"CODE",{});var jf=i(Xr);sp=r(jf,"__call__"),jf.forEach(o),ap=r(Vn," special method."),Vn.forEach(o),ip=m(Et),w(ut.$$.fragment,Et),lp=m(Et),w(_t.$$.fragment,Et),Et.forEach(o),ce.forEach(o),Rs=m(t),Ae=a(t,"H2",{class:!0});var $a=i(Ae);vt=a($a,"A",{id:!0,class:!0,href:!0});var zf=i(vt);Kr=a(zf,"SPAN",{});var qf=i(Kr);w(zo.$$.fragment,qf),qf.forEach(o),zf.forEach(o),dp=m($a),Yr=a($a,"SPAN",{});var Af=i(Yr);cp=r(Af,"BlipForQuestionAnswering"),Af.forEach(o),$a.forEach(o),Ws=m(t),L=a(t,"DIV",{class:!0});var pe=i(L);w(qo.$$.fragment,pe),pp=m(pe),Zr=a(pe,"P",{});var Ff=i(Zr);mp=r(Ff,`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.`),Ff.forEach(o),fp=m(pe),Ao=a(pe,"P",{});var wa=i(Ao);hp=r(wa,"This model inherits from "),xn=a(wa,"A",{href:!0});var Lf=i(xn);gp=r(Lf,"PreTrainedModel"),Lf.forEach(o),up=r(wa,`. 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.)`),wa.forEach(o),_p=m(pe),Fo=a(pe,"P",{});var ya=i(Fo);vp=r(ya,"This model is also a PyTorch "),Lo=a(ya,"A",{href:!0,rel:!0});var Sf=i(Lo);bp=r(Sf,"torch.nn.Module"),Sf.forEach(o),$p=r(ya,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ya.forEach(o),wp=m(pe),H=a(pe,"DIV",{class:!0});var It=i(H);w(So.$$.fragment,It),yp=m(It),Fe=a(It,"P",{});var Dn=i(Fe);Bp=r(Dn,"The "),Tn=a(Dn,"A",{href:!0});var Of=i(Tn);xp=r(Of,"BlipForQuestionAnswering"),Of.forEach(o),Tp=r(Dn," forward method, overrides the "),es=a(Dn,"CODE",{});var Vf=i(es);Pp=r(Vf,"__call__"),Vf.forEach(o),kp=r(Dn," special method."),Dn.forEach(o),Ep=m(It),w(bt.$$.fragment,It),Ip=m(It),w($t.$$.fragment,It),It.forEach(o),pe.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(ch)),c(h,"id","blip"),c(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(h,"href","#blip"),c(u,"class","relative group"),c(De,"id","overview"),c(De,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(De,"href","#overview"),c(me,"class","relative group"),c(Mt,"href","https://arxiv.org/abs/2201.12086"),c(Mt,"rel","nofollow"),Gf(Ho.src,Mp="https://s3.amazonaws.com/moonup/production/uploads/1670928184033-62441d1d9fdefb55a0b7d12c.gif")||c(Ho,"src",Mp),c(Ho,"alt","BLIP.gif"),c(jt,"href","https://huggingface.co/ybelkada"),c(jt,"rel","nofollow"),c(zt,"href","https://github.com/salesforce/BLIP"),c(zt,"rel","nofollow"),c(Re,"id","resources"),c(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Re,"href","#resources"),c(fe,"class","relative group"),c(At,"href","https://github.com/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb"),c(At,"rel","nofollow"),c(We,"id","transformers.BlipConfig"),c(We,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(We,"href","#transformers.BlipConfig"),c(he,"class","relative group"),c(Ko,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig"),c(Yo,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipModel"),c(St,"href","https://huggingface.co/Salesforce/blip-vqa-base"),c(St,"rel","nofollow"),c(Zo,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(en,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(tn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipConfig"),c(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Qe,"id","transformers.BlipTextConfig"),c(Qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Qe,"href","#transformers.BlipTextConfig"),c(ue,"class","relative group"),c(on,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipTextModel"),c(Rt,"href","https://huggingface.co/Salesforce/blip-vqa-base"),c(Rt,"rel","nofollow"),c(nn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(rn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Je,"id","transformers.BlipVisionConfig"),c(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Je,"href","#transformers.BlipVisionConfig"),c(ve,"class","relative group"),c(sn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipVisionModel"),c(Ut,"href","https://huggingface.co/Salesforce/blip-vqa-base"),c(Ut,"rel","nofollow"),c(an,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(ln,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),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(Ke,"id","transformers.BlipProcessor"),c(Ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ke,"href","#transformers.BlipProcessor"),c(we,"class","relative group"),c(dn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipProcessor"),c(cn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipImageProcessor"),c(pn,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizerFast"),c(mn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipProcessor.decode"),c(fn,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),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(hn,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),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(et,"id","transformers.BlipImageProcessor"),c(et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(et,"href","#transformers.BlipImageProcessor"),c(ye,"class","relative group"),c(tt,"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(ot,"id","transformers.BlipModel"),c(ot,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ot,"href","#transformers.BlipModel"),c(Be,"class","relative group"),c(gn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ao,"rel","nofollow"),c(un,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipModel"),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(_n,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipModel"),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(vn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipModel"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(dt,"id","transformers.BlipTextModel"),c(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(dt,"href","#transformers.BlipTextModel"),c(ke,"class","relative group"),c(fo,"href","https://arxiv.org/abs/1706.03762"),c(fo,"rel","nofollow"),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"),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(ct,"id","transformers.BlipVisionModel"),c(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ct,"href","#transformers.BlipVisionModel"),c(Ee,"class","relative group"),c(bn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipVisionModel"),c(se,"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(mt,"id","transformers.BlipForConditionalGeneration"),c(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(mt,"href","#transformers.BlipForConditionalGeneration"),c(Me,"class","relative group"),c($n,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(To,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(To,"rel","nofollow"),c(wn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipForConditionalGeneration"),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"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(gt,"id","transformers.BlipForImageTextRetrieval"),c(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(gt,"href","#transformers.BlipForImageTextRetrieval"),c(ze,"class","relative group"),c(yn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Mo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Mo,"rel","nofollow"),c(Bn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipForImageTextRetrieval"),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(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(vt,"id","transformers.BlipForQuestionAnswering"),c(vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(vt,"href","#transformers.BlipForQuestionAnswering"),c(Ae,"class","relative group"),c(xn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Lo,"rel","nofollow"),c(Tn,"href","/docs/transformers/v4.27.1/en/model_doc/blip#transformers.BlipForQuestionAnswering"),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(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),_(t,b,g),_(t,u,g),e(u,h),e(h,v),y(l,v,null),e(u,f),e(u,I),e(I,Ba),_(t,fs,g),_(t,me,g),e(me,De),e(De,Nn),y(Ct,Nn,null),e(me,xa),e(me,Rn),e(Rn,Ta),_(t,hs,g),_(t,Ne,g),e(Ne,Pa),e(Ne,Mt),e(Mt,ka),e(Ne,Ea),_(t,gs,g),_(t,Wo,g),e(Wo,Ia),_(t,us,g),_(t,te,g),e(te,Wn),e(Wn,Ca),e(te,Ma),e(te,Gn),e(Gn,ja),e(te,za),e(te,Un),e(Un,qa),_(t,_s,g),_(t,Go,g),e(Go,Aa),_(t,vs,g),_(t,Uo,g),e(Uo,Qn),e(Qn,Fa),_(t,bs,g),_(t,Qo,g),e(Qo,Ho),_(t,$s,g),_(t,oe,g),e(oe,La),e(oe,jt),e(jt,Sa),e(oe,Oa),e(oe,zt),e(zt,Va),e(oe,Da),_(t,ws,g),_(t,fe,g),e(fe,Re),e(Re,Hn),y(qt,Hn,null),e(fe,Na),e(fe,Jn),e(Jn,Ra),_(t,ys,g),_(t,Jo,g),e(Jo,Xo),e(Xo,At),e(At,Wa),e(Xo,Ga),_(t,Bs,g),_(t,he,g),e(he,We),e(We,Xn),y(Ft,Xn,null),e(he,Ua),e(he,Kn),e(Kn,Qa),_(t,xs,g),_(t,j,g),y(Lt,j,null),e(j,Ha),e(j,ne),e(ne,Ko),e(Ko,Ja),e(ne,Xa),e(ne,Yo),e(Yo,Ka),e(ne,Ya),e(ne,St),e(St,Za),e(ne,ei),e(j,ti),e(j,ge),e(ge,oi),e(ge,Zo),e(Zo,ni),e(ge,ri),e(ge,en),e(en,si),e(ge,ai),e(j,ii),y(Ge,j,null),e(j,li),e(j,Ue),y(Ot,Ue,null),e(Ue,di),e(Ue,Vt),e(Vt,ci),e(Vt,tn),e(tn,pi),e(Vt,mi),_(t,Ts,g),_(t,ue,g),e(ue,Qe),e(Qe,Yn),y(Dt,Yn,null),e(ue,fi),e(ue,Zn),e(Zn,hi),_(t,Ps,g),_(t,V,g),y(Nt,V,null),e(V,gi),e(V,K),e(K,ui),e(K,on),e(on,_i),e(K,vi),e(K,er),e(er,bi),e(K,$i),e(K,Rt),e(Rt,wi),e(K,yi),e(V,Bi),e(V,_e),e(_e,xi),e(_e,nn),e(nn,Ti),e(_e,Pi),e(_e,rn),e(rn,ki),e(_e,Ei),e(V,Ii),y(He,V,null),_(t,ks,g),_(t,ve,g),e(ve,Je),e(Je,tr),y(Wt,tr,null),e(ve,Ci),e(ve,or),e(or,Mi),_(t,Es,g),_(t,D,g),y(Gt,D,null),e(D,ji),e(D,be),e(be,zi),e(be,sn),e(sn,qi),e(be,Ai),e(be,Ut),e(Ut,Fi),e(be,Li),e(D,Si),e(D,$e),e($e,Oi),e($e,an),e(an,Vi),e($e,Di),e($e,ln),e(ln,Ni),e($e,Ri),e(D,Wi),y(Xe,D,null),_(t,Is,g),_(t,we,g),e(we,Ke),e(Ke,nr),y(Qt,nr,null),e(we,Gi),e(we,rr),e(rr,Ui),_(t,Cs,g),_(t,z,g),y(Ht,z,null),e(z,Qi),e(z,sr),e(sr,Hi),e(z,Ji),e(z,S),e(S,dn),e(dn,Xi),e(S,Ki),e(S,cn),e(cn,Yi),e(S,Zi),e(S,pn),e(pn,el),e(S,tl),e(S,ar),e(ar,ol),e(S,nl),e(S,mn),e(mn,rl),e(S,sl),e(z,al),e(z,Ye),y(Jt,Ye,null),e(Ye,il),e(Ye,Xt),e(Xt,ll),e(Xt,fn),e(fn,dl),e(Xt,cl),e(z,pl),e(z,Ze),y(Kt,Ze,null),e(Ze,ml),e(Ze,Yt),e(Yt,fl),e(Yt,hn),e(hn,hl),e(Yt,gl),_(t,Ms,g),_(t,ye,g),e(ye,et),e(et,ir),y(Zt,ir,null),e(ye,ul),e(ye,lr),e(lr,_l),_(t,js,g),_(t,Y,g),y(eo,Y,null),e(Y,vl),e(Y,dr),e(dr,bl),e(Y,$l),e(Y,tt),y(to,tt,null),e(tt,wl),e(tt,cr),e(cr,yl),_(t,zs,g),_(t,Be,g),e(Be,ot),e(ot,pr),y(oo,pr,null),e(Be,Bl),e(Be,mr),e(mr,xl),_(t,qs,g),_(t,M,g),y(no,M,null),e(M,Tl),e(M,ro),e(ro,Pl),e(ro,gn),e(gn,kl),e(ro,El),e(M,Il),e(M,so),e(so,Cl),e(so,ao),e(ao,Ml),e(so,jl),e(M,zl),e(M,R),y(io,R,null),e(R,ql),e(R,xe),e(xe,Al),e(xe,un),e(un,Fl),e(xe,Ll),e(xe,fr),e(fr,Sl),e(xe,Ol),e(R,Vl),y(nt,R,null),e(R,Dl),y(rt,R,null),e(M,Nl),e(M,W),y(lo,W,null),e(W,Rl),e(W,Te),e(Te,Wl),e(Te,_n),e(_n,Gl),e(Te,Ul),e(Te,hr),e(hr,Ql),e(Te,Hl),e(W,Jl),y(st,W,null),e(W,Xl),y(at,W,null),e(M,Kl),e(M,G),y(co,G,null),e(G,Yl),e(G,Pe),e(Pe,Zl),e(Pe,vn),e(vn,ed),e(Pe,td),e(Pe,gr),e(gr,od),e(Pe,nd),e(G,rd),y(it,G,null),e(G,sd),y(lt,G,null),_(t,As,g),_(t,ke,g),e(ke,dt),e(dt,ur),y(po,ur,null),e(ke,ad),e(ke,_r),e(_r,id),_(t,Fs,g),_(t,Z,g),y(mo,Z,null),e(Z,ld),e(Z,N),e(N,dd),e(N,fo),e(fo,cd),e(N,pd),e(N,vr),e(vr,md),e(N,fd),e(N,br),e(br,hd),e(N,gd),e(N,$r),e($r,ud),e(N,_d),e(Z,vd),e(Z,re),y(ho,re,null),e(re,bd),e(re,q),e(q,$d),e(q,wr),e(wr,wd),e(q,yd),e(q,yr),e(yr,Bd),e(q,xd),e(q,Br),e(Br,Td),e(q,Pd),e(q,xr),e(xr,kd),e(q,Ed),e(q,Tr),e(Tr,Id),e(q,Cd),e(re,Md),e(re,go),e(go,uo),e(uo,jd),e(uo,Pr),e(Pr,zd),e(uo,qd),e(go,Ad),e(go,k),e(k,Fd),e(k,kr),e(kr,Ld),e(k,Sd),e(k,Er),e(Er,Od),e(k,Vd),e(k,Ir),e(Ir,Dd),e(k,Nd),e(k,Cr),e(Cr,Rd),e(k,Wd),e(k,Mr),e(Mr,Gd),e(k,Ud),e(k,jr),e(jr,Qd),e(k,Hd),e(k,zr),e(zr,Jd),e(k,Xd),e(k,qr),e(qr,Kd),e(k,Yd),e(k,Ar),e(Ar,Zd),e(k,ec),e(k,Fr),e(Fr,tc),e(k,oc),e(k,Lr),e(Lr,nc),e(k,rc),e(k,Sr),e(Sr,sc),e(k,ac),e(k,Or),e(Or,ic),e(k,lc),_(t,Ls,g),_(t,Ee,g),e(Ee,ct),e(ct,Vr),y(_o,Vr,null),e(Ee,dc),e(Ee,Dr),e(Dr,cc),_(t,Ss,g),_(t,Ie,g),y(vo,Ie,null),e(Ie,pc),e(Ie,se),y(bo,se,null),e(se,mc),e(se,Ce),e(Ce,fc),e(Ce,bn),e(bn,hc),e(Ce,gc),e(Ce,Nr),e(Nr,uc),e(Ce,_c),e(se,vc),y(pt,se,null),_(t,Os,g),_(t,Me,g),e(Me,mt),e(mt,Rr),y($o,Rr,null),e(Me,bc),e(Me,Wr),e(Wr,$c),_(t,Vs,g),_(t,A,g),y(wo,A,null),e(A,wc),e(A,yo),e(yo,yc),e(yo,Gr),e(Gr,Bc),e(yo,xc),e(A,Tc),e(A,Bo),e(Bo,Pc),e(Bo,$n),e($n,kc),e(Bo,Ec),e(A,Ic),e(A,xo),e(xo,Cc),e(xo,To),e(To,Mc),e(xo,jc),e(A,zc),e(A,U),y(Po,U,null),e(U,qc),e(U,je),e(je,Ac),e(je,wn),e(wn,Fc),e(je,Lc),e(je,Ur),e(Ur,Sc),e(je,Oc),e(U,Vc),y(ft,U,null),e(U,Dc),y(ht,U,null),_(t,Ds,g),_(t,ze,g),e(ze,gt),e(gt,Qr),y(ko,Qr,null),e(ze,Nc),e(ze,Hr),e(Hr,Rc),_(t,Ns,g),_(t,F,g),y(Eo,F,null),e(F,Wc),e(F,Jr),e(Jr,Gc),e(F,Uc),e(F,Io),e(Io,Qc),e(Io,yn),e(yn,Hc),e(Io,Jc),e(F,Xc),e(F,Co),e(Co,Kc),e(Co,Mo),e(Mo,Yc),e(Co,Zc),e(F,ep),e(F,Q),y(jo,Q,null),e(Q,tp),e(Q,qe),e(qe,op),e(qe,Bn),e(Bn,np),e(qe,rp),e(qe,Xr),e(Xr,sp),e(qe,ap),e(Q,ip),y(ut,Q,null),e(Q,lp),y(_t,Q,null),_(t,Rs,g),_(t,Ae,g),e(Ae,vt),e(vt,Kr),y(zo,Kr,null),e(Ae,dp),e(Ae,Yr),e(Yr,cp),_(t,Ws,g),_(t,L,g),y(qo,L,null),e(L,pp),e(L,Zr),e(Zr,mp),e(L,fp),e(L,Ao),e(Ao,hp),e(Ao,xn),e(xn,gp),e(Ao,up),e(L,_p),e(L,Fo),e(Fo,vp),e(Fo,Lo),e(Lo,bp),e(Fo,$p),e(L,wp),e(L,H),y(So,H,null),e(H,yp),e(H,Fe),e(Fe,Bp),e(Fe,Tn),e(Tn,xp),e(Fe,Tp),e(Fe,es),e(es,Pp),e(Fe,kp),e(H,Ep),y(bt,H,null),e(H,Ip),y($t,H,null),Gs=!0},p(t,[g]){const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:t}),Ge.$set(Oo);const ts={};g&2&&(ts.$$scope={dirty:g,ctx:t}),He.$set(ts);const os={};g&2&&(os.$$scope={dirty:g,ctx:t}),Xe.$set(os);const ns={};g&2&&(ns.$$scope={dirty:g,ctx:t}),nt.$set(ns);const Vo={};g&2&&(Vo.$$scope={dirty:g,ctx:t}),rt.$set(Vo);const rs={};g&2&&(rs.$$scope={dirty:g,ctx:t}),st.$set(rs);const ss={};g&2&&(ss.$$scope={dirty:g,ctx:t}),at.$set(ss);const as={};g&2&&(as.$$scope={dirty:g,ctx:t}),it.$set(as);const Do={};g&2&&(Do.$$scope={dirty:g,ctx:t}),lt.$set(Do);const is={};g&2&&(is.$$scope={dirty:g,ctx:t}),pt.$set(is);const ls={};g&2&&(ls.$$scope={dirty:g,ctx:t}),ft.$set(ls);const Le={};g&2&&(Le.$$scope={dirty:g,ctx:t}),ht.$set(Le);const ds={};g&2&&(ds.$$scope={dirty:g,ctx:t}),ut.$set(ds);const cs={};g&2&&(cs.$$scope={dirty:g,ctx:t}),_t.$set(cs);const ps={};g&2&&(ps.$$scope={dirty:g,ctx:t}),bt.$set(ps);const ms={};g&2&&(ms.$$scope={dirty:g,ctx:t}),$t.$set(ms)},i(t){Gs||(B(l.$$.fragment,t),B(Ct.$$.fragment,t),B(qt.$$.fragment,t),B(Ft.$$.fragment,t),B(Lt.$$.fragment,t),B(Ge.$$.fragment,t),B(Ot.$$.fragment,t),B(Dt.$$.fragment,t),B(Nt.$$.fragment,t),B(He.$$.fragment,t),B(Wt.$$.fragment,t),B(Gt.$$.fragment,t),B(Xe.$$.fragment,t),B(Qt.$$.fragment,t),B(Ht.$$.fragment,t),B(Jt.$$.fragment,t),B(Kt.$$.fragment,t),B(Zt.$$.fragment,t),B(eo.$$.fragment,t),B(to.$$.fragment,t),B(oo.$$.fragment,t),B(no.$$.fragment,t),B(io.$$.fragment,t),B(nt.$$.fragment,t),B(rt.$$.fragment,t),B(lo.$$.fragment,t),B(st.$$.fragment,t),B(at.$$.fragment,t),B(co.$$.fragment,t),B(it.$$.fragment,t),B(lt.$$.fragment,t),B(po.$$.fragment,t),B(mo.$$.fragment,t),B(ho.$$.fragment,t),B(_o.$$.fragment,t),B(vo.$$.fragment,t),B(bo.$$.fragment,t),B(pt.$$.fragment,t),B($o.$$.fragment,t),B(wo.$$.fragment,t),B(Po.$$.fragment,t),B(ft.$$.fragment,t),B(ht.$$.fragment,t),B(ko.$$.fragment,t),B(Eo.$$.fragment,t),B(jo.$$.fragment,t),B(ut.$$.fragment,t),B(_t.$$.fragment,t),B(zo.$$.fragment,t),B(qo.$$.fragment,t),B(So.$$.fragment,t),B(bt.$$.fragment,t),B($t.$$.fragment,t),Gs=!0)},o(t){x(l.$$.fragment,t),x(Ct.$$.fragment,t),x(qt.$$.fragment,t),x(Ft.$$.fragment,t),x(Lt.$$.fragment,t),x(Ge.$$.fragment,t),x(Ot.$$.fragment,t),x(Dt.$$.fragment,t),x(Nt.$$.fragment,t),x(He.$$.fragment,t),x(Wt.$$.fragment,t),x(Gt.$$.fragment,t),x(Xe.$$.fragment,t),x(Qt.$$.fragment,t),x(Ht.$$.fragment,t),x(Jt.$$.fragment,t),x(Kt.$$.fragment,t),x(Zt.$$.fragment,t),x(eo.$$.fragment,t),x(to.$$.fragment,t),x(oo.$$.fragment,t),x(no.$$.fragment,t),x(io.$$.fragment,t),x(nt.$$.fragment,t),x(rt.$$.fragment,t),x(lo.$$.fragment,t),x(st.$$.fragment,t),x(at.$$.fragment,t),x(co.$$.fragment,t),x(it.$$.fragment,t),x(lt.$$.fragment,t),x(po.$$.fragment,t),x(mo.$$.fragment,t),x(ho.$$.fragment,t),x(_o.$$.fragment,t),x(vo.$$.fragment,t),x(bo.$$.fragment,t),x(pt.$$.fragment,t),x($o.$$.fragment,t),x(wo.$$.fragment,t),x(Po.$$.fragment,t),x(ft.$$.fragment,t),x(ht.$$.fragment,t),x(ko.$$.fragment,t),x(Eo.$$.fragment,t),x(jo.$$.fragment,t),x(ut.$$.fragment,t),x(_t.$$.fragment,t),x(zo.$$.fragment,t),x(qo.$$.fragment,t),x(So.$$.fragment,t),x(bt.$$.fragment,t),x($t.$$.fragment,t),Gs=!1},d(t){o(d),t&&o(b),t&&o(u),T(l),t&&o(fs),t&&o(me),T(Ct),t&&o(hs),t&&o(Ne),t&&o(gs),t&&o(Wo),t&&o(us),t&&o(te),t&&o(_s),t&&o(Go),t&&o(vs),t&&o(Uo),t&&o(bs),t&&o(Qo),t&&o($s),t&&o(oe),t&&o(ws),t&&o(fe),T(qt),t&&o(ys),t&&o(Jo),t&&o(Bs),t&&o(he),T(Ft),t&&o(xs),t&&o(j),T(Lt),T(Ge),T(Ot),t&&o(Ts),t&&o(ue),T(Dt),t&&o(Ps),t&&o(V),T(Nt),T(He),t&&o(ks),t&&o(ve),T(Wt),t&&o(Es),t&&o(D),T(Gt),T(Xe),t&&o(Is),t&&o(we),T(Qt),t&&o(Cs),t&&o(z),T(Ht),T(Jt),T(Kt),t&&o(Ms),t&&o(ye),T(Zt),t&&o(js),t&&o(Y),T(eo),T(to),t&&o(zs),t&&o(Be),T(oo),t&&o(qs),t&&o(M),T(no),T(io),T(nt),T(rt),T(lo),T(st),T(at),T(co),T(it),T(lt),t&&o(As),t&&o(ke),T(po),t&&o(Fs),t&&o(Z),T(mo),T(ho),t&&o(Ls),t&&o(Ee),T(_o),t&&o(Ss),t&&o(Ie),T(vo),T(bo),T(pt),t&&o(Os),t&&o(Me),T($o),t&&o(Vs),t&&o(A),T(wo),T(Po),T(ft),T(ht),t&&o(Ds),t&&o(ze),T(ko),t&&o(Ns),t&&o(F),T(Eo),T(jo),T(ut),T(_t),t&&o(Rs),t&&o(Ae),T(zo),t&&o(Ws),t&&o(L),T(qo),T(So),T(bt),T($t)}}}const ch={local:"blip",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.BlipConfig",title:"BlipConfig"},{local:"transformers.BlipTextConfig",title:"BlipTextConfig"},{local:"transformers.BlipVisionConfig",title:"BlipVisionConfig"},{local:"transformers.BlipProcessor",title:"BlipProcessor"},{local:"transformers.BlipImageProcessor",title:"BlipImageProcessor"},{local:"transformers.BlipModel",title:"BlipModel"},{local:"transformers.BlipTextModel",title:"BlipTextModel"},{local:"transformers.BlipVisionModel",title:"BlipVisionModel"},{local:"transformers.BlipForConditionalGeneration",title:"BlipForConditionalGeneration"},{local:"transformers.BlipForImageTextRetrieval",title:"BlipForImageTextRetrieval"},{local:"transformers.BlipForQuestionAnswering",title:"BlipForQuestionAnswering"}],title:"BLIP"};function ph(P){return Uf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vh extends Df{constructor(d){super();Nf(this,d,ph,dh,Rf,{})}}export{vh as default,ch as metadata};
