import{S as Zb,i as e$,s as t$,e as a,k as h,w as $,t as s,M as o$,c as i,d as o,m as f,a as l,x as w,h as r,b as c,N as n$,G as e,g as v,y as T,q as y,o as x,B,v as s$,L as R}from"../../chunks/vendor-hf-doc-builder.js";import{T as V}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as G}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as j}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as W}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function r$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Example:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Example:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function a$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Example:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Example:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function i$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Example:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Example:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function l$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function d$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function p$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function c$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function m$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function h$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function f$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function g$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function u$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function _$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function v$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function b$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function $$(k){let d,b,g,m,_;return m=new G({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=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function w$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function T$(k){let d,b,g,m,_;return m=new G({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, TFBlipModel

model = TFBlipModel.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="tf", padding=True
)

outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = tf.nn.softmax(logits_per_image, axis=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, TFBlipModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

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

model = TFBlipModel.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="tf")
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, TFBlipModel

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

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

model = TFBlipModel.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="tf")

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, TFBlipModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`}}),{c(){d=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function P$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function F$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function E$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function M$(k){let d,b,g,m,_;return m=new G({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, TFBlipForConditionalGeneration

processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
model = TFBlipForConditionalGeneration.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="tf")

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, TFBlipForConditionalGeneration

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;A picture of&quot;</span>

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

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

model = TFBlipForImageTextRetrieval.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="tf")
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, TFBlipForImageTextRetrieval

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;an image of a cat&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)`}}),{c(){d=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function q$(k){let d,b,g,m,_;return{c(){d=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),m=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=i(p,"CODE",{});var P=l(g);m=r(P,"Module"),P.forEach(o),_=r(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){v(n,d,p),e(d,b),e(d,g),e(g,m),e(d,_)},d(n){n&&o(d)}}}function C$(k){let d,b,g,m,_;return m=new G({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, TFBlipForQuestionAnswering

model = TFBlipForQuestionAnswering.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="tf")
labels = processor(text=label, return_tensors="tf").input_ids

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

# inference
text = "How many cats are in the picture?"
inputs = processor(images=image, text=text, return_tensors="tf")
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, TFBlipForQuestionAnswering

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are in the picture?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>label = <span class="hljs-string">&quot;2&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = processor(text=label, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are in the picture?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(processor.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
<span class="hljs-number">2</span>`}}),{c(){d=a("p"),b=s("Examples:"),g=h(),$(m.$$.fragment)},l(n){d=i(n,"P",{});var p=l(d);b=r(p,"Examples:"),p.forEach(o),g=f(n),w(m.$$.fragment,n)},m(n,p){v(n,d,p),e(d,b),v(n,g,p),T(m,n,p),_=!0},p:R,i(n){_||(y(m.$$.fragment,n),_=!0)},o(n){x(m.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(g),B(m,n)}}}function A$(k){let d,b,g,m,_,n,p,P,Od,nl,Ce,Tt,Kr,No,Sd,Xr,Nd,sl,yt,Dd,Do,Ld,Vd,rl,js,Wd,al,_e,Yr,Rd,Gd,Zr,Qd,Hd,ea,Ud,il,Is,Jd,ll,qs,ta,Kd,dl,Cs,As,i_,pl,ve,Xd,Lo,Yd,Zd,Vo,ep,tp,cl,Ae,xt,oa,Wo,op,na,np,ml,zs,Os,Ro,sp,rp,hl,ze,Bt,sa,Go,ap,ra,ip,fl,q,Qo,lp,be,Ss,dp,pp,Ns,cp,mp,Ho,hp,fp,gp,Oe,up,Ds,_p,vp,Ls,bp,$p,wp,kt,Tp,Pt,Uo,yp,Jo,xp,Vs,Bp,kp,gl,Se,Ft,aa,Ko,Pp,ia,Fp,ul,H,Xo,Ep,me,Mp,Ws,jp,Ip,la,qp,Cp,Yo,Ap,zp,Op,Ne,Sp,Rs,Np,Dp,Gs,Lp,Vp,Wp,Et,_l,De,Mt,da,Zo,Rp,pa,Gp,vl,U,en,Qp,Le,Hp,Qs,Up,Jp,tn,Kp,Xp,Yp,Ve,Zp,Hs,ec,tc,Us,oc,nc,sc,jt,bl,We,It,ca,on,rc,ma,ac,$l,C,nn,ic,ha,lc,dc,Q,Js,pc,cc,Ks,mc,hc,Xs,fc,gc,fa,uc,_c,Ys,vc,bc,$c,qt,sn,wc,rn,Tc,Zs,yc,xc,Bc,Ct,an,kc,ln,Pc,er,Fc,Ec,wl,Re,At,ga,dn,Mc,ua,jc,Tl,he,pn,Ic,_a,qc,Cc,zt,cn,Ac,va,zc,yl,Ge,Ot,ba,mn,Oc,$a,Sc,xl,I,hn,Nc,fn,Dc,tr,Lc,Vc,Wc,gn,Rc,un,Gc,Qc,Hc,Y,_n,Uc,Qe,Jc,or,Kc,Xc,wa,Yc,Zc,em,St,tm,Nt,om,Z,vn,nm,He,sm,nr,rm,am,Ta,im,lm,dm,Dt,pm,Lt,cm,ee,bn,mm,Ue,hm,sr,fm,gm,ya,um,_m,vm,Vt,bm,Wt,Bl,Je,Rt,xa,$n,$m,Ba,wm,kl,fe,wn,Tm,J,ym,Tn,xm,Bm,ka,km,Pm,Pa,Fm,Em,Fa,Mm,jm,Im,$e,yn,qm,A,Cm,Ea,Am,zm,Ma,Om,Sm,ja,Nm,Dm,Ia,Lm,Vm,qa,Wm,Rm,Gm,xn,Bn,Qm,Ca,Hm,Um,Jm,E,Km,Aa,Xm,Ym,za,Zm,eh,Oa,th,oh,Sa,nh,sh,Na,rh,ah,Da,ih,lh,La,dh,ph,Va,ch,mh,Wa,hh,fh,Ra,gh,uh,Ga,_h,vh,Qa,bh,$h,Ha,wh,Th,Pl,Ke,Gt,Ua,kn,yh,Ja,xh,Fl,Xe,Pn,Bh,we,Fn,kh,Ye,Ph,rr,Fh,Eh,Ka,Mh,jh,Ih,Qt,El,Ze,Ht,Xa,En,qh,Ya,Ch,Ml,z,Mn,Ah,jn,zh,Za,Oh,Sh,Nh,In,Dh,ar,Lh,Vh,Wh,qn,Rh,Cn,Gh,Qh,Hh,te,An,Uh,et,Jh,ir,Kh,Xh,ei,Yh,Zh,ef,Ut,tf,Jt,jl,tt,Kt,ti,zn,of,oi,nf,Il,O,On,sf,ni,rf,af,Sn,lf,lr,df,pf,cf,Nn,mf,Dn,hf,ff,gf,oe,Ln,uf,ot,_f,dr,vf,bf,si,$f,wf,Tf,Xt,yf,Yt,ql,nt,Zt,ri,Vn,xf,ai,Bf,Cl,S,Wn,kf,ii,Pf,Ff,Rn,Ef,pr,Mf,jf,If,Gn,qf,Qn,Cf,Af,zf,ne,Hn,Of,st,Sf,cr,Nf,Df,li,Lf,Vf,Wf,eo,Rf,to,Al,rt,oo,di,Un,Gf,pi,Qf,zl,K,Jn,Hf,se,Kn,Uf,at,Jf,mr,Kf,Xf,ci,Yf,Zf,eg,no,tg,so,og,re,Xn,ng,it,sg,hr,rg,ag,mi,ig,lg,dg,ro,pg,ao,cg,ae,Yn,mg,lt,hg,fr,fg,gg,hi,ug,_g,vg,io,bg,lo,Ol,dt,po,fi,Zn,$g,gi,wg,Sl,ge,es,Tg,X,yg,ts,xg,Bg,ui,kg,Pg,_i,Fg,Eg,vi,Mg,jg,Ig,Te,os,qg,pt,Cg,gr,Ag,zg,bi,Og,Sg,Ng,co,Nl,ct,mo,$i,ns,Dg,wi,Lg,Dl,mt,ss,Vg,ye,rs,Wg,ht,Rg,ur,Gg,Qg,Ti,Hg,Ug,Jg,ho,Ll,ft,fo,yi,as,Kg,xi,Xg,Vl,N,is,Yg,ls,Zg,Bi,eu,tu,ou,ds,nu,_r,su,ru,au,ps,iu,cs,lu,du,pu,ie,ms,cu,gt,mu,vr,hu,fu,ki,gu,uu,_u,go,vu,uo,Wl,ut,_o,Pi,hs,bu,Fi,$u,Rl,D,fs,wu,Ei,Tu,yu,gs,xu,br,Bu,ku,Pu,us,Fu,_s,Eu,Mu,ju,le,vs,Iu,_t,qu,$r,Cu,Au,Mi,zu,Ou,Su,vo,Nu,bo,Gl,vt,$o,ji,bs,Du,Ii,Lu,Ql,L,$s,Vu,qi,Wu,Ru,ws,Gu,wr,Qu,Hu,Uu,Ts,Ju,ys,Ku,Xu,Yu,de,xs,Zu,bt,e_,Tr,t_,o_,Ci,n_,s_,r_,wo,a_,To,Hl;return n=new j({}),No=new j({}),Wo=new j({}),Go=new j({}),Qo=new F({props:{name:"class transformers.BlipConfig",anchor:"transformers.BlipConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"image_text_hidden_size",val:" = 256"},{name:"**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.29.0/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.29.0/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.29.0/src/transformers/models/blip/configuration_blip.py#L278"}}),kt=new W({props:{anchor:"transformers.BlipConfig.example",$$slots:{default:[r$]},$$scope:{ctx:k}}}),Uo=new F({props:{name:"from_text_vision_configs",anchor:"transformers.BlipConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": BlipTextConfig"},{name:"vision_config",val:": BlipVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/configuration_blip.py#L358",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipConfig"
>BlipConfig</a></p>
`}}),Ko=new j({}),Xo=new F({props:{name:"class transformers.BlipTextConfig",anchor:"transformers.BlipTextConfig",parameters:[{name:"vocab_size",val:" = 30524"},{name:"hidden_size",val:" = 768"},{name:"encoder_hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 512"},{name:"hidden_act",val:" = 'gelu'"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"bos_token_id",val:" = 30522"},{name:"eos_token_id",val:" = 2"},{name:"pad_token_id",val:" = 0"},{name:"sep_token_id",val:" = 102"},{name:"is_decoder",val:" = True"},{name:"use_cache",val:" = True"},{name:"**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.29.0/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.29.0/src/transformers/models/blip/configuration_blip.py#L47"}}),Et=new W({props:{anchor:"transformers.BlipTextConfig.example",$$slots:{default:[a$]},$$scope:{ctx:k}}}),Zo=new j({}),en=new F({props:{name:"class transformers.BlipVisionConfig",anchor:"transformers.BlipVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"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.29.0/src/transformers/models/blip/configuration_blip.py#L179"}}),jt=new W({props:{anchor:"transformers.BlipVisionConfig.example",$$slots:{default:[i$]},$$scope:{ctx:k}}}),on=new j({}),nn=new F({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.29.0/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.29.0/src/transformers/models/blip/processing_blip.py#L26"}}),sn=new F({props:{name:"batch_decode",anchor:"transformers.BlipProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/processing_blip.py#L130"}}),an=new F({props:{name:"decode",anchor:"transformers.BlipProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/processing_blip.py#L137"}}),dn=new j({}),pn=new F({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.29.0/src/transformers/models/blip/image_processing_blip.py#L43"}}),cn=new F({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.29.0/src/transformers/models/blip/image_processing_blip.py#L183"}}),mn=new j({}),hn=new F({props:{name:"class transformers.BlipModel",anchor:"transformers.BlipModel",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L717"}}),_n=new F({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.29.0/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.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L827",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.29.0/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.29.0/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.29.0/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.29.0/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>
`}}),St=new V({props:{$$slots:{default:[l$]},$$scope:{ctx:k}}}),Nt=new W({props:{anchor:"transformers.BlipModel.forward.example",$$slots:{default:[d$]},$$scope:{ctx:k}}}),vn=new F({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.29.0/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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L752",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.29.0/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>
`}}),Dt=new V({props:{$$slots:{default:[p$]},$$scope:{ctx:k}}}),Lt=new W({props:{anchor:"transformers.BlipModel.get_text_features.example",$$slots:{default:[c$]},$$scope:{ctx:k}}}),bn=new F({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.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L790",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.29.0/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>
`}}),Vt=new V({props:{$$slots:{default:[m$]},$$scope:{ctx:k}}}),Wt=new W({props:{anchor:"transformers.BlipModel.get_image_features.example",$$slots:{default:[h$]},$$scope:{ctx:k}}}),$n=new j({}),wn=new F({props:{name:"class transformers.BlipTextModel",anchor:"transformers.BlipTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip_text.py#L571"}}),yn=new F({props:{name:"forward",anchor:"transformers.BlipTextModel.forward",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:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"is_decoder",val:": typing.Optional[bool] = False"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip_text.py#L670"}}),kn=new j({}),Pn=new F({props:{name:"class transformers.BlipVisionModel",anchor:"transformers.BlipVisionModel",parameters:[{name:"config",val:": BlipVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L650"}}),Fn=new F({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.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L665",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<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.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new V({props:{$$slots:{default:[f$]},$$scope:{ctx:k}}}),En=new j({}),Mn=new F({props:{name:"class transformers.BlipForConditionalGeneration",anchor:"transformers.BlipForConditionalGeneration",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L930"}}),An=new F({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.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L951",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>
`}}),Ut=new V({props:{$$slots:{default:[g$]},$$scope:{ctx:k}}}),Jt=new W({props:{anchor:"transformers.BlipForConditionalGeneration.forward.example",$$slots:{default:[u$]},$$scope:{ctx:k}}}),zn=new j({}),On=new F({props:{name:"class transformers.BlipForImageTextRetrieval",anchor:"transformers.BlipForImageTextRetrieval",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForImageTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L1337"}}),Ln=new F({props:{name:"forward",anchor:"transformers.BlipForImageTextRetrieval.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"pixel_values",val:": FloatTensor"},{name:"use_itm_head",val:": 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.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L1373",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>
`}}),Xt=new V({props:{$$slots:{default:[_$]},$$scope:{ctx:k}}}),Yt=new W({props:{anchor:"transformers.BlipForImageTextRetrieval.forward.example",$$slots:{default:[v$]},$$scope:{ctx:k}}}),Vn=new j({}),Wn=new F({props:{name:"class transformers.BlipForQuestionAnswering",anchor:"transformers.BlipForQuestionAnswering",parameters:[{name:"config",val:": BlipConfig"}],parametersDescription:[{anchor:"transformers.BlipForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L1102"}}),Hn=new F({props:{name:"forward",anchor:"transformers.BlipForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"pixel_values",val:": FloatTensor"},{name:"decoder_input_ids",val:": 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.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_blip.py#L1137",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>
`}}),eo=new V({props:{$$slots:{default:[b$]},$$scope:{ctx:k}}}),to=new W({props:{anchor:"transformers.BlipForQuestionAnswering.forward.example",$$slots:{default:[$$]},$$scope:{ctx:k}}}),Un=new j({}),Jn=new F({props:{name:"class transformers.TFBlipModel",anchor:"transformers.TFBlipModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L881"}}),Kn=new F({props:{name:"call",anchor:"transformers.TFBlipModel.call",parameters:[{name:"input_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = 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"},{name:"training",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBlipModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBlipModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBlipModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipModel.call.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.TFBlipModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L937",returnDescription:`
<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.blip.configuration_blip.BlipConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>tf.Tensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \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>tf.Tensor</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>tf.Tensor</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.29.0/en/model_doc/blip#transformers.BlipTextModel"
>BlipTextModel</a>.</li>
<li><strong>image_embeds(<code>tf.Tensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.29.0/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.29.0/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.29.0/en/model_doc/blip#transformers.BlipVisionModel"
>BlipVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_tf_blip.TFBlipOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),no=new V({props:{$$slots:{default:[w$]},$$scope:{ctx:k}}}),so=new W({props:{anchor:"transformers.TFBlipModel.call.example",$$slots:{default:[T$]},$$scope:{ctx:k}}}),Xn=new F({props:{name:"get_text_features",anchor:"transformers.TFBlipModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBlipModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBlipModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBlipModel.get_text_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipModel.get_text_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L989",returnDescription:`
<p>The text embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipTextModel"
>TFBlipTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),ro=new V({props:{$$slots:{default:[y$]},$$scope:{ctx:k}}}),ao=new W({props:{anchor:"transformers.TFBlipModel.get_text_features.example",$$slots:{default:[x$]},$$scope:{ctx:k}}}),Yn=new F({props:{name:"get_image_features",anchor:"transformers.TFBlipModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipModel.get_image_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipModel.get_image_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1027",returnDescription:`
<p>The image embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipVisionModel"
>TFBlipVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),io=new V({props:{$$slots:{default:[B$]},$$scope:{ctx:k}}}),lo=new W({props:{anchor:"transformers.TFBlipModel.get_image_features.example",$$slots:{default:[k$]},$$scope:{ctx:k}}}),Zn=new j({}),es=new F({props:{name:"class transformers.TFBlipTextModel",anchor:"transformers.TFBlipTextModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip_text.py#L585"}}),os=new F({props:{name:"call",anchor:"transformers.TFBlipTextModel.call",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"},{name:"training",val:" = None"}],parametersDescription:[{anchor:"transformers.TFBlipTextModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>. See <code>BlipProcessor.__call__()</code> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFBlipTextModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFBlipTextModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFBlipTextModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipTextModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipTextModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFBlipTextModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFBlipTextModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.TFBlipTextModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFBlipTextModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip_text.py#L698"}}),co=new V({props:{$$slots:{default:[P$]},$$scope:{ctx:k}}}),ns=new j({}),ss=new F({props:{name:"class transformers.TFBlipVisionModel",anchor:"transformers.TFBlipVisionModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L646"}}),rs=new F({props:{name:"call",anchor:"transformers.TFBlipVisionModel.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipVisionModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipVisionModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipVisionModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipVisionModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L701",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.blip.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ho=new V({props:{$$slots:{default:[F$]},$$scope:{ctx:k}}}),as=new j({}),is=new F({props:{name:"class transformers.TFBlipForConditionalGeneration",anchor:"transformers.TFBlipForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBlipForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1074"}}),ms=new F({props:{name:"call",anchor:"transformers.TFBlipForConditionalGeneration.call",parameters:[{name:"pixel_values",val:": Tensor"},{name:"input_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipForConditionalGeneration.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipForConditionalGeneration.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipForConditionalGeneration.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1134",returnDescription:`
<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipForConditionalGenerationModelOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.blip.configuration_blip.BlipConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>labels</code> is provided, <code>tf.Tensor</code> of shape <code>(1,)</code>) \u2014 Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>decoder_logits</strong> (<code>tf.Tensor</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>tf.Tensor</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>tf.Tensor</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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.\`</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_tf_blip.TFBlipForConditionalGenerationModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),go=new V({props:{$$slots:{default:[E$]},$$scope:{ctx:k}}}),uo=new W({props:{anchor:"transformers.TFBlipForConditionalGeneration.call.example",$$slots:{default:[M$]},$$scope:{ctx:k}}}),hs=new j({}),fs=new F({props:{name:"class transformers.TFBlipForImageTextRetrieval",anchor:"transformers.TFBlipForImageTextRetrieval",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBlipForImageTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1570"}}),vs=new F({props:{name:"call",anchor:"transformers.TFBlipForImageTextRetrieval.call",parameters:[{name:"input_ids",val:": Tensor"},{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"use_itm_head",val:": typing.Optional[bool] = True"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipForImageTextRetrieval.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipForImageTextRetrieval.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipForImageTextRetrieval.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipForImageTextRetrieval.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1654",returnDescription:`
<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipImageTextMatchingModelOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.blip.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>itm_score</strong> (<code>tf.Tensor</code>) \u2014 The image-text similarity scores.</p>
</li>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>vision_pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>, <em>optional</em>) \u2014 Last layer hidden-state of the vision of the vision-only branch of the model.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>question_embeds</strong> (<code>tf.Tensor</code>) \u2014 The question embeddings obtained by the text projection layer.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_tf_blip.TFBlipImageTextMatchingModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),vo=new V({props:{$$slots:{default:[j$]},$$scope:{ctx:k}}}),bo=new W({props:{anchor:"transformers.TFBlipForImageTextRetrieval.call.example",$$slots:{default:[I$]},$$scope:{ctx:k}}}),bs=new j({}),$s=new F({props:{name:"class transformers.TFBlipForQuestionAnswering",anchor:"transformers.TFBlipForQuestionAnswering",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFBlipForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/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.29.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1288"}}),xs=new F({props:{name:"call",anchor:"transformers.TFBlipForQuestionAnswering.call",parameters:[{name:"input_ids",val:": Tensor"},{name:"pixel_values",val:": Tensor"},{name:"decoder_input_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"foutput_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFBlipForQuestionAnswering.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor">BlipImageProcessor</a>. See <a href="/docs/transformers/v4.29.0/en/model_doc/dpt#transformers.DPTFeatureExtractor.__call__">BlipImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFBlipForQuestionAnswering.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFBlipForQuestionAnswering.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFBlipForQuestionAnswering.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/blip/modeling_tf_blip.py#L1371",returnDescription:`
<p>A <code>transformers.models.blip.modeling_tf_blip.TFBlipTextVisionModelOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.blip.configuration_blip.BlipVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Languge modeling loss from the text decoder.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.blip.modeling_tf_blip.TFBlipTextVisionModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),wo=new V({props:{$$slots:{default:[q$]},$$scope:{ctx:k}}}),To=new W({props:{anchor:"transformers.TFBlipForQuestionAnswering.call.example",$$slots:{default:[C$]},$$scope:{ctx:k}}}),{c(){d=a("meta"),b=h(),g=a("h1"),m=a("a"),_=a("span"),$(n.$$.fragment),p=h(),P=a("span"),Od=s("BLIP"),nl=h(),Ce=a("h2"),Tt=a("a"),Kr=a("span"),$(No.$$.fragment),Sd=h(),Xr=a("span"),Nd=s("Overview"),sl=h(),yt=a("p"),Dd=s("The BLIP model was proposed in "),Do=a("a"),Ld=s("BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation"),Vd=s(" by Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi."),rl=h(),js=a("p"),Wd=s("BLIP is a model that is able to perform various multi-modal tasks including"),al=h(),_e=a("ul"),Yr=a("li"),Rd=s("Visual Question Answering"),Gd=h(),Zr=a("li"),Qd=s("Image-Text retrieval (Image-text matching)"),Hd=h(),ea=a("li"),Ud=s("Image Captioning"),il=h(),Is=a("p"),Jd=s("The abstract from the paper is the following:"),ll=h(),qs=a("p"),ta=a("em"),Kd=s(`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.`),dl=h(),Cs=a("p"),As=a("img"),pl=h(),ve=a("p"),Xd=s("This model was contributed by "),Lo=a("a"),Yd=s("ybelkada"),Zd=s(`.
The original code can be found `),Vo=a("a"),ep=s("here"),tp=s("."),cl=h(),Ae=a("h2"),xt=a("a"),oa=a("span"),$(Wo.$$.fragment),op=h(),na=a("span"),np=s("Resources"),ml=h(),zs=a("ul"),Os=a("li"),Ro=a("a"),sp=s("Jupyter notebook"),rp=s(" on how to fine-tune BLIP for image captioning on a custom dataset"),hl=h(),ze=a("h2"),Bt=a("a"),sa=a("span"),$(Go.$$.fragment),ap=h(),ra=a("span"),ip=s("BlipConfig"),fl=h(),q=a("div"),$(Qo.$$.fragment),lp=h(),be=a("p"),Ss=a("a"),dp=s("BlipConfig"),pp=s(" is the configuration class to store the configuration of a "),Ns=a("a"),cp=s("BlipModel"),mp=s(`. 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
`),Ho=a("a"),hp=s("Salesforce/blip-vqa-base"),fp=s(" architecture."),gp=h(),Oe=a("p"),up=s("Configuration objects inherit from "),Ds=a("a"),_p=s("PretrainedConfig"),vp=s(` and can be used to control the model outputs. Read the
documentation from `),Ls=a("a"),bp=s("PretrainedConfig"),$p=s(" for more information."),wp=h(),$(kt.$$.fragment),Tp=h(),Pt=a("div"),$(Uo.$$.fragment),yp=h(),Jo=a("p"),xp=s("Instantiate a "),Vs=a("a"),Bp=s("BlipConfig"),kp=s(` (or a derived class) from blip text model configuration and blip vision model
configuration.`),gl=h(),Se=a("h2"),Ft=a("a"),aa=a("span"),$(Ko.$$.fragment),Pp=h(),ia=a("span"),Fp=s("BlipTextConfig"),ul=h(),H=a("div"),$(Xo.$$.fragment),Ep=h(),me=a("p"),Mp=s("This is the configuration class to store the configuration of a "),Ws=a("a"),jp=s("BlipTextModel"),Ip=s(`. 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 `),la=a("code"),qp=s("BlipText"),Cp=s(" used by the "),Yo=a("a"),Ap=s(`base
architectures`),zp=s("."),Op=h(),Ne=a("p"),Sp=s("Configuration objects inherit from "),Rs=a("a"),Np=s("PretrainedConfig"),Dp=s(` and can be used to control the model outputs. Read the
documentation from `),Gs=a("a"),Lp=s("PretrainedConfig"),Vp=s(" for more information."),Wp=h(),$(Et.$$.fragment),_l=h(),De=a("h2"),Mt=a("a"),da=a("span"),$(Zo.$$.fragment),Rp=h(),pa=a("span"),Gp=s("BlipVisionConfig"),vl=h(),U=a("div"),$(en.$$.fragment),Qp=h(),Le=a("p"),Hp=s("This is the configuration class to store the configuration of a "),Qs=a("a"),Up=s("BlipVisionModel"),Jp=s(`. 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
`),tn=a("a"),Kp=s("Salesforce/blip-vqa-base"),Xp=s(" architecture."),Yp=h(),Ve=a("p"),Zp=s("Configuration objects inherit from "),Hs=a("a"),ec=s("PretrainedConfig"),tc=s(` and can be used to control the model outputs. Read the
documentation from `),Us=a("a"),oc=s("PretrainedConfig"),nc=s(" for more information."),sc=h(),$(jt.$$.fragment),bl=h(),We=a("h2"),It=a("a"),ca=a("span"),$(on.$$.fragment),rc=h(),ma=a("span"),ac=s("BlipProcessor"),$l=h(),C=a("div"),$(nn.$$.fragment),ic=h(),ha=a("p"),lc=s("Constructs a BLIP processor which wraps a BERT tokenizer and BLIP image processor into a single processor."),dc=h(),Q=a("p"),Js=a("a"),pc=s("BlipProcessor"),cc=s(" offers all the functionalities of "),Ks=a("a"),mc=s("BlipImageProcessor"),hc=s(" and "),Xs=a("a"),fc=s("BertTokenizerFast"),gc=s(`. See the
docstring of `),fa=a("code"),uc=s("__call__()"),_c=s(" and "),Ys=a("a"),vc=s("decode()"),bc=s(" for more information."),$c=h(),qt=a("div"),$(sn.$$.fragment),wc=h(),rn=a("p"),Tc=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),Zs=a("a"),yc=s("batch_decode()"),xc=s(`. Please
refer to the docstring of this method for more information.`),Bc=h(),Ct=a("div"),$(an.$$.fragment),kc=h(),ln=a("p"),Pc=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),er=a("a"),Fc=s("decode()"),Ec=s(`. Please refer to
the docstring of this method for more information.`),wl=h(),Re=a("h2"),At=a("a"),ga=a("span"),$(dn.$$.fragment),Mc=h(),ua=a("span"),jc=s("BlipImageProcessor"),Tl=h(),he=a("div"),$(pn.$$.fragment),Ic=h(),_a=a("p"),qc=s("Constructs a BLIP image processor."),Cc=h(),zt=a("div"),$(cn.$$.fragment),Ac=h(),va=a("p"),zc=s("Preprocess an image or batch of images."),yl=h(),Ge=a("h2"),Ot=a("a"),ba=a("span"),$(mn.$$.fragment),Oc=h(),$a=a("span"),Sc=s("BlipModel"),xl=h(),I=a("div"),$(hn.$$.fragment),Nc=h(),fn=a("p"),Dc=s("This model inherits from "),tr=a("a"),Lc=s("PreTrainedModel"),Vc=s(`. 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.)`),Wc=h(),gn=a("p"),Rc=s("This model is also a PyTorch "),un=a("a"),Gc=s("torch.nn.Module"),Qc=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hc=h(),Y=a("div"),$(_n.$$.fragment),Uc=h(),Qe=a("p"),Jc=s("The "),or=a("a"),Kc=s("BlipModel"),Xc=s(" forward method, overrides the "),wa=a("code"),Yc=s("__call__"),Zc=s(" special method."),em=h(),$(St.$$.fragment),tm=h(),$(Nt.$$.fragment),om=h(),Z=a("div"),$(vn.$$.fragment),nm=h(),He=a("p"),sm=s("The "),nr=a("a"),rm=s("BlipModel"),am=s(" forward method, overrides the "),Ta=a("code"),im=s("__call__"),lm=s(" special method."),dm=h(),$(Dt.$$.fragment),pm=h(),$(Lt.$$.fragment),cm=h(),ee=a("div"),$(bn.$$.fragment),mm=h(),Ue=a("p"),hm=s("The "),sr=a("a"),fm=s("BlipModel"),gm=s(" forward method, overrides the "),ya=a("code"),um=s("__call__"),_m=s(" special method."),vm=h(),$(Vt.$$.fragment),bm=h(),$(Wt.$$.fragment),Bl=h(),Je=a("h2"),Rt=a("a"),xa=a("span"),$($n.$$.fragment),$m=h(),Ba=a("span"),wm=s("BlipTextModel"),kl=h(),fe=a("div"),$(wn.$$.fragment),Tm=h(),J=a("p"),ym=s(`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 `),Tn=a("a"),xm=s(`Attention is
all you need`),Bm=s(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and `),ka=a("code"),km=s("is_decoder"),Pm=s(" set to "),Pa=a("code"),Fm=s("True"),Em=s(`; an
`),Fa=a("code"),Mm=s("encoder_hidden_states"),jm=s(" is then expected as an input to the forward pass."),Im=h(),$e=a("div"),$(yn.$$.fragment),qm=h(),A=a("p"),Cm=s("encoder_hidden_states  ("),Ea=a("code"),Am=s("torch.FloatTensor"),zm=s(", "),Ma=a("em"),Om=s("optional"),Sm=s(`):
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 (`),ja=a("code"),Nm=s("torch.FloatTensor"),Dm=s(", "),Ia=a("em"),Lm=s("optional"),Vm=s(`):
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 `),qa=a("code"),Wm=s("[0, 1]"),Rm=s(":"),Gm=h(),xn=a("ul"),Bn=a("li"),Qm=s("1 for tokens that are "),Ca=a("strong"),Hm=s("not masked"),Um=s(","),Jm=h(),E=a("li"),Km=s("0 for tokens that are "),Aa=a("strong"),Xm=s("masked"),Ym=s(`.
past_key_values (`),za=a("code"),Zm=s("tuple(tuple(torch.FloatTensor))"),eh=s(", "),Oa=a("em"),th=s("optional"),oh=s(`):
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),Sa=a("code"),nh=s("past_key_values"),sh=s(" are used, the user can optionally input only the last "),Na=a("code"),rh=s("decoder_input_ids"),ah=s(` (those that
don\u2019t have their past key value states given to this model) of shape `),Da=a("code"),ih=s("(batch_size, 1)"),lh=s(` instead of all
`),La=a("code"),dh=s("decoder_input_ids"),ph=s(" of shape "),Va=a("code"),ch=s("(batch_size, sequence_length)"),mh=s(`.
use_cache (`),Wa=a("code"),hh=s("bool"),fh=s(", "),Ra=a("em"),gh=s("optional"),uh=s(`):
If set to `),Ga=a("code"),_h=s("True"),vh=s(", "),Qa=a("code"),bh=s("past_key_values"),$h=s(` key value states are returned and can be used to speed up decoding (see
`),Ha=a("code"),wh=s("past_key_values"),Th=s(")."),Pl=h(),Ke=a("h2"),Gt=a("a"),Ua=a("span"),$(kn.$$.fragment),yh=h(),Ja=a("span"),xh=s("BlipVisionModel"),Fl=h(),Xe=a("div"),$(Pn.$$.fragment),Bh=h(),we=a("div"),$(Fn.$$.fragment),kh=h(),Ye=a("p"),Ph=s("The "),rr=a("a"),Fh=s("BlipVisionModel"),Eh=s(" forward method, overrides the "),Ka=a("code"),Mh=s("__call__"),jh=s(" special method."),Ih=h(),$(Qt.$$.fragment),El=h(),Ze=a("h2"),Ht=a("a"),Xa=a("span"),$(En.$$.fragment),qh=h(),Ya=a("span"),Ch=s("BlipForConditionalGeneration"),Ml=h(),z=a("div"),$(Mn.$$.fragment),Ah=h(),jn=a("p"),zh=s(`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
`),Za=a("code"),Oh=s("input_ids"),Sh=s(` 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.`),Nh=h(),In=a("p"),Dh=s("This model inherits from "),ar=a("a"),Lh=s("PreTrainedModel"),Vh=s(`. 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.)`),Wh=h(),qn=a("p"),Rh=s("This model is also a PyTorch "),Cn=a("a"),Gh=s("torch.nn.Module"),Qh=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hh=h(),te=a("div"),$(An.$$.fragment),Uh=h(),et=a("p"),Jh=s("The "),ir=a("a"),Kh=s("BlipForConditionalGeneration"),Xh=s(" forward method, overrides the "),ei=a("code"),Yh=s("__call__"),Zh=s(" special method."),ef=h(),$(Ut.$$.fragment),tf=h(),$(Jt.$$.fragment),jl=h(),tt=a("h2"),Kt=a("a"),ti=a("span"),$(zn.$$.fragment),of=h(),oi=a("span"),nf=s("BlipForImageTextRetrieval"),Il=h(),O=a("div"),$(On.$$.fragment),sf=h(),ni=a("p"),rf=s(`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.`),af=h(),Sn=a("p"),lf=s("This model inherits from "),lr=a("a"),df=s("PreTrainedModel"),pf=s(`. 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.)`),cf=h(),Nn=a("p"),mf=s("This model is also a PyTorch "),Dn=a("a"),hf=s("torch.nn.Module"),ff=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gf=h(),oe=a("div"),$(Ln.$$.fragment),uf=h(),ot=a("p"),_f=s("The "),dr=a("a"),vf=s("BlipForImageTextRetrieval"),bf=s(" forward method, overrides the "),si=a("code"),$f=s("__call__"),wf=s(" special method."),Tf=h(),$(Xt.$$.fragment),yf=h(),$(Yt.$$.fragment),ql=h(),nt=a("h2"),Zt=a("a"),ri=a("span"),$(Vn.$$.fragment),xf=h(),ai=a("span"),Bf=s("BlipForQuestionAnswering"),Cl=h(),S=a("div"),$(Wn.$$.fragment),kf=h(),ii=a("p"),Pf=s(`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=h(),Rn=a("p"),Ef=s("This model inherits from "),pr=a("a"),Mf=s("PreTrainedModel"),jf=s(`. 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.)`),If=h(),Gn=a("p"),qf=s("This model is also a PyTorch "),Qn=a("a"),Cf=s("torch.nn.Module"),Af=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zf=h(),ne=a("div"),$(Hn.$$.fragment),Of=h(),st=a("p"),Sf=s("The "),cr=a("a"),Nf=s("BlipForQuestionAnswering"),Df=s(" forward method, overrides the "),li=a("code"),Lf=s("__call__"),Vf=s(" special method."),Wf=h(),$(eo.$$.fragment),Rf=h(),$(to.$$.fragment),Al=h(),rt=a("h2"),oo=a("a"),di=a("span"),$(Un.$$.fragment),Gf=h(),pi=a("span"),Qf=s("TFBlipModel"),zl=h(),K=a("div"),$(Jn.$$.fragment),Hf=h(),se=a("div"),$(Kn.$$.fragment),Uf=h(),at=a("p"),Jf=s("The "),mr=a("a"),Kf=s("TFBlipModel"),Xf=s(" forward method, overrides the "),ci=a("code"),Yf=s("__call__"),Zf=s(" special method."),eg=h(),$(no.$$.fragment),tg=h(),$(so.$$.fragment),og=h(),re=a("div"),$(Xn.$$.fragment),ng=h(),it=a("p"),sg=s("The "),hr=a("a"),rg=s("TFBlipModel"),ag=s(" forward method, overrides the "),mi=a("code"),ig=s("__call__"),lg=s(" special method."),dg=h(),$(ro.$$.fragment),pg=h(),$(ao.$$.fragment),cg=h(),ae=a("div"),$(Yn.$$.fragment),mg=h(),lt=a("p"),hg=s("The "),fr=a("a"),fg=s("TFBlipModel"),gg=s(" forward method, overrides the "),hi=a("code"),ug=s("__call__"),_g=s(" special method."),vg=h(),$(io.$$.fragment),bg=h(),$(lo.$$.fragment),Ol=h(),dt=a("h2"),po=a("a"),fi=a("span"),$(Zn.$$.fragment),$g=h(),gi=a("span"),wg=s("TFBlipTextModel"),Sl=h(),ge=a("div"),$(es.$$.fragment),Tg=h(),X=a("p"),yg=s(`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 `),ts=a("a"),xg=s(`Attention is
all you need`),Bg=s(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and `),ui=a("code"),kg=s("is_decoder"),Pg=s(" set to "),_i=a("code"),Fg=s("True"),Eg=s(`; an
`),vi=a("code"),Mg=s("encoder_hidden_states"),jg=s(" is then expected as an input to the forward pass."),Ig=h(),Te=a("div"),$(os.$$.fragment),qg=h(),pt=a("p"),Cg=s("The "),gr=a("a"),Ag=s("TFBlipTextModel"),zg=s(" forward method, overrides the "),bi=a("code"),Og=s("__call__"),Sg=s(" special method."),Ng=h(),$(co.$$.fragment),Nl=h(),ct=a("h2"),mo=a("a"),$i=a("span"),$(ns.$$.fragment),Dg=h(),wi=a("span"),Lg=s("TFBlipVisionModel"),Dl=h(),mt=a("div"),$(ss.$$.fragment),Vg=h(),ye=a("div"),$(rs.$$.fragment),Wg=h(),ht=a("p"),Rg=s("The "),ur=a("a"),Gg=s("TFBlipVisionModel"),Qg=s(" forward method, overrides the "),Ti=a("code"),Hg=s("__call__"),Ug=s(" special method."),Jg=h(),$(ho.$$.fragment),Ll=h(),ft=a("h2"),fo=a("a"),yi=a("span"),$(as.$$.fragment),Kg=h(),xi=a("span"),Xg=s("TFBlipForConditionalGeneration"),Vl=h(),N=a("div"),$(is.$$.fragment),Yg=h(),ls=a("p"),Zg=s(`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
`),Bi=a("code"),eu=s("input_ids"),tu=s(` 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.`),ou=h(),ds=a("p"),nu=s("This model inherits from "),_r=a("a"),su=s("TFPreTrainedModel"),ru=s(`. 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.)`),au=h(),ps=a("p"),iu=s("This model is also a "),cs=a("a"),lu=s("tf.keras.Model"),du=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),pu=h(),ie=a("div"),$(ms.$$.fragment),cu=h(),gt=a("p"),mu=s("The "),vr=a("a"),hu=s("TFBlipForConditionalGeneration"),fu=s(" forward method, overrides the "),ki=a("code"),gu=s("__call__"),uu=s(" special method."),_u=h(),$(go.$$.fragment),vu=h(),$(uo.$$.fragment),Wl=h(),ut=a("h2"),_o=a("a"),Pi=a("span"),$(hs.$$.fragment),bu=h(),Fi=a("span"),$u=s("TFBlipForImageTextRetrieval"),Rl=h(),D=a("div"),$(fs.$$.fragment),wu=h(),Ei=a("p"),Tu=s(`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.`),yu=h(),gs=a("p"),xu=s("This model inherits from "),br=a("a"),Bu=s("TFPreTrainedModel"),ku=s(`. 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.)`),Pu=h(),us=a("p"),Fu=s("This model is also a "),_s=a("a"),Eu=s("tf.keras.Model"),Mu=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ju=h(),le=a("div"),$(vs.$$.fragment),Iu=h(),_t=a("p"),qu=s("The "),$r=a("a"),Cu=s("TFBlipForImageTextRetrieval"),Au=s(" forward method, overrides the "),Mi=a("code"),zu=s("__call__"),Ou=s(" special method."),Su=h(),$(vo.$$.fragment),Nu=h(),$(bo.$$.fragment),Gl=h(),vt=a("h2"),$o=a("a"),ji=a("span"),$(bs.$$.fragment),Du=h(),Ii=a("span"),Lu=s("TFBlipForQuestionAnswering"),Ql=h(),L=a("div"),$($s.$$.fragment),Vu=h(),qi=a("p"),Wu=s(`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.`),Ru=h(),ws=a("p"),Gu=s("This model inherits from "),wr=a("a"),Qu=s("TFPreTrainedModel"),Hu=s(`. 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.)`),Uu=h(),Ts=a("p"),Ju=s("This model is also a "),ys=a("a"),Ku=s("tf.keras.Model"),Xu=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Yu=h(),de=a("div"),$(xs.$$.fragment),Zu=h(),bt=a("p"),e_=s("The "),Tr=a("a"),t_=s("TFBlipForQuestionAnswering"),o_=s(" forward method, overrides the "),Ci=a("code"),n_=s("__call__"),s_=s(" special method."),r_=h(),$(wo.$$.fragment),a_=h(),$(To.$$.fragment),this.h()},l(t){const u=o$('[data-svelte="svelte-1phssyn"]',document.head);d=i(u,"META",{name:!0,content:!0}),u.forEach(o),b=f(t),g=i(t,"H1",{class:!0});var Bs=l(g);m=i(Bs,"A",{id:!0,class:!0,href:!0});var Ai=l(m);_=i(Ai,"SPAN",{});var zi=l(_);w(n.$$.fragment,zi),zi.forEach(o),Ai.forEach(o),p=f(Bs),P=i(Bs,"SPAN",{});var Oi=l(P);Od=r(Oi,"BLIP"),Oi.forEach(o),Bs.forEach(o),nl=f(t),Ce=i(t,"H2",{class:!0});var ks=l(Ce);Tt=i(ks,"A",{id:!0,class:!0,href:!0});var Si=l(Tt);Kr=i(Si,"SPAN",{});var Ni=l(Kr);w(No.$$.fragment,Ni),Ni.forEach(o),Si.forEach(o),Sd=f(ks),Xr=i(ks,"SPAN",{});var Di=l(Xr);Nd=r(Di,"Overview"),Di.forEach(o),ks.forEach(o),sl=f(t),yt=i(t,"P",{});var Ps=l(yt);Dd=r(Ps,"The BLIP model was proposed in "),Do=i(Ps,"A",{href:!0,rel:!0});var Li=l(Do);Ld=r(Li,"BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation"),Li.forEach(o),Vd=r(Ps," by Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi."),Ps.forEach(o),rl=f(t),js=i(t,"P",{});var Vi=l(js);Wd=r(Vi,"BLIP is a model that is able to perform various multi-modal tasks including"),Vi.forEach(o),al=f(t),_e=i(t,"UL",{});var $t=l(_e);Yr=i($t,"LI",{});var Wi=l(Yr);Rd=r(Wi,"Visual Question Answering"),Wi.forEach(o),Gd=f($t),Zr=i($t,"LI",{});var Ri=l(Zr);Qd=r(Ri,"Image-Text retrieval (Image-text matching)"),Ri.forEach(o),Hd=f($t),ea=i($t,"LI",{});var Gi=l(ea);Ud=r(Gi,"Image Captioning"),Gi.forEach(o),$t.forEach(o),il=f(t),Is=i(t,"P",{});var Qi=l(Is);Jd=r(Qi,"The abstract from the paper is the following:"),Qi.forEach(o),ll=f(t),qs=i(t,"P",{});var Hi=l(qs);ta=i(Hi,"EM",{});var Ui=l(ta);Kd=r(Ui,`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.`),Ui.forEach(o),Hi.forEach(o),dl=f(t),Cs=i(t,"P",{});var Ji=l(Cs);As=i(Ji,"IMG",{src:!0,alt:!0}),Ji.forEach(o),pl=f(t),ve=i(t,"P",{});var wt=l(ve);Xd=r(wt,"This model was contributed by "),Lo=i(wt,"A",{href:!0,rel:!0});var Ki=l(Lo);Yd=r(Ki,"ybelkada"),Ki.forEach(o),Zd=r(wt,`.
The original code can be found `),Vo=i(wt,"A",{href:!0,rel:!0});var Xi=l(Vo);ep=r(Xi,"here"),Xi.forEach(o),tp=r(wt,"."),wt.forEach(o),cl=f(t),Ae=i(t,"H2",{class:!0});var Fs=l(Ae);xt=i(Fs,"A",{id:!0,class:!0,href:!0});var Yi=l(xt);oa=i(Yi,"SPAN",{});var Zi=l(oa);w(Wo.$$.fragment,Zi),Zi.forEach(o),Yi.forEach(o),op=f(Fs),na=i(Fs,"SPAN",{});var el=l(na);np=r(el,"Resources"),el.forEach(o),Fs.forEach(o),ml=f(t),zs=i(t,"UL",{});var tl=l(zs);Os=i(tl,"LI",{});var yr=l(Os);Ro=i(yr,"A",{href:!0,rel:!0});var ol=l(Ro);sp=r(ol,"Jupyter notebook"),ol.forEach(o),rp=r(yr," on how to fine-tune BLIP for image captioning on a custom dataset"),yr.forEach(o),tl.forEach(o),hl=f(t),ze=i(t,"H2",{class:!0});var Es=l(ze);Bt=i(Es,"A",{id:!0,class:!0,href:!0});var l_=l(Bt);sa=i(l_,"SPAN",{});var d_=l(sa);w(Go.$$.fragment,d_),d_.forEach(o),l_.forEach(o),ap=f(Es),ra=i(Es,"SPAN",{});var p_=l(ra);ip=r(p_,"BlipConfig"),p_.forEach(o),Es.forEach(o),fl=f(t),q=i(t,"DIV",{class:!0});var xe=l(q);w(Qo.$$.fragment,xe),lp=f(xe),be=i(xe,"P",{});var Ms=l(be);Ss=i(Ms,"A",{href:!0});var c_=l(Ss);dp=r(c_,"BlipConfig"),c_.forEach(o),pp=r(Ms," is the configuration class to store the configuration of a "),Ns=i(Ms,"A",{href:!0});var m_=l(Ns);cp=r(m_,"BlipModel"),m_.forEach(o),mp=r(Ms,`. 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
`),Ho=i(Ms,"A",{href:!0,rel:!0});var h_=l(Ho);hp=r(h_,"Salesforce/blip-vqa-base"),h_.forEach(o),fp=r(Ms," architecture."),Ms.forEach(o),gp=f(xe),Oe=i(xe,"P",{});var xr=l(Oe);up=r(xr,"Configuration objects inherit from "),Ds=i(xr,"A",{href:!0});var f_=l(Ds);_p=r(f_,"PretrainedConfig"),f_.forEach(o),vp=r(xr,` and can be used to control the model outputs. Read the
documentation from `),Ls=i(xr,"A",{href:!0});var g_=l(Ls);bp=r(g_,"PretrainedConfig"),g_.forEach(o),$p=r(xr," for more information."),xr.forEach(o),wp=f(xe),w(kt.$$.fragment,xe),Tp=f(xe),Pt=i(xe,"DIV",{class:!0});var Ul=l(Pt);w(Uo.$$.fragment,Ul),yp=f(Ul),Jo=i(Ul,"P",{});var Jl=l(Jo);xp=r(Jl,"Instantiate a "),Vs=i(Jl,"A",{href:!0});var u_=l(Vs);Bp=r(u_,"BlipConfig"),u_.forEach(o),kp=r(Jl,` (or a derived class) from blip text model configuration and blip vision model
configuration.`),Jl.forEach(o),Ul.forEach(o),xe.forEach(o),gl=f(t),Se=i(t,"H2",{class:!0});var Kl=l(Se);Ft=i(Kl,"A",{id:!0,class:!0,href:!0});var __=l(Ft);aa=i(__,"SPAN",{});var v_=l(aa);w(Ko.$$.fragment,v_),v_.forEach(o),__.forEach(o),Pp=f(Kl),ia=i(Kl,"SPAN",{});var b_=l(ia);Fp=r(b_,"BlipTextConfig"),b_.forEach(o),Kl.forEach(o),ul=f(t),H=i(t,"DIV",{class:!0});var yo=l(H);w(Xo.$$.fragment,yo),Ep=f(yo),me=i(yo,"P",{});var xo=l(me);Mp=r(xo,"This is the configuration class to store the configuration of a "),Ws=i(xo,"A",{href:!0});var $_=l(Ws);jp=r($_,"BlipTextModel"),$_.forEach(o),Ip=r(xo,`. 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 `),la=i(xo,"CODE",{});var w_=l(la);qp=r(w_,"BlipText"),w_.forEach(o),Cp=r(xo," used by the "),Yo=i(xo,"A",{href:!0,rel:!0});var T_=l(Yo);Ap=r(T_,`base
architectures`),T_.forEach(o),zp=r(xo,"."),xo.forEach(o),Op=f(yo),Ne=i(yo,"P",{});var Br=l(Ne);Sp=r(Br,"Configuration objects inherit from "),Rs=i(Br,"A",{href:!0});var y_=l(Rs);Np=r(y_,"PretrainedConfig"),y_.forEach(o),Dp=r(Br,` and can be used to control the model outputs. Read the
documentation from `),Gs=i(Br,"A",{href:!0});var x_=l(Gs);Lp=r(x_,"PretrainedConfig"),x_.forEach(o),Vp=r(Br," for more information."),Br.forEach(o),Wp=f(yo),w(Et.$$.fragment,yo),yo.forEach(o),_l=f(t),De=i(t,"H2",{class:!0});var Xl=l(De);Mt=i(Xl,"A",{id:!0,class:!0,href:!0});var B_=l(Mt);da=i(B_,"SPAN",{});var k_=l(da);w(Zo.$$.fragment,k_),k_.forEach(o),B_.forEach(o),Rp=f(Xl),pa=i(Xl,"SPAN",{});var P_=l(pa);Gp=r(P_,"BlipVisionConfig"),P_.forEach(o),Xl.forEach(o),vl=f(t),U=i(t,"DIV",{class:!0});var Bo=l(U);w(en.$$.fragment,Bo),Qp=f(Bo),Le=i(Bo,"P",{});var kr=l(Le);Hp=r(kr,"This is the configuration class to store the configuration of a "),Qs=i(kr,"A",{href:!0});var F_=l(Qs);Up=r(F_,"BlipVisionModel"),F_.forEach(o),Jp=r(kr,`. 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
`),tn=i(kr,"A",{href:!0,rel:!0});var E_=l(tn);Kp=r(E_,"Salesforce/blip-vqa-base"),E_.forEach(o),Xp=r(kr," architecture."),kr.forEach(o),Yp=f(Bo),Ve=i(Bo,"P",{});var Pr=l(Ve);Zp=r(Pr,"Configuration objects inherit from "),Hs=i(Pr,"A",{href:!0});var M_=l(Hs);ec=r(M_,"PretrainedConfig"),M_.forEach(o),tc=r(Pr,` and can be used to control the model outputs. Read the
documentation from `),Us=i(Pr,"A",{href:!0});var j_=l(Us);oc=r(j_,"PretrainedConfig"),j_.forEach(o),nc=r(Pr," for more information."),Pr.forEach(o),sc=f(Bo),w(jt.$$.fragment,Bo),Bo.forEach(o),bl=f(t),We=i(t,"H2",{class:!0});var Yl=l(We);It=i(Yl,"A",{id:!0,class:!0,href:!0});var I_=l(It);ca=i(I_,"SPAN",{});var q_=l(ca);w(on.$$.fragment,q_),q_.forEach(o),I_.forEach(o),rc=f(Yl),ma=i(Yl,"SPAN",{});var C_=l(ma);ac=r(C_,"BlipProcessor"),C_.forEach(o),Yl.forEach(o),$l=f(t),C=i(t,"DIV",{class:!0});var Be=l(C);w(nn.$$.fragment,Be),ic=f(Be),ha=i(Be,"P",{});var A_=l(ha);lc=r(A_,"Constructs a BLIP processor which wraps a BERT tokenizer and BLIP image processor into a single processor."),A_.forEach(o),dc=f(Be),Q=i(Be,"P",{});var ue=l(Q);Js=i(ue,"A",{href:!0});var z_=l(Js);pc=r(z_,"BlipProcessor"),z_.forEach(o),cc=r(ue," offers all the functionalities of "),Ks=i(ue,"A",{href:!0});var O_=l(Ks);mc=r(O_,"BlipImageProcessor"),O_.forEach(o),hc=r(ue," and "),Xs=i(ue,"A",{href:!0});var S_=l(Xs);fc=r(S_,"BertTokenizerFast"),S_.forEach(o),gc=r(ue,`. See the
docstring of `),fa=i(ue,"CODE",{});var N_=l(fa);uc=r(N_,"__call__()"),N_.forEach(o),_c=r(ue," and "),Ys=i(ue,"A",{href:!0});var D_=l(Ys);vc=r(D_,"decode()"),D_.forEach(o),bc=r(ue," for more information."),ue.forEach(o),$c=f(Be),qt=i(Be,"DIV",{class:!0});var Zl=l(qt);w(sn.$$.fragment,Zl),wc=f(Zl),rn=i(Zl,"P",{});var ed=l(rn);Tc=r(ed,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Zs=i(ed,"A",{href:!0});var L_=l(Zs);yc=r(L_,"batch_decode()"),L_.forEach(o),xc=r(ed,`. Please
refer to the docstring of this method for more information.`),ed.forEach(o),Zl.forEach(o),Bc=f(Be),Ct=i(Be,"DIV",{class:!0});var td=l(Ct);w(an.$$.fragment,td),kc=f(td),ln=i(td,"P",{});var od=l(ln);Pc=r(od,"This method forwards all its arguments to BertTokenizerFast\u2019s "),er=i(od,"A",{href:!0});var V_=l(er);Fc=r(V_,"decode()"),V_.forEach(o),Ec=r(od,`. Please refer to
the docstring of this method for more information.`),od.forEach(o),td.forEach(o),Be.forEach(o),wl=f(t),Re=i(t,"H2",{class:!0});var nd=l(Re);At=i(nd,"A",{id:!0,class:!0,href:!0});var W_=l(At);ga=i(W_,"SPAN",{});var R_=l(ga);w(dn.$$.fragment,R_),R_.forEach(o),W_.forEach(o),Mc=f(nd),ua=i(nd,"SPAN",{});var G_=l(ua);jc=r(G_,"BlipImageProcessor"),G_.forEach(o),nd.forEach(o),Tl=f(t),he=i(t,"DIV",{class:!0});var Fr=l(he);w(pn.$$.fragment,Fr),Ic=f(Fr),_a=i(Fr,"P",{});var Q_=l(_a);qc=r(Q_,"Constructs a BLIP image processor."),Q_.forEach(o),Cc=f(Fr),zt=i(Fr,"DIV",{class:!0});var sd=l(zt);w(cn.$$.fragment,sd),Ac=f(sd),va=i(sd,"P",{});var H_=l(va);zc=r(H_,"Preprocess an image or batch of images."),H_.forEach(o),sd.forEach(o),Fr.forEach(o),yl=f(t),Ge=i(t,"H2",{class:!0});var rd=l(Ge);Ot=i(rd,"A",{id:!0,class:!0,href:!0});var U_=l(Ot);ba=i(U_,"SPAN",{});var J_=l(ba);w(mn.$$.fragment,J_),J_.forEach(o),U_.forEach(o),Oc=f(rd),$a=i(rd,"SPAN",{});var K_=l($a);Sc=r(K_,"BlipModel"),K_.forEach(o),rd.forEach(o),xl=f(t),I=i(t,"DIV",{class:!0});var pe=l(I);w(hn.$$.fragment,pe),Nc=f(pe),fn=i(pe,"P",{});var ad=l(fn);Dc=r(ad,"This model inherits from "),tr=i(ad,"A",{href:!0});var X_=l(tr);Lc=r(X_,"PreTrainedModel"),X_.forEach(o),Vc=r(ad,`. 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.)`),ad.forEach(o),Wc=f(pe),gn=i(pe,"P",{});var id=l(gn);Rc=r(id,"This model is also a PyTorch "),un=i(id,"A",{href:!0,rel:!0});var Y_=l(un);Gc=r(Y_,"torch.nn.Module"),Y_.forEach(o),Qc=r(id,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),id.forEach(o),Hc=f(pe),Y=i(pe,"DIV",{class:!0});var ko=l(Y);w(_n.$$.fragment,ko),Uc=f(ko),Qe=i(ko,"P",{});var Er=l(Qe);Jc=r(Er,"The "),or=i(Er,"A",{href:!0});var Z_=l(or);Kc=r(Z_,"BlipModel"),Z_.forEach(o),Xc=r(Er," forward method, overrides the "),wa=i(Er,"CODE",{});var ev=l(wa);Yc=r(ev,"__call__"),ev.forEach(o),Zc=r(Er," special method."),Er.forEach(o),em=f(ko),w(St.$$.fragment,ko),tm=f(ko),w(Nt.$$.fragment,ko),ko.forEach(o),om=f(pe),Z=i(pe,"DIV",{class:!0});var Po=l(Z);w(vn.$$.fragment,Po),nm=f(Po),He=i(Po,"P",{});var Mr=l(He);sm=r(Mr,"The "),nr=i(Mr,"A",{href:!0});var tv=l(nr);rm=r(tv,"BlipModel"),tv.forEach(o),am=r(Mr," forward method, overrides the "),Ta=i(Mr,"CODE",{});var ov=l(Ta);im=r(ov,"__call__"),ov.forEach(o),lm=r(Mr," special method."),Mr.forEach(o),dm=f(Po),w(Dt.$$.fragment,Po),pm=f(Po),w(Lt.$$.fragment,Po),Po.forEach(o),cm=f(pe),ee=i(pe,"DIV",{class:!0});var Fo=l(ee);w(bn.$$.fragment,Fo),mm=f(Fo),Ue=i(Fo,"P",{});var jr=l(Ue);hm=r(jr,"The "),sr=i(jr,"A",{href:!0});var nv=l(sr);fm=r(nv,"BlipModel"),nv.forEach(o),gm=r(jr," forward method, overrides the "),ya=i(jr,"CODE",{});var sv=l(ya);um=r(sv,"__call__"),sv.forEach(o),_m=r(jr," special method."),jr.forEach(o),vm=f(Fo),w(Vt.$$.fragment,Fo),bm=f(Fo),w(Wt.$$.fragment,Fo),Fo.forEach(o),pe.forEach(o),Bl=f(t),Je=i(t,"H2",{class:!0});var ld=l(Je);Rt=i(ld,"A",{id:!0,class:!0,href:!0});var rv=l(Rt);xa=i(rv,"SPAN",{});var av=l(xa);w($n.$$.fragment,av),av.forEach(o),rv.forEach(o),$m=f(ld),Ba=i(ld,"SPAN",{});var iv=l(Ba);wm=r(iv,"BlipTextModel"),iv.forEach(o),ld.forEach(o),kl=f(t),fe=i(t,"DIV",{class:!0});var Ir=l(fe);w(wn.$$.fragment,Ir),Tm=f(Ir),J=i(Ir,"P",{});var ke=l(J);ym=r(ke,`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 `),Tn=i(ke,"A",{href:!0,rel:!0});var lv=l(Tn);xm=r(lv,`Attention is
all you need`),lv.forEach(o),Bm=r(ke,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and `),ka=i(ke,"CODE",{});var dv=l(ka);km=r(dv,"is_decoder"),dv.forEach(o),Pm=r(ke," set to "),Pa=i(ke,"CODE",{});var pv=l(Pa);Fm=r(pv,"True"),pv.forEach(o),Em=r(ke,`; an
`),Fa=i(ke,"CODE",{});var cv=l(Fa);Mm=r(cv,"encoder_hidden_states"),cv.forEach(o),jm=r(ke," is then expected as an input to the forward pass."),ke.forEach(o),Im=f(Ir),$e=i(Ir,"DIV",{class:!0});var qr=l($e);w(yn.$$.fragment,qr),qm=f(qr),A=i(qr,"P",{});var ce=l(A);Cm=r(ce,"encoder_hidden_states  ("),Ea=i(ce,"CODE",{});var mv=l(Ea);Am=r(mv,"torch.FloatTensor"),mv.forEach(o),zm=r(ce,", "),Ma=i(ce,"EM",{});var hv=l(Ma);Om=r(hv,"optional"),hv.forEach(o),Sm=r(ce,`):
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 (`),ja=i(ce,"CODE",{});var fv=l(ja);Nm=r(fv,"torch.FloatTensor"),fv.forEach(o),Dm=r(ce,", "),Ia=i(ce,"EM",{});var gv=l(Ia);Lm=r(gv,"optional"),gv.forEach(o),Vm=r(ce,`):
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 `),qa=i(ce,"CODE",{});var uv=l(qa);Wm=r(uv,"[0, 1]"),uv.forEach(o),Rm=r(ce,":"),ce.forEach(o),Gm=f(qr),xn=i(qr,"UL",{});var dd=l(xn);Bn=i(dd,"LI",{});var pd=l(Bn);Qm=r(pd,"1 for tokens that are "),Ca=i(pd,"STRONG",{});var _v=l(Ca);Hm=r(_v,"not masked"),_v.forEach(o),Um=r(pd,","),pd.forEach(o),Jm=f(dd),E=i(dd,"LI",{});var M=l(E);Km=r(M,"0 for tokens that are "),Aa=i(M,"STRONG",{});var vv=l(Aa);Xm=r(vv,"masked"),vv.forEach(o),Ym=r(M,`.
past_key_values (`),za=i(M,"CODE",{});var bv=l(za);Zm=r(bv,"tuple(tuple(torch.FloatTensor))"),bv.forEach(o),eh=r(M,", "),Oa=i(M,"EM",{});var $v=l(Oa);th=r($v,"optional"),$v.forEach(o),oh=r(M,`):
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If `),Sa=i(M,"CODE",{});var wv=l(Sa);nh=r(wv,"past_key_values"),wv.forEach(o),sh=r(M," are used, the user can optionally input only the last "),Na=i(M,"CODE",{});var Tv=l(Na);rh=r(Tv,"decoder_input_ids"),Tv.forEach(o),ah=r(M,` (those that
don\u2019t have their past key value states given to this model) of shape `),Da=i(M,"CODE",{});var yv=l(Da);ih=r(yv,"(batch_size, 1)"),yv.forEach(o),lh=r(M,` instead of all
`),La=i(M,"CODE",{});var xv=l(La);dh=r(xv,"decoder_input_ids"),xv.forEach(o),ph=r(M," of shape "),Va=i(M,"CODE",{});var Bv=l(Va);ch=r(Bv,"(batch_size, sequence_length)"),Bv.forEach(o),mh=r(M,`.
use_cache (`),Wa=i(M,"CODE",{});var kv=l(Wa);hh=r(kv,"bool"),kv.forEach(o),fh=r(M,", "),Ra=i(M,"EM",{});var Pv=l(Ra);gh=r(Pv,"optional"),Pv.forEach(o),uh=r(M,`):
If set to `),Ga=i(M,"CODE",{});var Fv=l(Ga);_h=r(Fv,"True"),Fv.forEach(o),vh=r(M,", "),Qa=i(M,"CODE",{});var Ev=l(Qa);bh=r(Ev,"past_key_values"),Ev.forEach(o),$h=r(M,` key value states are returned and can be used to speed up decoding (see
`),Ha=i(M,"CODE",{});var Mv=l(Ha);wh=r(Mv,"past_key_values"),Mv.forEach(o),Th=r(M,")."),M.forEach(o),dd.forEach(o),qr.forEach(o),Ir.forEach(o),Pl=f(t),Ke=i(t,"H2",{class:!0});var cd=l(Ke);Gt=i(cd,"A",{id:!0,class:!0,href:!0});var jv=l(Gt);Ua=i(jv,"SPAN",{});var Iv=l(Ua);w(kn.$$.fragment,Iv),Iv.forEach(o),jv.forEach(o),yh=f(cd),Ja=i(cd,"SPAN",{});var qv=l(Ja);xh=r(qv,"BlipVisionModel"),qv.forEach(o),cd.forEach(o),Fl=f(t),Xe=i(t,"DIV",{class:!0});var md=l(Xe);w(Pn.$$.fragment,md),Bh=f(md),we=i(md,"DIV",{class:!0});var Cr=l(we);w(Fn.$$.fragment,Cr),kh=f(Cr),Ye=i(Cr,"P",{});var Ar=l(Ye);Ph=r(Ar,"The "),rr=i(Ar,"A",{href:!0});var Cv=l(rr);Fh=r(Cv,"BlipVisionModel"),Cv.forEach(o),Eh=r(Ar," forward method, overrides the "),Ka=i(Ar,"CODE",{});var Av=l(Ka);Mh=r(Av,"__call__"),Av.forEach(o),jh=r(Ar," special method."),Ar.forEach(o),Ih=f(Cr),w(Qt.$$.fragment,Cr),Cr.forEach(o),md.forEach(o),El=f(t),Ze=i(t,"H2",{class:!0});var hd=l(Ze);Ht=i(hd,"A",{id:!0,class:!0,href:!0});var zv=l(Ht);Xa=i(zv,"SPAN",{});var Ov=l(Xa);w(En.$$.fragment,Ov),Ov.forEach(o),zv.forEach(o),qh=f(hd),Ya=i(hd,"SPAN",{});var Sv=l(Ya);Ch=r(Sv,"BlipForConditionalGeneration"),Sv.forEach(o),hd.forEach(o),Ml=f(t),z=i(t,"DIV",{class:!0});var Pe=l(z);w(Mn.$$.fragment,Pe),Ah=f(Pe),jn=i(Pe,"P",{});var fd=l(jn);zh=r(fd,`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
`),Za=i(fd,"CODE",{});var Nv=l(Za);Oh=r(Nv,"input_ids"),Nv.forEach(o),Sh=r(fd,` 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.`),fd.forEach(o),Nh=f(Pe),In=i(Pe,"P",{});var gd=l(In);Dh=r(gd,"This model inherits from "),ar=i(gd,"A",{href:!0});var Dv=l(ar);Lh=r(Dv,"PreTrainedModel"),Dv.forEach(o),Vh=r(gd,`. 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.)`),gd.forEach(o),Wh=f(Pe),qn=i(Pe,"P",{});var ud=l(qn);Rh=r(ud,"This model is also a PyTorch "),Cn=i(ud,"A",{href:!0,rel:!0});var Lv=l(Cn);Gh=r(Lv,"torch.nn.Module"),Lv.forEach(o),Qh=r(ud,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ud.forEach(o),Hh=f(Pe),te=i(Pe,"DIV",{class:!0});var Eo=l(te);w(An.$$.fragment,Eo),Uh=f(Eo),et=i(Eo,"P",{});var zr=l(et);Jh=r(zr,"The "),ir=i(zr,"A",{href:!0});var Vv=l(ir);Kh=r(Vv,"BlipForConditionalGeneration"),Vv.forEach(o),Xh=r(zr," forward method, overrides the "),ei=i(zr,"CODE",{});var Wv=l(ei);Yh=r(Wv,"__call__"),Wv.forEach(o),Zh=r(zr," special method."),zr.forEach(o),ef=f(Eo),w(Ut.$$.fragment,Eo),tf=f(Eo),w(Jt.$$.fragment,Eo),Eo.forEach(o),Pe.forEach(o),jl=f(t),tt=i(t,"H2",{class:!0});var _d=l(tt);Kt=i(_d,"A",{id:!0,class:!0,href:!0});var Rv=l(Kt);ti=i(Rv,"SPAN",{});var Gv=l(ti);w(zn.$$.fragment,Gv),Gv.forEach(o),Rv.forEach(o),of=f(_d),oi=i(_d,"SPAN",{});var Qv=l(oi);nf=r(Qv,"BlipForImageTextRetrieval"),Qv.forEach(o),_d.forEach(o),Il=f(t),O=i(t,"DIV",{class:!0});var Fe=l(O);w(On.$$.fragment,Fe),sf=f(Fe),ni=i(Fe,"P",{});var Hv=l(ni);rf=r(Hv,`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.`),Hv.forEach(o),af=f(Fe),Sn=i(Fe,"P",{});var vd=l(Sn);lf=r(vd,"This model inherits from "),lr=i(vd,"A",{href:!0});var Uv=l(lr);df=r(Uv,"PreTrainedModel"),Uv.forEach(o),pf=r(vd,`. 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.)`),vd.forEach(o),cf=f(Fe),Nn=i(Fe,"P",{});var bd=l(Nn);mf=r(bd,"This model is also a PyTorch "),Dn=i(bd,"A",{href:!0,rel:!0});var Jv=l(Dn);hf=r(Jv,"torch.nn.Module"),Jv.forEach(o),ff=r(bd,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bd.forEach(o),gf=f(Fe),oe=i(Fe,"DIV",{class:!0});var Mo=l(oe);w(Ln.$$.fragment,Mo),uf=f(Mo),ot=i(Mo,"P",{});var Or=l(ot);_f=r(Or,"The "),dr=i(Or,"A",{href:!0});var Kv=l(dr);vf=r(Kv,"BlipForImageTextRetrieval"),Kv.forEach(o),bf=r(Or," forward method, overrides the "),si=i(Or,"CODE",{});var Xv=l(si);$f=r(Xv,"__call__"),Xv.forEach(o),wf=r(Or," special method."),Or.forEach(o),Tf=f(Mo),w(Xt.$$.fragment,Mo),yf=f(Mo),w(Yt.$$.fragment,Mo),Mo.forEach(o),Fe.forEach(o),ql=f(t),nt=i(t,"H2",{class:!0});var $d=l(nt);Zt=i($d,"A",{id:!0,class:!0,href:!0});var Yv=l(Zt);ri=i(Yv,"SPAN",{});var Zv=l(ri);w(Vn.$$.fragment,Zv),Zv.forEach(o),Yv.forEach(o),xf=f($d),ai=i($d,"SPAN",{});var eb=l(ai);Bf=r(eb,"BlipForQuestionAnswering"),eb.forEach(o),$d.forEach(o),Cl=f(t),S=i(t,"DIV",{class:!0});var Ee=l(S);w(Wn.$$.fragment,Ee),kf=f(Ee),ii=i(Ee,"P",{});var tb=l(ii);Pf=r(tb,`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.`),tb.forEach(o),Ff=f(Ee),Rn=i(Ee,"P",{});var wd=l(Rn);Ef=r(wd,"This model inherits from "),pr=i(wd,"A",{href:!0});var ob=l(pr);Mf=r(ob,"PreTrainedModel"),ob.forEach(o),jf=r(wd,`. 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.)`),wd.forEach(o),If=f(Ee),Gn=i(Ee,"P",{});var Td=l(Gn);qf=r(Td,"This model is also a PyTorch "),Qn=i(Td,"A",{href:!0,rel:!0});var nb=l(Qn);Cf=r(nb,"torch.nn.Module"),nb.forEach(o),Af=r(Td,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Td.forEach(o),zf=f(Ee),ne=i(Ee,"DIV",{class:!0});var jo=l(ne);w(Hn.$$.fragment,jo),Of=f(jo),st=i(jo,"P",{});var Sr=l(st);Sf=r(Sr,"The "),cr=i(Sr,"A",{href:!0});var sb=l(cr);Nf=r(sb,"BlipForQuestionAnswering"),sb.forEach(o),Df=r(Sr," forward method, overrides the "),li=i(Sr,"CODE",{});var rb=l(li);Lf=r(rb,"__call__"),rb.forEach(o),Vf=r(Sr," special method."),Sr.forEach(o),Wf=f(jo),w(eo.$$.fragment,jo),Rf=f(jo),w(to.$$.fragment,jo),jo.forEach(o),Ee.forEach(o),Al=f(t),rt=i(t,"H2",{class:!0});var yd=l(rt);oo=i(yd,"A",{id:!0,class:!0,href:!0});var ab=l(oo);di=i(ab,"SPAN",{});var ib=l(di);w(Un.$$.fragment,ib),ib.forEach(o),ab.forEach(o),Gf=f(yd),pi=i(yd,"SPAN",{});var lb=l(pi);Qf=r(lb,"TFBlipModel"),lb.forEach(o),yd.forEach(o),zl=f(t),K=i(t,"DIV",{class:!0});var Io=l(K);w(Jn.$$.fragment,Io),Hf=f(Io),se=i(Io,"DIV",{class:!0});var qo=l(se);w(Kn.$$.fragment,qo),Uf=f(qo),at=i(qo,"P",{});var Nr=l(at);Jf=r(Nr,"The "),mr=i(Nr,"A",{href:!0});var db=l(mr);Kf=r(db,"TFBlipModel"),db.forEach(o),Xf=r(Nr," forward method, overrides the "),ci=i(Nr,"CODE",{});var pb=l(ci);Yf=r(pb,"__call__"),pb.forEach(o),Zf=r(Nr," special method."),Nr.forEach(o),eg=f(qo),w(no.$$.fragment,qo),tg=f(qo),w(so.$$.fragment,qo),qo.forEach(o),og=f(Io),re=i(Io,"DIV",{class:!0});var Co=l(re);w(Xn.$$.fragment,Co),ng=f(Co),it=i(Co,"P",{});var Dr=l(it);sg=r(Dr,"The "),hr=i(Dr,"A",{href:!0});var cb=l(hr);rg=r(cb,"TFBlipModel"),cb.forEach(o),ag=r(Dr," forward method, overrides the "),mi=i(Dr,"CODE",{});var mb=l(mi);ig=r(mb,"__call__"),mb.forEach(o),lg=r(Dr," special method."),Dr.forEach(o),dg=f(Co),w(ro.$$.fragment,Co),pg=f(Co),w(ao.$$.fragment,Co),Co.forEach(o),cg=f(Io),ae=i(Io,"DIV",{class:!0});var Ao=l(ae);w(Yn.$$.fragment,Ao),mg=f(Ao),lt=i(Ao,"P",{});var Lr=l(lt);hg=r(Lr,"The "),fr=i(Lr,"A",{href:!0});var hb=l(fr);fg=r(hb,"TFBlipModel"),hb.forEach(o),gg=r(Lr," forward method, overrides the "),hi=i(Lr,"CODE",{});var fb=l(hi);ug=r(fb,"__call__"),fb.forEach(o),_g=r(Lr," special method."),Lr.forEach(o),vg=f(Ao),w(io.$$.fragment,Ao),bg=f(Ao),w(lo.$$.fragment,Ao),Ao.forEach(o),Io.forEach(o),Ol=f(t),dt=i(t,"H2",{class:!0});var xd=l(dt);po=i(xd,"A",{id:!0,class:!0,href:!0});var gb=l(po);fi=i(gb,"SPAN",{});var ub=l(fi);w(Zn.$$.fragment,ub),ub.forEach(o),gb.forEach(o),$g=f(xd),gi=i(xd,"SPAN",{});var _b=l(gi);wg=r(_b,"TFBlipTextModel"),_b.forEach(o),xd.forEach(o),Sl=f(t),ge=i(t,"DIV",{class:!0});var Vr=l(ge);w(es.$$.fragment,Vr),Tg=f(Vr),X=i(Vr,"P",{});var Me=l(X);yg=r(Me,`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 `),ts=i(Me,"A",{href:!0,rel:!0});var vb=l(ts);xg=r(vb,`Attention is
all you need`),vb.forEach(o),Bg=r(Me,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin. argument and `),ui=i(Me,"CODE",{});var bb=l(ui);kg=r(bb,"is_decoder"),bb.forEach(o),Pg=r(Me," set to "),_i=i(Me,"CODE",{});var $b=l(_i);Fg=r($b,"True"),$b.forEach(o),Eg=r(Me,`; an
`),vi=i(Me,"CODE",{});var wb=l(vi);Mg=r(wb,"encoder_hidden_states"),wb.forEach(o),jg=r(Me," is then expected as an input to the forward pass."),Me.forEach(o),Ig=f(Vr),Te=i(Vr,"DIV",{class:!0});var Wr=l(Te);w(os.$$.fragment,Wr),qg=f(Wr),pt=i(Wr,"P",{});var Rr=l(pt);Cg=r(Rr,"The "),gr=i(Rr,"A",{href:!0});var Tb=l(gr);Ag=r(Tb,"TFBlipTextModel"),Tb.forEach(o),zg=r(Rr," forward method, overrides the "),bi=i(Rr,"CODE",{});var yb=l(bi);Og=r(yb,"__call__"),yb.forEach(o),Sg=r(Rr," special method."),Rr.forEach(o),Ng=f(Wr),w(co.$$.fragment,Wr),Wr.forEach(o),Vr.forEach(o),Nl=f(t),ct=i(t,"H2",{class:!0});var Bd=l(ct);mo=i(Bd,"A",{id:!0,class:!0,href:!0});var xb=l(mo);$i=i(xb,"SPAN",{});var Bb=l($i);w(ns.$$.fragment,Bb),Bb.forEach(o),xb.forEach(o),Dg=f(Bd),wi=i(Bd,"SPAN",{});var kb=l(wi);Lg=r(kb,"TFBlipVisionModel"),kb.forEach(o),Bd.forEach(o),Dl=f(t),mt=i(t,"DIV",{class:!0});var kd=l(mt);w(ss.$$.fragment,kd),Vg=f(kd),ye=i(kd,"DIV",{class:!0});var Gr=l(ye);w(rs.$$.fragment,Gr),Wg=f(Gr),ht=i(Gr,"P",{});var Qr=l(ht);Rg=r(Qr,"The "),ur=i(Qr,"A",{href:!0});var Pb=l(ur);Gg=r(Pb,"TFBlipVisionModel"),Pb.forEach(o),Qg=r(Qr," forward method, overrides the "),Ti=i(Qr,"CODE",{});var Fb=l(Ti);Hg=r(Fb,"__call__"),Fb.forEach(o),Ug=r(Qr," special method."),Qr.forEach(o),Jg=f(Gr),w(ho.$$.fragment,Gr),Gr.forEach(o),kd.forEach(o),Ll=f(t),ft=i(t,"H2",{class:!0});var Pd=l(ft);fo=i(Pd,"A",{id:!0,class:!0,href:!0});var Eb=l(fo);yi=i(Eb,"SPAN",{});var Mb=l(yi);w(as.$$.fragment,Mb),Mb.forEach(o),Eb.forEach(o),Kg=f(Pd),xi=i(Pd,"SPAN",{});var jb=l(xi);Xg=r(jb,"TFBlipForConditionalGeneration"),jb.forEach(o),Pd.forEach(o),Vl=f(t),N=i(t,"DIV",{class:!0});var je=l(N);w(is.$$.fragment,je),Yg=f(je),ls=i(je,"P",{});var Fd=l(ls);Zg=r(Fd,`BLIP Model for image captioning. The model consists of a vision encoder and a text decoder. One can optionally pass
`),Bi=i(Fd,"CODE",{});var Ib=l(Bi);eu=r(Ib,"input_ids"),Ib.forEach(o),tu=r(Fd,` 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.`),Fd.forEach(o),ou=f(je),ds=i(je,"P",{});var Ed=l(ds);nu=r(Ed,"This model inherits from "),_r=i(Ed,"A",{href:!0});var qb=l(_r);su=r(qb,"TFPreTrainedModel"),qb.forEach(o),ru=r(Ed,`. 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.)`),Ed.forEach(o),au=f(je),ps=i(je,"P",{});var Md=l(ps);iu=r(Md,"This model is also a "),cs=i(Md,"A",{href:!0,rel:!0});var Cb=l(cs);lu=r(Cb,"tf.keras.Model"),Cb.forEach(o),du=r(Md,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Md.forEach(o),pu=f(je),ie=i(je,"DIV",{class:!0});var zo=l(ie);w(ms.$$.fragment,zo),cu=f(zo),gt=i(zo,"P",{});var Hr=l(gt);mu=r(Hr,"The "),vr=i(Hr,"A",{href:!0});var Ab=l(vr);hu=r(Ab,"TFBlipForConditionalGeneration"),Ab.forEach(o),fu=r(Hr," forward method, overrides the "),ki=i(Hr,"CODE",{});var zb=l(ki);gu=r(zb,"__call__"),zb.forEach(o),uu=r(Hr," special method."),Hr.forEach(o),_u=f(zo),w(go.$$.fragment,zo),vu=f(zo),w(uo.$$.fragment,zo),zo.forEach(o),je.forEach(o),Wl=f(t),ut=i(t,"H2",{class:!0});var jd=l(ut);_o=i(jd,"A",{id:!0,class:!0,href:!0});var Ob=l(_o);Pi=i(Ob,"SPAN",{});var Sb=l(Pi);w(hs.$$.fragment,Sb),Sb.forEach(o),Ob.forEach(o),bu=f(jd),Fi=i(jd,"SPAN",{});var Nb=l(Fi);$u=r(Nb,"TFBlipForImageTextRetrieval"),Nb.forEach(o),jd.forEach(o),Rl=f(t),D=i(t,"DIV",{class:!0});var Ie=l(D);w(fs.$$.fragment,Ie),wu=f(Ie),Ei=i(Ie,"P",{});var Db=l(Ei);Tu=r(Db,`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.`),Db.forEach(o),yu=f(Ie),gs=i(Ie,"P",{});var Id=l(gs);xu=r(Id,"This model inherits from "),br=i(Id,"A",{href:!0});var Lb=l(br);Bu=r(Lb,"TFPreTrainedModel"),Lb.forEach(o),ku=r(Id,`. 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.)`),Id.forEach(o),Pu=f(Ie),us=i(Ie,"P",{});var qd=l(us);Fu=r(qd,"This model is also a "),_s=i(qd,"A",{href:!0,rel:!0});var Vb=l(_s);Eu=r(Vb,"tf.keras.Model"),Vb.forEach(o),Mu=r(qd,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),qd.forEach(o),ju=f(Ie),le=i(Ie,"DIV",{class:!0});var Oo=l(le);w(vs.$$.fragment,Oo),Iu=f(Oo),_t=i(Oo,"P",{});var Ur=l(_t);qu=r(Ur,"The "),$r=i(Ur,"A",{href:!0});var Wb=l($r);Cu=r(Wb,"TFBlipForImageTextRetrieval"),Wb.forEach(o),Au=r(Ur," forward method, overrides the "),Mi=i(Ur,"CODE",{});var Rb=l(Mi);zu=r(Rb,"__call__"),Rb.forEach(o),Ou=r(Ur," special method."),Ur.forEach(o),Su=f(Oo),w(vo.$$.fragment,Oo),Nu=f(Oo),w(bo.$$.fragment,Oo),Oo.forEach(o),Ie.forEach(o),Gl=f(t),vt=i(t,"H2",{class:!0});var Cd=l(vt);$o=i(Cd,"A",{id:!0,class:!0,href:!0});var Gb=l($o);ji=i(Gb,"SPAN",{});var Qb=l(ji);w(bs.$$.fragment,Qb),Qb.forEach(o),Gb.forEach(o),Du=f(Cd),Ii=i(Cd,"SPAN",{});var Hb=l(Ii);Lu=r(Hb,"TFBlipForQuestionAnswering"),Hb.forEach(o),Cd.forEach(o),Ql=f(t),L=i(t,"DIV",{class:!0});var qe=l(L);w($s.$$.fragment,qe),Vu=f(qe),qi=i(qe,"P",{});var Ub=l(qi);Wu=r(Ub,`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.`),Ub.forEach(o),Ru=f(qe),ws=i(qe,"P",{});var Ad=l(ws);Gu=r(Ad,"This model inherits from "),wr=i(Ad,"A",{href:!0});var Jb=l(wr);Qu=r(Jb,"TFPreTrainedModel"),Jb.forEach(o),Hu=r(Ad,`. 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.)`),Ad.forEach(o),Uu=f(qe),Ts=i(qe,"P",{});var zd=l(Ts);Ju=r(zd,"This model is also a "),ys=i(zd,"A",{href:!0,rel:!0});var Kb=l(ys);Ku=r(Kb,"tf.keras.Model"),Kb.forEach(o),Xu=r(zd,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),zd.forEach(o),Yu=f(qe),de=i(qe,"DIV",{class:!0});var So=l(de);w(xs.$$.fragment,So),Zu=f(So),bt=i(So,"P",{});var Jr=l(bt);e_=r(Jr,"The "),Tr=i(Jr,"A",{href:!0});var Xb=l(Tr);t_=r(Xb,"TFBlipForQuestionAnswering"),Xb.forEach(o),o_=r(Jr," forward method, overrides the "),Ci=i(Jr,"CODE",{});var Yb=l(Ci);n_=r(Yb,"__call__"),Yb.forEach(o),s_=r(Jr," special method."),Jr.forEach(o),r_=f(So),w(wo.$$.fragment,So),a_=f(So),w(To.$$.fragment,So),So.forEach(o),qe.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(z$)),c(m,"id","blip"),c(m,"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(m,"href","#blip"),c(g,"class","relative group"),c(Tt,"id","overview"),c(Tt,"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(Tt,"href","#overview"),c(Ce,"class","relative group"),c(Do,"href","https://arxiv.org/abs/2201.12086"),c(Do,"rel","nofollow"),n$(As.src,i_="https://s3.amazonaws.com/moonup/production/uploads/1670928184033-62441d1d9fdefb55a0b7d12c.gif")||c(As,"src",i_),c(As,"alt","BLIP.gif"),c(Lo,"href","https://huggingface.co/ybelkada"),c(Lo,"rel","nofollow"),c(Vo,"href","https://github.com/salesforce/BLIP"),c(Vo,"rel","nofollow"),c(xt,"id","resources"),c(xt,"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(xt,"href","#resources"),c(Ae,"class","relative group"),c(Ro,"href","https://github.com/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb"),c(Ro,"rel","nofollow"),c(Bt,"id","transformers.BlipConfig"),c(Bt,"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(Bt,"href","#transformers.BlipConfig"),c(ze,"class","relative group"),c(Ss,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipConfig"),c(Ns,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipModel"),c(Ho,"href","https://huggingface.co/Salesforce/blip-vqa-base"),c(Ho,"rel","nofollow"),c(Ds,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ls,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Vs,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipConfig"),c(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ft,"id","transformers.BlipTextConfig"),c(Ft,"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(Ft,"href","#transformers.BlipTextConfig"),c(Se,"class","relative group"),c(Ws,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipTextModel"),c(Yo,"href","https://huggingface.co/Salesforce/blip-vqa-base"),c(Yo,"rel","nofollow"),c(Rs,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Gs,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Mt,"id","transformers.BlipVisionConfig"),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.BlipVisionConfig"),c(De,"class","relative group"),c(Qs,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipVisionModel"),c(tn,"href","https://huggingface.co/Salesforce/blip-vqa-base"),c(tn,"rel","nofollow"),c(Hs,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Us,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(It,"id","transformers.BlipProcessor"),c(It,"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(It,"href","#transformers.BlipProcessor"),c(We,"class","relative group"),c(Js,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipProcessor"),c(Ks,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipImageProcessor"),c(Xs,"href","/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertTokenizerFast"),c(Ys,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipProcessor.decode"),c(Zs,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.batch_decode"),c(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(er,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.decode"),c(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(At,"id","transformers.BlipImageProcessor"),c(At,"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(At,"href","#transformers.BlipImageProcessor"),c(Re,"class","relative group"),c(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(Ge,"class","relative group"),c(tr,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(un,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(un,"rel","nofollow"),c(or,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipModel"),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(nr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipModel"),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(sr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipModel"),c(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Rt,"id","transformers.BlipTextModel"),c(Rt,"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(Rt,"href","#transformers.BlipTextModel"),c(Je,"class","relative group"),c(Tn,"href","https://arxiv.org/abs/1706.03762"),c(Tn,"rel","nofollow"),c($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Gt,"id","transformers.BlipVisionModel"),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.BlipVisionModel"),c(Ke,"class","relative group"),c(rr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipVisionModel"),c(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ht,"id","transformers.BlipForConditionalGeneration"),c(Ht,"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(Ht,"href","#transformers.BlipForConditionalGeneration"),c(Ze,"class","relative group"),c(ar,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Cn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Cn,"rel","nofollow"),c(ir,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipForConditionalGeneration"),c(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(Kt,"id","transformers.BlipForImageTextRetrieval"),c(Kt,"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(Kt,"href","#transformers.BlipForImageTextRetrieval"),c(tt,"class","relative group"),c(lr,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Dn,"rel","nofollow"),c(dr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipForImageTextRetrieval"),c(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Zt,"id","transformers.BlipForQuestionAnswering"),c(Zt,"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(Zt,"href","#transformers.BlipForQuestionAnswering"),c(nt,"class","relative group"),c(pr,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),c(Qn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Qn,"rel","nofollow"),c(cr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.BlipForQuestionAnswering"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(oo,"id","transformers.TFBlipModel"),c(oo,"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(oo,"href","#transformers.TFBlipModel"),c(rt,"class","relative group"),c(mr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipModel"),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(hr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipModel"),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(fr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipModel"),c(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(po,"id","transformers.TFBlipTextModel"),c(po,"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(po,"href","#transformers.TFBlipTextModel"),c(dt,"class","relative group"),c(ts,"href","https://arxiv.org/abs/1706.03762"),c(ts,"rel","nofollow"),c(gr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipTextModel"),c(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(mo,"id","transformers.TFBlipVisionModel"),c(mo,"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(mo,"href","#transformers.TFBlipVisionModel"),c(ct,"class","relative group"),c(ur,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipVisionModel"),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(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fo,"id","transformers.TFBlipForConditionalGeneration"),c(fo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(fo,"href","#transformers.TFBlipForConditionalGeneration"),c(ft,"class","relative group"),c(_r,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),c(cs,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(cs,"rel","nofollow"),c(vr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipForConditionalGeneration"),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(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_o,"id","transformers.TFBlipForImageTextRetrieval"),c(_o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_o,"href","#transformers.TFBlipForImageTextRetrieval"),c(ut,"class","relative group"),c(br,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),c(_s,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(_s,"rel","nofollow"),c($r,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipForImageTextRetrieval"),c(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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($o,"id","transformers.TFBlipForQuestionAnswering"),c($o,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c($o,"href","#transformers.TFBlipForQuestionAnswering"),c(vt,"class","relative group"),c(wr,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),c(ys,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(ys,"rel","nofollow"),c(Tr,"href","/docs/transformers/v4.29.0/en/model_doc/blip#transformers.TFBlipForQuestionAnswering"),c(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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,u){e(document.head,d),v(t,b,u),v(t,g,u),e(g,m),e(m,_),T(n,_,null),e(g,p),e(g,P),e(P,Od),v(t,nl,u),v(t,Ce,u),e(Ce,Tt),e(Tt,Kr),T(No,Kr,null),e(Ce,Sd),e(Ce,Xr),e(Xr,Nd),v(t,sl,u),v(t,yt,u),e(yt,Dd),e(yt,Do),e(Do,Ld),e(yt,Vd),v(t,rl,u),v(t,js,u),e(js,Wd),v(t,al,u),v(t,_e,u),e(_e,Yr),e(Yr,Rd),e(_e,Gd),e(_e,Zr),e(Zr,Qd),e(_e,Hd),e(_e,ea),e(ea,Ud),v(t,il,u),v(t,Is,u),e(Is,Jd),v(t,ll,u),v(t,qs,u),e(qs,ta),e(ta,Kd),v(t,dl,u),v(t,Cs,u),e(Cs,As),v(t,pl,u),v(t,ve,u),e(ve,Xd),e(ve,Lo),e(Lo,Yd),e(ve,Zd),e(ve,Vo),e(Vo,ep),e(ve,tp),v(t,cl,u),v(t,Ae,u),e(Ae,xt),e(xt,oa),T(Wo,oa,null),e(Ae,op),e(Ae,na),e(na,np),v(t,ml,u),v(t,zs,u),e(zs,Os),e(Os,Ro),e(Ro,sp),e(Os,rp),v(t,hl,u),v(t,ze,u),e(ze,Bt),e(Bt,sa),T(Go,sa,null),e(ze,ap),e(ze,ra),e(ra,ip),v(t,fl,u),v(t,q,u),T(Qo,q,null),e(q,lp),e(q,be),e(be,Ss),e(Ss,dp),e(be,pp),e(be,Ns),e(Ns,cp),e(be,mp),e(be,Ho),e(Ho,hp),e(be,fp),e(q,gp),e(q,Oe),e(Oe,up),e(Oe,Ds),e(Ds,_p),e(Oe,vp),e(Oe,Ls),e(Ls,bp),e(Oe,$p),e(q,wp),T(kt,q,null),e(q,Tp),e(q,Pt),T(Uo,Pt,null),e(Pt,yp),e(Pt,Jo),e(Jo,xp),e(Jo,Vs),e(Vs,Bp),e(Jo,kp),v(t,gl,u),v(t,Se,u),e(Se,Ft),e(Ft,aa),T(Ko,aa,null),e(Se,Pp),e(Se,ia),e(ia,Fp),v(t,ul,u),v(t,H,u),T(Xo,H,null),e(H,Ep),e(H,me),e(me,Mp),e(me,Ws),e(Ws,jp),e(me,Ip),e(me,la),e(la,qp),e(me,Cp),e(me,Yo),e(Yo,Ap),e(me,zp),e(H,Op),e(H,Ne),e(Ne,Sp),e(Ne,Rs),e(Rs,Np),e(Ne,Dp),e(Ne,Gs),e(Gs,Lp),e(Ne,Vp),e(H,Wp),T(Et,H,null),v(t,_l,u),v(t,De,u),e(De,Mt),e(Mt,da),T(Zo,da,null),e(De,Rp),e(De,pa),e(pa,Gp),v(t,vl,u),v(t,U,u),T(en,U,null),e(U,Qp),e(U,Le),e(Le,Hp),e(Le,Qs),e(Qs,Up),e(Le,Jp),e(Le,tn),e(tn,Kp),e(Le,Xp),e(U,Yp),e(U,Ve),e(Ve,Zp),e(Ve,Hs),e(Hs,ec),e(Ve,tc),e(Ve,Us),e(Us,oc),e(Ve,nc),e(U,sc),T(jt,U,null),v(t,bl,u),v(t,We,u),e(We,It),e(It,ca),T(on,ca,null),e(We,rc),e(We,ma),e(ma,ac),v(t,$l,u),v(t,C,u),T(nn,C,null),e(C,ic),e(C,ha),e(ha,lc),e(C,dc),e(C,Q),e(Q,Js),e(Js,pc),e(Q,cc),e(Q,Ks),e(Ks,mc),e(Q,hc),e(Q,Xs),e(Xs,fc),e(Q,gc),e(Q,fa),e(fa,uc),e(Q,_c),e(Q,Ys),e(Ys,vc),e(Q,bc),e(C,$c),e(C,qt),T(sn,qt,null),e(qt,wc),e(qt,rn),e(rn,Tc),e(rn,Zs),e(Zs,yc),e(rn,xc),e(C,Bc),e(C,Ct),T(an,Ct,null),e(Ct,kc),e(Ct,ln),e(ln,Pc),e(ln,er),e(er,Fc),e(ln,Ec),v(t,wl,u),v(t,Re,u),e(Re,At),e(At,ga),T(dn,ga,null),e(Re,Mc),e(Re,ua),e(ua,jc),v(t,Tl,u),v(t,he,u),T(pn,he,null),e(he,Ic),e(he,_a),e(_a,qc),e(he,Cc),e(he,zt),T(cn,zt,null),e(zt,Ac),e(zt,va),e(va,zc),v(t,yl,u),v(t,Ge,u),e(Ge,Ot),e(Ot,ba),T(mn,ba,null),e(Ge,Oc),e(Ge,$a),e($a,Sc),v(t,xl,u),v(t,I,u),T(hn,I,null),e(I,Nc),e(I,fn),e(fn,Dc),e(fn,tr),e(tr,Lc),e(fn,Vc),e(I,Wc),e(I,gn),e(gn,Rc),e(gn,un),e(un,Gc),e(gn,Qc),e(I,Hc),e(I,Y),T(_n,Y,null),e(Y,Uc),e(Y,Qe),e(Qe,Jc),e(Qe,or),e(or,Kc),e(Qe,Xc),e(Qe,wa),e(wa,Yc),e(Qe,Zc),e(Y,em),T(St,Y,null),e(Y,tm),T(Nt,Y,null),e(I,om),e(I,Z),T(vn,Z,null),e(Z,nm),e(Z,He),e(He,sm),e(He,nr),e(nr,rm),e(He,am),e(He,Ta),e(Ta,im),e(He,lm),e(Z,dm),T(Dt,Z,null),e(Z,pm),T(Lt,Z,null),e(I,cm),e(I,ee),T(bn,ee,null),e(ee,mm),e(ee,Ue),e(Ue,hm),e(Ue,sr),e(sr,fm),e(Ue,gm),e(Ue,ya),e(ya,um),e(Ue,_m),e(ee,vm),T(Vt,ee,null),e(ee,bm),T(Wt,ee,null),v(t,Bl,u),v(t,Je,u),e(Je,Rt),e(Rt,xa),T($n,xa,null),e(Je,$m),e(Je,Ba),e(Ba,wm),v(t,kl,u),v(t,fe,u),T(wn,fe,null),e(fe,Tm),e(fe,J),e(J,ym),e(J,Tn),e(Tn,xm),e(J,Bm),e(J,ka),e(ka,km),e(J,Pm),e(J,Pa),e(Pa,Fm),e(J,Em),e(J,Fa),e(Fa,Mm),e(J,jm),e(fe,Im),e(fe,$e),T(yn,$e,null),e($e,qm),e($e,A),e(A,Cm),e(A,Ea),e(Ea,Am),e(A,zm),e(A,Ma),e(Ma,Om),e(A,Sm),e(A,ja),e(ja,Nm),e(A,Dm),e(A,Ia),e(Ia,Lm),e(A,Vm),e(A,qa),e(qa,Wm),e(A,Rm),e($e,Gm),e($e,xn),e(xn,Bn),e(Bn,Qm),e(Bn,Ca),e(Ca,Hm),e(Bn,Um),e(xn,Jm),e(xn,E),e(E,Km),e(E,Aa),e(Aa,Xm),e(E,Ym),e(E,za),e(za,Zm),e(E,eh),e(E,Oa),e(Oa,th),e(E,oh),e(E,Sa),e(Sa,nh),e(E,sh),e(E,Na),e(Na,rh),e(E,ah),e(E,Da),e(Da,ih),e(E,lh),e(E,La),e(La,dh),e(E,ph),e(E,Va),e(Va,ch),e(E,mh),e(E,Wa),e(Wa,hh),e(E,fh),e(E,Ra),e(Ra,gh),e(E,uh),e(E,Ga),e(Ga,_h),e(E,vh),e(E,Qa),e(Qa,bh),e(E,$h),e(E,Ha),e(Ha,wh),e(E,Th),v(t,Pl,u),v(t,Ke,u),e(Ke,Gt),e(Gt,Ua),T(kn,Ua,null),e(Ke,yh),e(Ke,Ja),e(Ja,xh),v(t,Fl,u),v(t,Xe,u),T(Pn,Xe,null),e(Xe,Bh),e(Xe,we),T(Fn,we,null),e(we,kh),e(we,Ye),e(Ye,Ph),e(Ye,rr),e(rr,Fh),e(Ye,Eh),e(Ye,Ka),e(Ka,Mh),e(Ye,jh),e(we,Ih),T(Qt,we,null),v(t,El,u),v(t,Ze,u),e(Ze,Ht),e(Ht,Xa),T(En,Xa,null),e(Ze,qh),e(Ze,Ya),e(Ya,Ch),v(t,Ml,u),v(t,z,u),T(Mn,z,null),e(z,Ah),e(z,jn),e(jn,zh),e(jn,Za),e(Za,Oh),e(jn,Sh),e(z,Nh),e(z,In),e(In,Dh),e(In,ar),e(ar,Lh),e(In,Vh),e(z,Wh),e(z,qn),e(qn,Rh),e(qn,Cn),e(Cn,Gh),e(qn,Qh),e(z,Hh),e(z,te),T(An,te,null),e(te,Uh),e(te,et),e(et,Jh),e(et,ir),e(ir,Kh),e(et,Xh),e(et,ei),e(ei,Yh),e(et,Zh),e(te,ef),T(Ut,te,null),e(te,tf),T(Jt,te,null),v(t,jl,u),v(t,tt,u),e(tt,Kt),e(Kt,ti),T(zn,ti,null),e(tt,of),e(tt,oi),e(oi,nf),v(t,Il,u),v(t,O,u),T(On,O,null),e(O,sf),e(O,ni),e(ni,rf),e(O,af),e(O,Sn),e(Sn,lf),e(Sn,lr),e(lr,df),e(Sn,pf),e(O,cf),e(O,Nn),e(Nn,mf),e(Nn,Dn),e(Dn,hf),e(Nn,ff),e(O,gf),e(O,oe),T(Ln,oe,null),e(oe,uf),e(oe,ot),e(ot,_f),e(ot,dr),e(dr,vf),e(ot,bf),e(ot,si),e(si,$f),e(ot,wf),e(oe,Tf),T(Xt,oe,null),e(oe,yf),T(Yt,oe,null),v(t,ql,u),v(t,nt,u),e(nt,Zt),e(Zt,ri),T(Vn,ri,null),e(nt,xf),e(nt,ai),e(ai,Bf),v(t,Cl,u),v(t,S,u),T(Wn,S,null),e(S,kf),e(S,ii),e(ii,Pf),e(S,Ff),e(S,Rn),e(Rn,Ef),e(Rn,pr),e(pr,Mf),e(Rn,jf),e(S,If),e(S,Gn),e(Gn,qf),e(Gn,Qn),e(Qn,Cf),e(Gn,Af),e(S,zf),e(S,ne),T(Hn,ne,null),e(ne,Of),e(ne,st),e(st,Sf),e(st,cr),e(cr,Nf),e(st,Df),e(st,li),e(li,Lf),e(st,Vf),e(ne,Wf),T(eo,ne,null),e(ne,Rf),T(to,ne,null),v(t,Al,u),v(t,rt,u),e(rt,oo),e(oo,di),T(Un,di,null),e(rt,Gf),e(rt,pi),e(pi,Qf),v(t,zl,u),v(t,K,u),T(Jn,K,null),e(K,Hf),e(K,se),T(Kn,se,null),e(se,Uf),e(se,at),e(at,Jf),e(at,mr),e(mr,Kf),e(at,Xf),e(at,ci),e(ci,Yf),e(at,Zf),e(se,eg),T(no,se,null),e(se,tg),T(so,se,null),e(K,og),e(K,re),T(Xn,re,null),e(re,ng),e(re,it),e(it,sg),e(it,hr),e(hr,rg),e(it,ag),e(it,mi),e(mi,ig),e(it,lg),e(re,dg),T(ro,re,null),e(re,pg),T(ao,re,null),e(K,cg),e(K,ae),T(Yn,ae,null),e(ae,mg),e(ae,lt),e(lt,hg),e(lt,fr),e(fr,fg),e(lt,gg),e(lt,hi),e(hi,ug),e(lt,_g),e(ae,vg),T(io,ae,null),e(ae,bg),T(lo,ae,null),v(t,Ol,u),v(t,dt,u),e(dt,po),e(po,fi),T(Zn,fi,null),e(dt,$g),e(dt,gi),e(gi,wg),v(t,Sl,u),v(t,ge,u),T(es,ge,null),e(ge,Tg),e(ge,X),e(X,yg),e(X,ts),e(ts,xg),e(X,Bg),e(X,ui),e(ui,kg),e(X,Pg),e(X,_i),e(_i,Fg),e(X,Eg),e(X,vi),e(vi,Mg),e(X,jg),e(ge,Ig),e(ge,Te),T(os,Te,null),e(Te,qg),e(Te,pt),e(pt,Cg),e(pt,gr),e(gr,Ag),e(pt,zg),e(pt,bi),e(bi,Og),e(pt,Sg),e(Te,Ng),T(co,Te,null),v(t,Nl,u),v(t,ct,u),e(ct,mo),e(mo,$i),T(ns,$i,null),e(ct,Dg),e(ct,wi),e(wi,Lg),v(t,Dl,u),v(t,mt,u),T(ss,mt,null),e(mt,Vg),e(mt,ye),T(rs,ye,null),e(ye,Wg),e(ye,ht),e(ht,Rg),e(ht,ur),e(ur,Gg),e(ht,Qg),e(ht,Ti),e(Ti,Hg),e(ht,Ug),e(ye,Jg),T(ho,ye,null),v(t,Ll,u),v(t,ft,u),e(ft,fo),e(fo,yi),T(as,yi,null),e(ft,Kg),e(ft,xi),e(xi,Xg),v(t,Vl,u),v(t,N,u),T(is,N,null),e(N,Yg),e(N,ls),e(ls,Zg),e(ls,Bi),e(Bi,eu),e(ls,tu),e(N,ou),e(N,ds),e(ds,nu),e(ds,_r),e(_r,su),e(ds,ru),e(N,au),e(N,ps),e(ps,iu),e(ps,cs),e(cs,lu),e(ps,du),e(N,pu),e(N,ie),T(ms,ie,null),e(ie,cu),e(ie,gt),e(gt,mu),e(gt,vr),e(vr,hu),e(gt,fu),e(gt,ki),e(ki,gu),e(gt,uu),e(ie,_u),T(go,ie,null),e(ie,vu),T(uo,ie,null),v(t,Wl,u),v(t,ut,u),e(ut,_o),e(_o,Pi),T(hs,Pi,null),e(ut,bu),e(ut,Fi),e(Fi,$u),v(t,Rl,u),v(t,D,u),T(fs,D,null),e(D,wu),e(D,Ei),e(Ei,Tu),e(D,yu),e(D,gs),e(gs,xu),e(gs,br),e(br,Bu),e(gs,ku),e(D,Pu),e(D,us),e(us,Fu),e(us,_s),e(_s,Eu),e(us,Mu),e(D,ju),e(D,le),T(vs,le,null),e(le,Iu),e(le,_t),e(_t,qu),e(_t,$r),e($r,Cu),e(_t,Au),e(_t,Mi),e(Mi,zu),e(_t,Ou),e(le,Su),T(vo,le,null),e(le,Nu),T(bo,le,null),v(t,Gl,u),v(t,vt,u),e(vt,$o),e($o,ji),T(bs,ji,null),e(vt,Du),e(vt,Ii),e(Ii,Lu),v(t,Ql,u),v(t,L,u),T($s,L,null),e(L,Vu),e(L,qi),e(qi,Wu),e(L,Ru),e(L,ws),e(ws,Gu),e(ws,wr),e(wr,Qu),e(ws,Hu),e(L,Uu),e(L,Ts),e(Ts,Ju),e(Ts,ys),e(ys,Ku),e(Ts,Xu),e(L,Yu),e(L,de),T(xs,de,null),e(de,Zu),e(de,bt),e(bt,e_),e(bt,Tr),e(Tr,t_),e(bt,o_),e(bt,Ci),e(Ci,n_),e(bt,s_),e(de,r_),T(wo,de,null),e(de,a_),T(To,de,null),Hl=!0},p(t,[u]){const Bs={};u&2&&(Bs.$$scope={dirty:u,ctx:t}),kt.$set(Bs);const Ai={};u&2&&(Ai.$$scope={dirty:u,ctx:t}),Et.$set(Ai);const zi={};u&2&&(zi.$$scope={dirty:u,ctx:t}),jt.$set(zi);const Oi={};u&2&&(Oi.$$scope={dirty:u,ctx:t}),St.$set(Oi);const ks={};u&2&&(ks.$$scope={dirty:u,ctx:t}),Nt.$set(ks);const Si={};u&2&&(Si.$$scope={dirty:u,ctx:t}),Dt.$set(Si);const Ni={};u&2&&(Ni.$$scope={dirty:u,ctx:t}),Lt.$set(Ni);const Di={};u&2&&(Di.$$scope={dirty:u,ctx:t}),Vt.$set(Di);const Ps={};u&2&&(Ps.$$scope={dirty:u,ctx:t}),Wt.$set(Ps);const Li={};u&2&&(Li.$$scope={dirty:u,ctx:t}),Qt.$set(Li);const Vi={};u&2&&(Vi.$$scope={dirty:u,ctx:t}),Ut.$set(Vi);const $t={};u&2&&($t.$$scope={dirty:u,ctx:t}),Jt.$set($t);const Wi={};u&2&&(Wi.$$scope={dirty:u,ctx:t}),Xt.$set(Wi);const Ri={};u&2&&(Ri.$$scope={dirty:u,ctx:t}),Yt.$set(Ri);const Gi={};u&2&&(Gi.$$scope={dirty:u,ctx:t}),eo.$set(Gi);const Qi={};u&2&&(Qi.$$scope={dirty:u,ctx:t}),to.$set(Qi);const Hi={};u&2&&(Hi.$$scope={dirty:u,ctx:t}),no.$set(Hi);const Ui={};u&2&&(Ui.$$scope={dirty:u,ctx:t}),so.$set(Ui);const Ji={};u&2&&(Ji.$$scope={dirty:u,ctx:t}),ro.$set(Ji);const wt={};u&2&&(wt.$$scope={dirty:u,ctx:t}),ao.$set(wt);const Ki={};u&2&&(Ki.$$scope={dirty:u,ctx:t}),io.$set(Ki);const Xi={};u&2&&(Xi.$$scope={dirty:u,ctx:t}),lo.$set(Xi);const Fs={};u&2&&(Fs.$$scope={dirty:u,ctx:t}),co.$set(Fs);const Yi={};u&2&&(Yi.$$scope={dirty:u,ctx:t}),ho.$set(Yi);const Zi={};u&2&&(Zi.$$scope={dirty:u,ctx:t}),go.$set(Zi);const el={};u&2&&(el.$$scope={dirty:u,ctx:t}),uo.$set(el);const tl={};u&2&&(tl.$$scope={dirty:u,ctx:t}),vo.$set(tl);const yr={};u&2&&(yr.$$scope={dirty:u,ctx:t}),bo.$set(yr);const ol={};u&2&&(ol.$$scope={dirty:u,ctx:t}),wo.$set(ol);const Es={};u&2&&(Es.$$scope={dirty:u,ctx:t}),To.$set(Es)},i(t){Hl||(y(n.$$.fragment,t),y(No.$$.fragment,t),y(Wo.$$.fragment,t),y(Go.$$.fragment,t),y(Qo.$$.fragment,t),y(kt.$$.fragment,t),y(Uo.$$.fragment,t),y(Ko.$$.fragment,t),y(Xo.$$.fragment,t),y(Et.$$.fragment,t),y(Zo.$$.fragment,t),y(en.$$.fragment,t),y(jt.$$.fragment,t),y(on.$$.fragment,t),y(nn.$$.fragment,t),y(sn.$$.fragment,t),y(an.$$.fragment,t),y(dn.$$.fragment,t),y(pn.$$.fragment,t),y(cn.$$.fragment,t),y(mn.$$.fragment,t),y(hn.$$.fragment,t),y(_n.$$.fragment,t),y(St.$$.fragment,t),y(Nt.$$.fragment,t),y(vn.$$.fragment,t),y(Dt.$$.fragment,t),y(Lt.$$.fragment,t),y(bn.$$.fragment,t),y(Vt.$$.fragment,t),y(Wt.$$.fragment,t),y($n.$$.fragment,t),y(wn.$$.fragment,t),y(yn.$$.fragment,t),y(kn.$$.fragment,t),y(Pn.$$.fragment,t),y(Fn.$$.fragment,t),y(Qt.$$.fragment,t),y(En.$$.fragment,t),y(Mn.$$.fragment,t),y(An.$$.fragment,t),y(Ut.$$.fragment,t),y(Jt.$$.fragment,t),y(zn.$$.fragment,t),y(On.$$.fragment,t),y(Ln.$$.fragment,t),y(Xt.$$.fragment,t),y(Yt.$$.fragment,t),y(Vn.$$.fragment,t),y(Wn.$$.fragment,t),y(Hn.$$.fragment,t),y(eo.$$.fragment,t),y(to.$$.fragment,t),y(Un.$$.fragment,t),y(Jn.$$.fragment,t),y(Kn.$$.fragment,t),y(no.$$.fragment,t),y(so.$$.fragment,t),y(Xn.$$.fragment,t),y(ro.$$.fragment,t),y(ao.$$.fragment,t),y(Yn.$$.fragment,t),y(io.$$.fragment,t),y(lo.$$.fragment,t),y(Zn.$$.fragment,t),y(es.$$.fragment,t),y(os.$$.fragment,t),y(co.$$.fragment,t),y(ns.$$.fragment,t),y(ss.$$.fragment,t),y(rs.$$.fragment,t),y(ho.$$.fragment,t),y(as.$$.fragment,t),y(is.$$.fragment,t),y(ms.$$.fragment,t),y(go.$$.fragment,t),y(uo.$$.fragment,t),y(hs.$$.fragment,t),y(fs.$$.fragment,t),y(vs.$$.fragment,t),y(vo.$$.fragment,t),y(bo.$$.fragment,t),y(bs.$$.fragment,t),y($s.$$.fragment,t),y(xs.$$.fragment,t),y(wo.$$.fragment,t),y(To.$$.fragment,t),Hl=!0)},o(t){x(n.$$.fragment,t),x(No.$$.fragment,t),x(Wo.$$.fragment,t),x(Go.$$.fragment,t),x(Qo.$$.fragment,t),x(kt.$$.fragment,t),x(Uo.$$.fragment,t),x(Ko.$$.fragment,t),x(Xo.$$.fragment,t),x(Et.$$.fragment,t),x(Zo.$$.fragment,t),x(en.$$.fragment,t),x(jt.$$.fragment,t),x(on.$$.fragment,t),x(nn.$$.fragment,t),x(sn.$$.fragment,t),x(an.$$.fragment,t),x(dn.$$.fragment,t),x(pn.$$.fragment,t),x(cn.$$.fragment,t),x(mn.$$.fragment,t),x(hn.$$.fragment,t),x(_n.$$.fragment,t),x(St.$$.fragment,t),x(Nt.$$.fragment,t),x(vn.$$.fragment,t),x(Dt.$$.fragment,t),x(Lt.$$.fragment,t),x(bn.$$.fragment,t),x(Vt.$$.fragment,t),x(Wt.$$.fragment,t),x($n.$$.fragment,t),x(wn.$$.fragment,t),x(yn.$$.fragment,t),x(kn.$$.fragment,t),x(Pn.$$.fragment,t),x(Fn.$$.fragment,t),x(Qt.$$.fragment,t),x(En.$$.fragment,t),x(Mn.$$.fragment,t),x(An.$$.fragment,t),x(Ut.$$.fragment,t),x(Jt.$$.fragment,t),x(zn.$$.fragment,t),x(On.$$.fragment,t),x(Ln.$$.fragment,t),x(Xt.$$.fragment,t),x(Yt.$$.fragment,t),x(Vn.$$.fragment,t),x(Wn.$$.fragment,t),x(Hn.$$.fragment,t),x(eo.$$.fragment,t),x(to.$$.fragment,t),x(Un.$$.fragment,t),x(Jn.$$.fragment,t),x(Kn.$$.fragment,t),x(no.$$.fragment,t),x(so.$$.fragment,t),x(Xn.$$.fragment,t),x(ro.$$.fragment,t),x(ao.$$.fragment,t),x(Yn.$$.fragment,t),x(io.$$.fragment,t),x(lo.$$.fragment,t),x(Zn.$$.fragment,t),x(es.$$.fragment,t),x(os.$$.fragment,t),x(co.$$.fragment,t),x(ns.$$.fragment,t),x(ss.$$.fragment,t),x(rs.$$.fragment,t),x(ho.$$.fragment,t),x(as.$$.fragment,t),x(is.$$.fragment,t),x(ms.$$.fragment,t),x(go.$$.fragment,t),x(uo.$$.fragment,t),x(hs.$$.fragment,t),x(fs.$$.fragment,t),x(vs.$$.fragment,t),x(vo.$$.fragment,t),x(bo.$$.fragment,t),x(bs.$$.fragment,t),x($s.$$.fragment,t),x(xs.$$.fragment,t),x(wo.$$.fragment,t),x(To.$$.fragment,t),Hl=!1},d(t){o(d),t&&o(b),t&&o(g),B(n),t&&o(nl),t&&o(Ce),B(No),t&&o(sl),t&&o(yt),t&&o(rl),t&&o(js),t&&o(al),t&&o(_e),t&&o(il),t&&o(Is),t&&o(ll),t&&o(qs),t&&o(dl),t&&o(Cs),t&&o(pl),t&&o(ve),t&&o(cl),t&&o(Ae),B(Wo),t&&o(ml),t&&o(zs),t&&o(hl),t&&o(ze),B(Go),t&&o(fl),t&&o(q),B(Qo),B(kt),B(Uo),t&&o(gl),t&&o(Se),B(Ko),t&&o(ul),t&&o(H),B(Xo),B(Et),t&&o(_l),t&&o(De),B(Zo),t&&o(vl),t&&o(U),B(en),B(jt),t&&o(bl),t&&o(We),B(on),t&&o($l),t&&o(C),B(nn),B(sn),B(an),t&&o(wl),t&&o(Re),B(dn),t&&o(Tl),t&&o(he),B(pn),B(cn),t&&o(yl),t&&o(Ge),B(mn),t&&o(xl),t&&o(I),B(hn),B(_n),B(St),B(Nt),B(vn),B(Dt),B(Lt),B(bn),B(Vt),B(Wt),t&&o(Bl),t&&o(Je),B($n),t&&o(kl),t&&o(fe),B(wn),B(yn),t&&o(Pl),t&&o(Ke),B(kn),t&&o(Fl),t&&o(Xe),B(Pn),B(Fn),B(Qt),t&&o(El),t&&o(Ze),B(En),t&&o(Ml),t&&o(z),B(Mn),B(An),B(Ut),B(Jt),t&&o(jl),t&&o(tt),B(zn),t&&o(Il),t&&o(O),B(On),B(Ln),B(Xt),B(Yt),t&&o(ql),t&&o(nt),B(Vn),t&&o(Cl),t&&o(S),B(Wn),B(Hn),B(eo),B(to),t&&o(Al),t&&o(rt),B(Un),t&&o(zl),t&&o(K),B(Jn),B(Kn),B(no),B(so),B(Xn),B(ro),B(ao),B(Yn),B(io),B(lo),t&&o(Ol),t&&o(dt),B(Zn),t&&o(Sl),t&&o(ge),B(es),B(os),B(co),t&&o(Nl),t&&o(ct),B(ns),t&&o(Dl),t&&o(mt),B(ss),B(rs),B(ho),t&&o(Ll),t&&o(ft),B(as),t&&o(Vl),t&&o(N),B(is),B(ms),B(go),B(uo),t&&o(Wl),t&&o(ut),B(hs),t&&o(Rl),t&&o(D),B(fs),B(vs),B(vo),B(bo),t&&o(Gl),t&&o(vt),B(bs),t&&o(Ql),t&&o(L),B($s),B(xs),B(wo),B(To)}}}const z$={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"},{local:"transformers.TFBlipModel",title:"TFBlipModel"},{local:"transformers.TFBlipTextModel",title:"TFBlipTextModel"},{local:"transformers.TFBlipVisionModel",title:"TFBlipVisionModel"},{local:"transformers.TFBlipForConditionalGeneration",title:"TFBlipForConditionalGeneration"},{local:"transformers.TFBlipForImageTextRetrieval",title:"TFBlipForImageTextRetrieval"},{local:"transformers.TFBlipForQuestionAnswering",title:"TFBlipForQuestionAnswering"}],title:"BLIP"};function O$(k){return s$(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class R$ extends Zb{constructor(d){super();e$(this,d,O$,A$,t$,{})}}export{R$ as default,z$ as metadata};
