import{S as u$,i as g$,s as _$,e as s,k as m,w as P,t as i,M as v$,c as r,d as o,m as h,a,x as $,h as l,b as f,G as e,g as v,y as T,q as y,o as I,B as C,v as b$,L as V}from"../../chunks/vendor-hf-doc-builder.js";import{T as K}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as q}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as z}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as D}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function P$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import CLIPConfig, CLIPModel

# Initializing a CLIPConfig with openai/clip-vit-base-patch32 style configuration
configuration = CLIPConfig()

# Initializing a CLIPModel (with random weights) from the openai/clip-vit-base-patch32 style configuration
model = CLIPModel(configuration)

# Accessing the model configuration
configuration = model.config

# We can also initialize a CLIPConfig from a CLIPTextConfig and a CLIPVisionConfig
from transformers import CLIPTextConfig, CLIPVisionConfig

# Initializing a CLIPText and CLIPVision configuration
config_text = CLIPTextConfig()
config_vision = CLIPVisionConfig()

config = CLIPConfig.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> CLIPConfig, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPConfig with openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPModel (with random weights) from the openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel(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 CLIPConfig from a CLIPTextConfig and a CLIPVisionConfig</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTextConfig, CLIPVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPText and CLIPVision configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = CLIPTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = CLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = CLIPConfig.from_text_vision_configs(config_text, config_vision)`}}),{c(){d=s("p"),b=i("Example:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Example:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function $$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import CLIPTextConfig, CLIPTextModel

# Initializing a CLIPTextConfig with openai/clip-vit-base-patch32 style configuration
configuration = CLIPTextConfig()

# Initializing a CLIPTextModel (with random weights) from the openai/clip-vit-base-patch32 style configuration
model = CLIPTextModel(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> CLIPTextConfig, CLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPTextConfig with openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPTextModel (with random weights) from the openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPTextModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=s("p"),b=i("Example:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Example:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function T$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import CLIPVisionConfig, CLIPVisionModel

# Initializing a CLIPVisionConfig with openai/clip-vit-base-patch32 style configuration
configuration = CLIPVisionConfig()

# Initializing a CLIPVisionModel (with random weights) from the openai/clip-vit-base-patch32 style configuration
model = CLIPVisionModel(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> CLIPVisionConfig, CLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPVisionConfig with openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPVisionModel (with random weights) from the openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPVisionModel(configuration)

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

model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

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

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

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

model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["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> AutoTokenizer, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

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

model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

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

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

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

model = CLIPTextModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled (EOS token) states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPTextModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function j$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function z$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import AutoTokenizer, CLIPTextModelWithProjection

model = CLIPTextModelWithProjection.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")

outputs = model(**inputs)
text_embeds = outputs.text_embeds`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPTextModelWithProjection

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPTextModelWithProjection.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

model = CLIPVisionModelWithProjection.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

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

outputs = model(**inputs)
image_embeds = outputs.image_embeds`,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, CLIPVisionModelWithProjection

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPVisionModelWithProjection.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_embeds = outputs.image_embeds`}}),{c(){d=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function q$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function A$(w){let d,b,u,p,_;return p=new q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, CLIPVisionModel

model = CLIPVisionModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

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

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled CLS states`,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, CLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function D$(w){let d,b,u,p,_,n,c,x,Kn,oo,G,pe,Se,j,Gn,qe,Jn,no,te,Xn,Ae,tt,Yn,so,me,Qn,ro,he,ot,Zn,nt,A,W,st,ae,es,rt,at,ao,Be,fe,io,oe,ts,Re,it,os,lo,M,ns,ue,ss,co,J,rs,De,Ue,as;return{c(){d=s("p"),b=i("TensorFlow models and layers in "),u=s("code"),p=i("transformers"),_=i(" accept two formats as input:"),n=m(),c=s("ul"),x=s("li"),Kn=i("having all inputs as keyword arguments (like PyTorch models), or"),oo=m(),G=s("li"),pe=i("having all inputs as a list, tuple or dict in the first positional argument."),Se=m(),j=s("p"),Gn=i(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),qe=s("code"),Jn=i("model.fit()"),no=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),te=s("code"),Xn=i("model.fit()"),Ae=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),tt=s("code"),Yn=i("fit()"),so=i(" and "),me=s("code"),Qn=i("predict()"),ro=i(`, such as when creating your own layers or models with
the Keras `),he=s("code"),ot=i("Functional"),Zn=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),nt=m(),A=s("ul"),W=s("li"),st=i("a single Tensor with "),ae=s("code"),es=i("input_ids"),rt=i(" only and nothing else: "),at=s("code"),ao=i("model(input_ids)"),Be=m(),fe=s("li"),io=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=s("code"),ts=i("model([input_ids, attention_mask])"),Re=i(" or "),it=s("code"),os=i("model([input_ids, attention_mask, token_type_ids])"),lo=m(),M=s("li"),ns=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=s("code"),ss=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),co=m(),J=s("p"),rs=i(`Note that when creating models and layers with
`),De=s("a"),Ue=i("subclassing"),as=i(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(L){d=r(L,"P",{});var E=a(d);b=l(E,"TensorFlow models and layers in "),u=r(E,"CODE",{});var ua=a(u);p=l(ua,"transformers"),ua.forEach(o),_=l(E," accept two formats as input:"),E.forEach(o),n=h(L),c=r(L,"UL",{});var po=a(c);x=r(po,"LI",{});var lt=a(x);Kn=l(lt,"having all inputs as keyword arguments (like PyTorch models), or"),lt.forEach(o),oo=h(po),G=r(po,"LI",{});var ga=a(G);pe=l(ga,"having all inputs as a list, tuple or dict in the first positional argument."),ga.forEach(o),po.forEach(o),Se=h(L),j=r(L,"P",{});var R=a(j);Gn=l(R,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),qe=r(R,"CODE",{});var dt=a(qe);Jn=l(dt,"model.fit()"),dt.forEach(o),no=l(R,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),te=r(R,"CODE",{});var _a=a(te);Xn=l(_a,"model.fit()"),_a.forEach(o),Ae=l(R,` supports! If, however, you want to use the second
format outside of Keras methods like `),tt=r(R,"CODE",{});var va=a(tt);Yn=l(va,"fit()"),va.forEach(o),so=l(R," and "),me=r(R,"CODE",{});var is=a(me);Qn=l(is,"predict()"),is.forEach(o),ro=l(R,`, such as when creating your own layers or models with
the Keras `),he=r(R,"CODE",{});var He=a(he);ot=l(He,"Functional"),He.forEach(o),Zn=l(R,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),R.forEach(o),nt=h(L),A=r(L,"UL",{});var Ve=a(A);W=r(Ve,"LI",{});var U=a(W);st=l(U,"a single Tensor with "),ae=r(U,"CODE",{});var ba=a(ae);es=l(ba,"input_ids"),ba.forEach(o),rt=l(U," only and nothing else: "),at=r(U,"CODE",{});var Ke=a(at);ao=l(Ke,"model(input_ids)"),Ke.forEach(o),U.forEach(o),Be=h(Ve),fe=r(Ve,"LI",{});var ct=a(fe);io=l(ct,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=r(ct,"CODE",{});var Pa=a(oe);ts=l(Pa,"model([input_ids, attention_mask])"),Pa.forEach(o),Re=l(ct," or "),it=r(ct,"CODE",{});var Ge=a(it);os=l(Ge,"model([input_ids, attention_mask, token_type_ids])"),Ge.forEach(o),ct.forEach(o),lo=h(Ve),M=r(Ve,"LI",{});var ls=a(M);ns=l(ls,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=r(ls,"CODE",{});var $a=a(ue);ss=l($a,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),$a.forEach(o),ls.forEach(o),Ve.forEach(o),co=h(L),J=r(L,"P",{});var pt=a(J);rs=l(pt,`Note that when creating models and layers with
`),De=r(pt,"A",{href:!0,rel:!0});var ge=a(De);Ue=l(ge,"subclassing"),ge.forEach(o),as=l(pt,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),pt.forEach(o),this.h()},h(){f(De,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(De,"rel","nofollow")},m(L,E){v(L,d,E),e(d,b),e(d,u),e(u,p),e(d,_),v(L,n,E),v(L,c,E),e(c,x),e(x,Kn),e(c,oo),e(c,G),e(G,pe),v(L,Se,E),v(L,j,E),e(j,Gn),e(j,qe),e(qe,Jn),e(j,no),e(j,te),e(te,Xn),e(j,Ae),e(j,tt),e(tt,Yn),e(j,so),e(j,me),e(me,Qn),e(j,ro),e(j,he),e(he,ot),e(j,Zn),v(L,nt,E),v(L,A,E),e(A,W),e(W,st),e(W,ae),e(ae,es),e(W,rt),e(W,at),e(at,ao),e(A,Be),e(A,fe),e(fe,io),e(fe,oe),e(oe,ts),e(fe,Re),e(fe,it),e(it,os),e(A,lo),e(A,M),e(M,ns),e(M,ue),e(ue,ss),v(L,co,E),v(L,J,E),e(J,rs),e(J,De),e(De,Ue),e(J,as)},d(L){L&&o(d),L&&o(n),L&&o(c),L&&o(Se),L&&o(j),L&&o(nt),L&&o(A),L&&o(co),L&&o(J)}}}function V$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function O$(w){let d,b,u,p,_;return p=new q({props:{code:`import tensorflow as tf
from PIL import Image
import requests
from transformers import AutoProcessor, TFCLIPModel

model = TFCLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<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, TFCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function N$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function W$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import AutoTokenizer, TFCLIPModel

model = TFCLIPModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["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> AutoTokenizer, TFCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

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

model = TFCLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function R$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function U$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import AutoTokenizer, TFCLIPTextModel

model = TFCLIPTextModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="tf")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled (EOS token) states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function H$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function K$(w){let d,b,u,p,_;return p=new q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, TFCLIPVisionModel

model = TFCLIPVisionModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

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

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled CLS states`,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, TFCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function G$(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function J$(w){let d,b,u,p,_;return p=new q({props:{code:`import jax
from PIL import Image
import requests
from transformers import AutoProcessor, FlaxCLIPModel

model = FlaxCLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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="np", padding=True
)

outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = jax.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">import</span> jax
<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, FlaxCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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;np&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 = jax.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=s("p"),b=i("Example:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Example:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function X$(w){let d,b,u,p,_;return p=new q({props:{code:`from transformers import AutoTokenizer, FlaxCLIPModel

model = FlaxCLIPModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="np")
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> AutoTokenizer, FlaxCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){d=s("p"),b=i("Examples:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Examples:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Y$(w){let d,b,u,p,_;return p=new q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, FlaxCLIPModel

model = FlaxCLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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;np&quot;</span>)

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

model = FlaxCLIPTextModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="np")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooler_output = outputs.pooler_output  # pooled (EOS token) states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooler_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),b=i("Example:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Example:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function e2(w){let d,b,u,p,_;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=i(`
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=r(n,"P",{});var c=a(d);b=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var x=a(u);p=l(x,"Module"),x.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){v(n,d,c),e(d,b),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function t2(w){let d,b,u,p,_;return p=new q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, FlaxCLIPVisionModel

model = FlaxCLIPVisionModel.from_pretrained("openai/clip-vit-base-patch32")
processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32")

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

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

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooler_output = outputs.pooler_output  # pooled CLS states`,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, FlaxCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooler_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),b=i("Example:"),u=m(),P(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);b=l(c,"Example:"),c.forEach(o),u=h(n),$(p.$$.fragment,n)},m(n,c){v(n,d,c),e(d,b),v(n,u,c),T(p,n,c),_=!0},p:V,i(n){_||(y(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function o2(w){let d,b,u,p,_,n,c,x,Kn,oo,G,pe,Se,j,Gn,qe,Jn,no,te,Xn,Ae,tt,Yn,so,me,Qn,ro,he,ot,Zn,nt,A,W,st,ae,es,rt,at,ao,Be,fe,io,oe,ts,Re,it,os,lo,M,ns,ue,ss,co,J,rs,De,Ue,as,L,E,ua,po,lt,ga,R,dt,_a,va,is,He,Ve,U,ba,Ke,ct,Pa,Ge,ls,$a,pt,ge,mo,zi,ds,Tp,Ei,yp,Ed,Ta,Ip,Fd,ho,cs,Cp,ps,wp,xp,kp,ms,Lp,hs,Mp,jp,qd,ya,zp,Ad,mt,fo,Fi,fs,Ep,qi,Fp,Dd,X,us,qp,Je,Ia,Ap,Dp,Ca,Vp,Op,gs,Np,Wp,Sp,ht,Bp,wa,Rp,Up,xa,Hp,Kp,Gp,uo,Jp,go,_s,Xp,vs,Yp,ka,Qp,Zp,Vd,ft,_o,Ai,bs,em,Di,tm,Od,ie,Ps,om,ut,nm,La,sm,rm,$s,am,im,lm,gt,dm,Ma,cm,pm,ja,mm,hm,fm,vo,Nd,_t,bo,Vi,Ts,um,Oi,gm,Wd,le,ys,_m,vt,vm,za,bm,Pm,Is,$m,Tm,ym,bt,Im,Ea,Cm,wm,Fa,xm,km,Lm,Po,Sd,Pt,$o,Ni,Cs,Mm,Wi,jm,Bd,O,ws,zm,Si,Em,Fm,xs,qm,qa,Am,Dm,Vm,_e,ks,Om,Bi,Nm,Wm,Ri,Aa,Sm,Ui,Bm,Rm,Hi,Um,Hm,To,Ls,Km,Ms,Gm,Ki,Jm,Xm,Ym,yo,js,Qm,Gi,Zm,eh,Da,zs,Rd,$t,Io,Ji,Es,th,Xi,oh,Ud,Y,Fs,nh,qs,sh,Yi,rh,ah,ih,As,lh,Va,dh,ch,ph,ve,Ds,mh,Qi,hh,fh,Zi,Oa,uh,el,gh,_h,tl,vh,bh,Co,Vs,Ph,ol,$h,Hd,Tt,wo,nl,Os,Th,sl,yh,Kd,Oe,Ns,Ih,rl,Ch,wh,xo,Ws,xh,al,kh,Gd,yt,ko,il,Ss,Lh,ll,Mh,Jd,Bs,Rs,Xd,It,Lo,dl,Us,jh,cl,zh,Yd,Q,Hs,Eh,pl,Fh,qh,ne,Na,Ah,Dh,Wa,Vh,Oh,Sa,Nh,Wh,ml,Sh,Bh,Ba,Rh,Uh,Hh,Mo,Ks,Kh,Gs,Gh,Ra,Jh,Xh,Yh,jo,Js,Qh,Xs,Zh,Ua,ef,tf,Qd,Ct,zo,hl,Ys,of,fl,nf,Zd,S,Qs,sf,Zs,rf,Ha,af,lf,df,er,cf,tr,pf,mf,hf,be,or,ff,wt,uf,Ka,gf,_f,ul,vf,bf,Pf,Eo,$f,Fo,Tf,Pe,nr,yf,xt,If,Ga,Cf,wf,gl,xf,kf,Lf,qo,Mf,Ao,jf,$e,sr,zf,kt,Ef,Ja,Ff,qf,_l,Af,Df,Vf,Do,Of,Vo,ec,Lt,Oo,vl,rr,Nf,bl,Wf,tc,de,ar,Sf,ir,Bf,Xa,Rf,Uf,Hf,lr,Kf,dr,Gf,Jf,Xf,Te,cr,Yf,Mt,Qf,Ya,Zf,eu,Pl,tu,ou,nu,No,su,Wo,oc,jt,So,$l,pr,ru,Tl,au,nc,Z,mr,iu,yl,lu,du,hr,cu,Qa,pu,mu,hu,fr,fu,ur,uu,gu,_u,ye,gr,vu,zt,bu,Za,Pu,$u,Il,Tu,yu,Iu,Bo,Cu,Ro,sc,Et,Uo,Cl,_r,wu,wl,xu,rc,ee,vr,ku,xl,Lu,Mu,br,ju,ei,zu,Eu,Fu,Pr,qu,$r,Au,Du,Vu,Ie,Tr,Ou,Ft,Nu,ti,Wu,Su,kl,Bu,Ru,Uu,Ho,Hu,Ko,ac,qt,Go,Ll,yr,Ku,Ml,Gu,ic,ce,Ir,Ju,Cr,Xu,oi,Yu,Qu,Zu,wr,eg,xr,tg,og,ng,Ce,kr,sg,At,rg,ni,ag,ig,jl,lg,dg,cg,Jo,pg,Xo,lc,Dt,Yo,zl,Lr,mg,El,hg,dc,N,Mr,fg,jr,ug,si,gg,_g,vg,zr,bg,Er,Pg,$g,Tg,Qo,yg,we,Fr,Ig,Vt,Cg,ri,wg,xg,Fl,kg,Lg,Mg,Zo,jg,en,zg,xe,qr,Eg,Ot,Fg,ai,qg,Ag,ql,Dg,Vg,Og,tn,Ng,on,Wg,ke,Ar,Sg,Nt,Bg,ii,Rg,Ug,Al,Hg,Kg,Gg,nn,Jg,sn,cc,Wt,rn,Dl,Dr,Xg,Vl,Yg,pc,St,Vr,Qg,Le,Or,Zg,Bt,e_,li,t_,o_,Ol,n_,s_,r_,an,a_,ln,mc,Rt,dn,Nl,Nr,i_,Wl,l_,hc,Ut,Wr,d_,Me,Sr,c_,Ht,p_,di,m_,h_,Sl,f_,u_,g_,cn,__,pn,fc,Kt,mn,Bl,Br,v_,Rl,b_,uc,F,Rr,P_,Ur,$_,ci,T_,y_,I_,Hr,C_,Kr,w_,x_,k_,Ul,L_,M_,Ne,Hl,Gr,j_,z_,Kl,Jr,E_,F_,Gl,Xr,q_,A_,Jl,Yr,D_,V_,je,Qr,O_,Gt,N_,Xl,W_,S_,Yl,B_,R_,U_,hn,H_,fn,K_,un,Zr,G_,gn,J_,_n,ea,X_,vn,gc,Jt,bn,Ql,ta,Y_,Zl,Q_,_c,Xt,oa,Z_,ze,na,ev,Yt,tv,ed,ov,nv,td,sv,rv,av,Pn,iv,$n,vc,Qt,Tn,od,sa,lv,nd,dv,bc,Zt,ra,cv,Ee,aa,pv,eo,mv,sd,hv,fv,rd,uv,gv,_v,yn,vv,In,Pc;return n=new z({}),j=new z({}),ae=new z({}),He=new q({props:{code:`from PIL import Image
import requests

from transformers import CLIPProcessor, CLIPModel

model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")

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> CLIPProcessor, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = CLIPProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&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(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">&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>`}}),ds=new z({}),fs=new z({}),us=new k({props:{name:"class transformers.CLIPConfig",anchor:"transformers.CLIPConfig",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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextConfig">CLIPTextConfig</a>.`,name:"text_config"},{anchor:"transformers.CLIPConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionConfig">CLIPVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.CLIPConfig.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.CLIPConfig.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 CLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.CLIPConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/configuration_clip.py#L248"}}),uo=new D({props:{anchor:"transformers.CLIPConfig.example",$$slots:{default:[P$]},$$scope:{ctx:w}}}),_s=new k({props:{name:"from_text_vision_configs",anchor:"transformers.CLIPConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": CLIPTextConfig"},{name:"vision_config",val:": CLIPVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/configuration_clip.py#L385",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig"
>CLIPConfig</a></p>
`}}),bs=new z({}),Ps=new k({props:{name:"class transformers.CLIPTextConfig",anchor:"transformers.CLIPTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the CLIP text model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a>.`,name:"vocab_size"},{anchor:"transformers.CLIPTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPTextConfig.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.CLIPTextConfig.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.CLIPTextConfig.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.CLIPTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_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;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPTextConfig.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.CLIPTextConfig.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.CLIPTextConfig.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.CLIPTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/configuration_clip.py#L40"}}),vo=new D({props:{anchor:"transformers.CLIPTextConfig.example",$$slots:{default:[$$]},$$scope:{ctx:w}}}),Ts=new z({}),ys=new k({props:{name:"class transformers.CLIPVisionConfig",anchor:"transformers.CLIPVisionConfig",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:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_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;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.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.CLIPVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/configuration_clip.py#L145"}}),Po=new D({props:{anchor:"transformers.CLIPVisionConfig.example",$$slots:{default:[T$]},$$scope:{ctx:w}}}),Cs=new z({}),ws=new k({props:{name:"class transformers.CLIPTokenizer",anchor:"transformers.CLIPTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|startoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CLIPTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CLIPTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.CLIPTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.CLIPTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|startoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.CLIPTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip.py#L260"}}),ks=new k({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip.py#L346",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ls=new k({props:{name:"get_special_tokens_mask",anchor:"transformers.CLIPTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.CLIPTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip.py#L373",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),js=new k({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip.py#L401",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),zs=new k({props:{name:"save_vocabulary",anchor:"transformers.CLIPTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip.py#L496"}}),Es=new z({}),Fs=new k({props:{name:"class transformers.CLIPTokenizerFast",anchor:"transformers.CLIPTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|startoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CLIPTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CLIPTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.CLIPTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|startoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.CLIPTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip_fast.py#L50"}}),Ds=new k({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip_fast.py#L123",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Vs=new k({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/tokenization_clip_fast.py#L150",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Os=new z({}),Ns=new k({props:{name:"class transformers.CLIPImageProcessor",anchor:"transformers.CLIPImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{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.CLIPImageProcessor.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
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.CLIPImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.CLIPImageProcessor.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. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.CLIPImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.CLIPImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.CLIPImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.CLIPImageProcessor.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. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.CLIPImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</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.`,name:"image_mean"},{anchor:"transformers.CLIPImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.CLIPImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</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.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/image_processing_clip.py#L51"}}),Ws=new k({props:{name:"preprocess",anchor:"transformers.CLIPImageProcessor.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:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": 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:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.CLIPImageProcessor.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.CLIPImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.CLIPImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.CLIPImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.CLIPImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.CLIPImageProcessor.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.`,name:"do_rescale"},{anchor:"transformers.CLIPImageProcessor.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.CLIPImageProcessor.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.CLIPImageProcessor.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 use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.CLIPImageProcessor.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 use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.CLIPImageProcessor.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.CLIPImageProcessor.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.CLIPImageProcessor.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>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/image_processing_clip.py#L219"}}),Ss=new z({}),Rs=new k({props:{name:"class transformers.CLIPFeatureExtractor",anchor:"transformers.CLIPFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/feature_extraction_clip.py#L26"}}),Us=new z({}),Hs=new k({props:{name:"class transformers.CLIPProcessor",anchor:"transformers.CLIPProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.CLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/processing_clip.py#L25"}}),Ks=new k({props:{name:"batch_decode",anchor:"transformers.CLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/processing_clip.py#L112"}}),Js=new k({props:{name:"decode",anchor:"transformers.CLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/processing_clip.py#L119"}}),Ys=new z({}),Qs=new k({props:{name:"class transformers.CLIPModel",anchor:"transformers.CLIPModel",parameters:[{name:"config",val:": CLIPConfig"}],parametersDescription:[{anchor:"transformers.CLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L943"}}),or=new k({props:{name:"forward",anchor:"transformers.CLIPModel.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.CLIPModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPModel.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.CLIPModel.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.CLIPModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPModel.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.CLIPModel.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.CLIPModel.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.CLIPModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L1074",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPOutput</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.clip.configuration_clip.CLIPConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_clip.CLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Eo=new K({props:{$$slots:{default:[y$]},$$scope:{ctx:w}}}),Fo=new D({props:{anchor:"transformers.CLIPModel.forward.example",$$slots:{default:[I$]},$$scope:{ctx:w}}}),nr=new k({props:{name:"get_text_features",anchor:"transformers.CLIPModel.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:"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.CLIPModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPModel.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.CLIPModel.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.CLIPModel.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.CLIPModel.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.CLIPModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L978",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),qo=new K({props:{$$slots:{default:[C$]},$$scope:{ctx:w}}}),Ao=new D({props:{anchor:"transformers.CLIPModel.get_text_features.example",$$slots:{default:[w$]},$$scope:{ctx:w}}}),sr=new k({props:{name:"get_image_features",anchor:"transformers.CLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPModel.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.CLIPModel.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.CLIPModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L1025",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Do=new K({props:{$$slots:{default:[x$]},$$scope:{ctx:w}}}),Vo=new D({props:{anchor:"transformers.CLIPModel.get_image_features.example",$$slots:{default:[k$]},$$scope:{ctx:w}}}),rr=new z({}),ar=new k({props:{name:"class transformers.CLIPTextModel",anchor:"transformers.CLIPTextModel",parameters:[{name:"config",val:": CLIPTextConfig"}],parametersDescription:[{anchor:"transformers.CLIPTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L769"}}),cr=new k({props:{name:"forward",anchor:"transformers.CLIPTextModel.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:"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.CLIPTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPTextModel.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.CLIPTextModel.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.CLIPTextModel.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.CLIPTextModel.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.CLIPTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L786",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),No=new K({props:{$$slots:{default:[L$]},$$scope:{ctx:w}}}),Wo=new D({props:{anchor:"transformers.CLIPTextModel.forward.example",$$slots:{default:[M$]},$$scope:{ctx:w}}}),pr=new z({}),mr=new k({props:{name:"class transformers.CLIPTextModelWithProjection",anchor:"transformers.CLIPTextModelWithProjection",parameters:[{name:"config",val:": CLIPTextConfig"}],parametersDescription:[{anchor:"transformers.CLIPTextModelWithProjection.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L1174"}}),gr=new k({props:{name:"forward",anchor:"transformers.CLIPTextModelWithProjection.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:"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.CLIPTextModelWithProjection.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L1195",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPTextModelOutput</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.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>text_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 text 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.clip.modeling_clip.CLIPTextModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bo=new K({props:{$$slots:{default:[j$]},$$scope:{ctx:w}}}),Ro=new D({props:{anchor:"transformers.CLIPTextModelWithProjection.forward.example",$$slots:{default:[z$]},$$scope:{ctx:w}}}),_r=new z({}),vr=new k({props:{name:"class transformers.CLIPVisionModelWithProjection",anchor:"transformers.CLIPVisionModelWithProjection",parameters:[{name:"config",val:": CLIPVisionConfig"}],parametersDescription:[{anchor:"transformers.CLIPVisionModelWithProjection.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L1255"}}),Tr=new k({props:{name:"forward",anchor:"transformers.CLIPVisionModelWithProjection.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.CLIPVisionModelWithProjection.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPVisionModelWithProjection.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.CLIPVisionModelWithProjection.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.CLIPVisionModelWithProjection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L1272",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPVisionModelOutput</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.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<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.clip.modeling_clip.CLIPVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ho=new K({props:{$$slots:{default:[E$]},$$scope:{ctx:w}}}),Ko=new D({props:{anchor:"transformers.CLIPVisionModelWithProjection.forward.example",$$slots:{default:[F$]},$$scope:{ctx:w}}}),yr=new z({}),Ir=new k({props:{name:"class transformers.CLIPVisionModel",anchor:"transformers.CLIPVisionModel",parameters:[{name:"config",val:": CLIPVisionConfig"}],parametersDescription:[{anchor:"transformers.CLIPVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L888"}}),kr=new k({props:{name:"forward",anchor:"transformers.CLIPVisionModel.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.CLIPVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPVisionModel.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.CLIPVisionModel.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.CLIPVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_clip.py#L901",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Jo=new K({props:{$$slots:{default:[q$]},$$scope:{ctx:w}}}),Xo=new D({props:{anchor:"transformers.CLIPVisionModel.forward.example",$$slots:{default:[A$]},$$scope:{ctx:w}}}),Lr=new z({}),Mr=new k({props:{name:"class transformers.TFCLIPModel",anchor:"transformers.TFCLIPModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1222"}}),Qo=new K({props:{$$slots:{default:[D$]},$$scope:{ctx:w}}}),Fr=new k({props:{name:"call",anchor:"transformers.TFCLIPModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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:": bool = False"}],parametersDescription:[{anchor:"transformers.TFCLIPModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCLIPModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFCLIPModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <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.TFCLIPModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <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.TFCLIPModel.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.TFCLIPModel.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFCLIPModel.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPModel.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1350",returnDescription:`
<p>A <code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</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.clip.configuration_clip.CLIPConfig'&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.27.1/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</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.27.1/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Zo=new K({props:{$$slots:{default:[V$]},$$scope:{ctx:w}}}),en=new D({props:{anchor:"transformers.TFCLIPModel.call.example",$$slots:{default:[O$]},$$scope:{ctx:w}}}),qr=new k({props:{name:"get_text_features",anchor:"transformers.TFCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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:": bool = False"}],parametersDescription:[{anchor:"transformers.TFCLIPModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCLIPModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <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.TFCLIPModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <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.TFCLIPModel.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFCLIPModel.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPModel.get_text_features.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1268",returnDescription:`
<p>The text embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),tn=new K({props:{$$slots:{default:[N$]},$$scope:{ctx:w}}}),on=new D({props:{anchor:"transformers.TFCLIPModel.get_text_features.example",$$slots:{default:[W$]},$$scope:{ctx:w}}}),Ar=new k({props:{name:"get_image_features",anchor:"transformers.TFCLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = 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:": bool = False"}],parametersDescription:[{anchor:"transformers.TFCLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details. output_attentions (<code>bool</code>, <em>optional</em>): Whether or not to
return the attentions tensors of all attention layers. See <code>attentions</code> under returned tensors for more
detail. This argument can be used only in eager mode, in graph mode the value in the config will be used
instead.`,name:"pixel_values"},{anchor:"transformers.TFCLIPModel.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPModel.get_image_features.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1308",returnDescription:`
<p>The image embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),nn=new K({props:{$$slots:{default:[S$]},$$scope:{ctx:w}}}),sn=new D({props:{anchor:"transformers.TFCLIPModel.get_image_features.example",$$slots:{default:[B$]},$$scope:{ctx:w}}}),Dr=new z({}),Vr=new k({props:{name:"class transformers.TFCLIPTextModel",anchor:"transformers.TFCLIPTextModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1049"}}),Or=new k({props:{name:"call",anchor:"transformers.TFCLIPTextModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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] = False"}],parametersDescription:[{anchor:"transformers.TFCLIPTextModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCLIPTextModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <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.TFCLIPTextModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <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.TFCLIPTextModel.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFCLIPTextModel.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPTextModel.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPTextModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1057",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.clip.configuration_clip.CLIPTextConfig'&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.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),an=new K({props:{$$slots:{default:[R$]},$$scope:{ctx:w}}}),ln=new D({props:{anchor:"transformers.TFCLIPTextModel.call.example",$$slots:{default:[U$]},$$scope:{ctx:w}}}),Nr=new z({}),Wr=new k({props:{name:"class transformers.TFCLIPVisionModel",anchor:"transformers.TFCLIPVisionModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1124"}}),Sr=new k({props:{name:"call",anchor:"transformers.TFCLIPVisionModel.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = 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] = False"}],parametersDescription:[{anchor:"transformers.TFCLIPVisionModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details. output_attentions (<code>bool</code>, <em>optional</em>): Whether or not to
return the attentions tensors of all attention layers. See <code>attentions</code> under returned tensors for more
detail. This argument can be used only in eager mode, in graph mode the value in the config will be used
instead.`,name:"pixel_values"},{anchor:"transformers.TFCLIPVisionModel.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPVisionModel.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPVisionModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_tf_clip.py#L1165",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.clip.configuration_clip.CLIPVisionConfig'&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.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),cn=new K({props:{$$slots:{default:[H$]},$$scope:{ctx:w}}}),pn=new D({props:{anchor:"transformers.TFCLIPVisionModel.call.example",$$slots:{default:[K$]},$$scope:{ctx:w}}}),Br=new z({}),Rr=new k({props:{name:"class transformers.FlaxCLIPModel",anchor:"transformers.FlaxCLIPModel",parameters:[{name:"config",val:": CLIPConfig"},{name:"input_shape",val:": typing.Optional[typing.Tuple] = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxCLIPModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L1148"}}),Qr=new k({props:{name:"__call__",anchor:"transformers.FlaxCLIPModel.__call__",parameters:[{name:"input_ids",val:""},{name:"pixel_values",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxCLIPModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxCLIPModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxCLIPModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.FlaxCLIPModel.__call__.pixel_values",description:`<strong>pixel_values</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlaxCLIPModel.__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.FlaxCLIPModel.__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.FlaxCLIPModel.__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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L777",returnDescription:`
<p>A <code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</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.clip.configuration_clip.CLIPConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>logits_per_image:(<code>jnp.ndarray</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>jnp.ndarray</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>jnp.ndarray</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>jnp.ndarray</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),hn=new K({props:{$$slots:{default:[G$]},$$scope:{ctx:w}}}),fn=new D({props:{anchor:"transformers.FlaxCLIPModel.__call__.example",$$slots:{default:[J$]},$$scope:{ctx:w}}}),Zr=new k({props:{name:"get_text_features",anchor:"transformers.FlaxCLIPModel.get_text_features",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:" = False"}],parametersDescription:[{anchor:"transformers.FlaxCLIPModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L822",returnDescription:`
<p>The text embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),gn=new D({props:{anchor:"transformers.FlaxCLIPModel.get_text_features.example",$$slots:{default:[X$]},$$scope:{ctx:w}}}),ea=new k({props:{name:"get_image_features",anchor:"transformers.FlaxCLIPModel.get_image_features",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:" = False"}],parametersDescription:[{anchor:"transformers.FlaxCLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained
using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L889",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.27.1/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a></p>
`,returnType:`
<p>image_features (<code>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),vn=new D({props:{anchor:"transformers.FlaxCLIPModel.get_image_features.example",$$slots:{default:[Y$]},$$scope:{ctx:w}}}),ta=new z({}),oa=new k({props:{name:"class transformers.FlaxCLIPTextModel",anchor:"transformers.FlaxCLIPTextModel",parameters:[{name:"config",val:": CLIPTextConfig"},{name:"input_shape",val:" = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L969"}}),na=new k({props:{name:"__call__",anchor:"transformers.FlaxCLIPTextModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxCLIPTextModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxCLIPTextModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.FlaxCLIPTextModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.FlaxCLIPTextModel.__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.FlaxCLIPTextModel.__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.FlaxCLIPTextModel.__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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L622",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</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.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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>jnp.ndarray</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>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pn=new K({props:{$$slots:{default:[Q$]},$$scope:{ctx:w}}}),$n=new D({props:{anchor:"transformers.FlaxCLIPTextModel.__call__.example",$$slots:{default:[Z$]},$$scope:{ctx:w}}}),sa=new z({}),ra=new k({props:{name:"class transformers.FlaxCLIPVisionModel",anchor:"transformers.FlaxCLIPVisionModel",parameters:[{name:"config",val:": CLIPVisionConfig"},{name:"input_shape",val:": typing.Optional[typing.Tuple] = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L1022"}}),aa=new k({props:{name:"__call__",anchor:"transformers.FlaxCLIPVisionModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxCLIPVisionModel.__call__.pixel_values",description:`<strong>pixel_values</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlaxCLIPVisionModel.__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.FlaxCLIPVisionModel.__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.FlaxCLIPVisionModel.__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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/clip/modeling_flax_clip.py#L702",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</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.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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>jnp.ndarray</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>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yn=new K({props:{$$slots:{default:[e2]},$$scope:{ctx:w}}}),In=new D({props:{anchor:"transformers.FlaxCLIPVisionModel.__call__.example",$$slots:{default:[t2]},$$scope:{ctx:w}}}),{c(){d=s("meta"),b=m(),u=s("h1"),p=s("a"),_=s("span"),P(n.$$.fragment),c=m(),x=s("span"),Kn=i("CLIP"),oo=m(),G=s("h2"),pe=s("a"),Se=s("span"),P(j.$$.fragment),Gn=m(),qe=s("span"),Jn=i("Overview"),no=m(),te=s("p"),Xn=i("The CLIP model was proposed in "),Ae=s("a"),tt=i("Learning Transferable Visual Models From Natural Language Supervision"),Yn=i(` by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh,
Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. CLIP
(Contrastive Language-Image Pre-Training) is a neural network trained on a variety of (image, text) pairs. It can be
instructed in natural language to predict the most relevant text snippet, given an image, without directly optimizing
for the task, similarly to the zero-shot capabilities of GPT-2 and 3.`),so=m(),me=s("p"),Qn=i("The abstract from the paper is the following:"),ro=m(),he=s("p"),ot=s("em"),Zn=i(`State-of-the-art computer vision systems are trained to predict a fixed set of predetermined object categories. This
restricted form of supervision limits their generality and usability since additional labeled data is needed to specify
any other visual concept. Learning directly from raw text about images is a promising alternative which leverages a
much broader source of supervision. We demonstrate that the simple pre-training task of predicting which caption goes
with which image is an efficient and scalable way to learn SOTA image representations from scratch on a dataset of 400
million (image, text) pairs collected from the internet. After pre-training, natural language is used to reference
learned visual concepts (or describe new ones) enabling zero-shot transfer of the model to downstream tasks. We study
the performance of this approach by benchmarking on over 30 different existing computer vision datasets, spanning tasks
such as OCR, action recognition in videos, geo-localization, and many types of fine-grained object classification. The
model transfers non-trivially to most tasks and is often competitive with a fully supervised baseline without the need
for any dataset specific training. For instance, we match the accuracy of the original ResNet-50 on ImageNet zero-shot
without needing to use any of the 1.28 million training examples it was trained on. We release our code and pre-trained
model weights at this https URL.`),nt=m(),A=s("h2"),W=s("a"),st=s("span"),P(ae.$$.fragment),es=m(),rt=s("span"),at=i("Usage"),ao=m(),Be=s("p"),fe=i(`CLIP is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image
classification. CLIP uses a ViT like transformer to get visual features and a causal language model to get the text
features. Both the text and visual features are then projected to a latent space with identical dimension. The dot
product between the projected image and text features is then used as a similar score.`),io=m(),oe=s("p"),ts=i(`To feed images to the Transformer encoder, each image is split into a sequence of fixed-size non-overlapping patches,
which are then linearly embedded. A [CLS] token is added to serve as representation of an entire image. The authors
also add absolute position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder.
The `),Re=s("a"),it=i("CLIPFeatureExtractor"),os=i(" can be used to resize (or rescale) and normalize images for the model."),lo=m(),M=s("p"),ns=i("The "),ue=s("a"),ss=i("CLIPTokenizer"),co=i(" is used to encode the text. The "),J=s("a"),rs=i("CLIPProcessor"),De=i(` wraps
`),Ue=s("a"),as=i("CLIPFeatureExtractor"),L=i(" and "),E=s("a"),ua=i("CLIPTokenizer"),po=i(` into a single instance to both
encode the text and prepare the images. The following example shows how to get the image-text similarity scores using
`),lt=s("a"),ga=i("CLIPProcessor"),R=i(" and "),dt=s("a"),_a=i("CLIPModel"),va=i("."),is=m(),P(He.$$.fragment),Ve=m(),U=s("p"),ba=i("This model was contributed by "),Ke=s("a"),ct=i("valhalla"),Pa=i(". The original code can be found "),Ge=s("a"),ls=i("here"),$a=i("."),pt=m(),ge=s("h2"),mo=s("a"),zi=s("span"),P(ds.$$.fragment),Tp=m(),Ei=s("span"),yp=i("Resources"),Ed=m(),Ta=s("p"),Ip=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CLIP."),Fd=m(),ho=s("ul"),cs=s("li"),Cp=i("A blog post on "),ps=s("a"),wp=i("How to fine-tune CLIP on 10,000 image-text pairs"),xp=i("."),kp=m(),ms=s("li"),Lp=i("CLIP is supported by this "),hs=s("a"),Mp=i("example script"),jp=i("."),qd=m(),ya=s("p"),zp=i(`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),Ad=m(),mt=s("h2"),fo=s("a"),Fi=s("span"),P(fs.$$.fragment),Ep=m(),qi=s("span"),Fp=i("CLIPConfig"),Dd=m(),X=s("div"),P(us.$$.fragment),qp=m(),Je=s("p"),Ia=s("a"),Ap=i("CLIPConfig"),Dp=i(" is the configuration class to store the configuration of a "),Ca=s("a"),Vp=i("CLIPModel"),Op=i(`. It is used to instantiate
a CLIP 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 CLIP
`),gs=s("a"),Np=i("openai/clip-vit-base-patch32"),Wp=i(" architecture."),Sp=m(),ht=s("p"),Bp=i("Configuration objects inherit from "),wa=s("a"),Rp=i("PretrainedConfig"),Up=i(` and can be used to control the model outputs. Read the
documentation from `),xa=s("a"),Hp=i("PretrainedConfig"),Kp=i(" for more information."),Gp=m(),P(uo.$$.fragment),Jp=m(),go=s("div"),P(_s.$$.fragment),Xp=m(),vs=s("p"),Yp=i("Instantiate a "),ka=s("a"),Qp=i("CLIPConfig"),Zp=i(` (or a derived class) from clip text model configuration and clip vision model
configuration.`),Vd=m(),ft=s("h2"),_o=s("a"),Ai=s("span"),P(bs.$$.fragment),em=m(),Di=s("span"),tm=i("CLIPTextConfig"),Od=m(),ie=s("div"),P(Ps.$$.fragment),om=m(),ut=s("p"),nm=i("This is the configuration class to store the configuration of a "),La=s("a"),sm=i("CLIPTextModel"),rm=i(`. It is used to instantiate a CLIP
text encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the text encoder of the CLIP
`),$s=s("a"),am=i("openai/clip-vit-base-patch32"),im=i(" architecture."),lm=m(),gt=s("p"),dm=i("Configuration objects inherit from "),Ma=s("a"),cm=i("PretrainedConfig"),pm=i(` and can be used to control the model outputs. Read the
documentation from `),ja=s("a"),mm=i("PretrainedConfig"),hm=i(" for more information."),fm=m(),P(vo.$$.fragment),Nd=m(),_t=s("h2"),bo=s("a"),Vi=s("span"),P(Ts.$$.fragment),um=m(),Oi=s("span"),gm=i("CLIPVisionConfig"),Wd=m(),le=s("div"),P(ys.$$.fragment),_m=m(),vt=s("p"),vm=i("This is the configuration class to store the configuration of a "),za=s("a"),bm=i("CLIPVisionModel"),Pm=i(`. It is used to instantiate a
CLIP vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the CLIP
`),Is=s("a"),$m=i("openai/clip-vit-base-patch32"),Tm=i(" architecture."),ym=m(),bt=s("p"),Im=i("Configuration objects inherit from "),Ea=s("a"),Cm=i("PretrainedConfig"),wm=i(` and can be used to control the model outputs. Read the
documentation from `),Fa=s("a"),xm=i("PretrainedConfig"),km=i(" for more information."),Lm=m(),P(Po.$$.fragment),Sd=m(),Pt=s("h2"),$o=s("a"),Ni=s("span"),P(Cs.$$.fragment),Mm=m(),Wi=s("span"),jm=i("CLIPTokenizer"),Bd=m(),O=s("div"),P(ws.$$.fragment),zm=m(),Si=s("p"),Em=i("Construct a CLIP tokenizer. Based on byte-level Byte-Pair-Encoding."),Fm=m(),xs=s("p"),qm=i("This tokenizer inherits from "),qa=s("a"),Am=i("PreTrainedTokenizer"),Dm=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Vm=m(),_e=s("div"),P(ks.$$.fragment),Om=m(),Bi=s("p"),Nm=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),Wm=m(),Ri=s("ul"),Aa=s("li"),Sm=i("single sequence: "),Ui=s("code"),Bm=i("<|startoftext|> X <|endoftext|>"),Rm=m(),Hi=s("p"),Um=i("Pairs of sequences are not the expected use case, but they will be handled without a separator."),Hm=m(),To=s("div"),P(Ls.$$.fragment),Km=m(),Ms=s("p"),Gm=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ki=s("code"),Jm=i("prepare_for_model"),Xm=i(" method."),Ym=m(),yo=s("div"),P(js.$$.fragment),Qm=m(),Gi=s("p"),Zm=i(`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),eh=m(),Da=s("div"),P(zs.$$.fragment),Rd=m(),$t=s("h2"),Io=s("a"),Ji=s("span"),P(Es.$$.fragment),th=m(),Xi=s("span"),oh=i("CLIPTokenizerFast"),Ud=m(),Y=s("div"),P(Fs.$$.fragment),nh=m(),qs=s("p"),sh=i("Construct a \u201Cfast\u201D CLIP tokenizer (backed by HuggingFace\u2019s "),Yi=s("em"),rh=i("tokenizers"),ah=i(` library). Based on byte-level
Byte-Pair-Encoding.`),ih=m(),As=s("p"),lh=i("This tokenizer inherits from "),Va=s("a"),dh=i("PreTrainedTokenizerFast"),ch=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ph=m(),ve=s("div"),P(Ds.$$.fragment),mh=m(),Qi=s("p"),hh=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),fh=m(),Zi=s("ul"),Oa=s("li"),uh=i("single sequence: "),el=s("code"),gh=i("<|startoftext|> X <|endoftext|>"),_h=m(),tl=s("p"),vh=i("Pairs of sequences are not the expected use case, but they will be handled without a separator."),bh=m(),Co=s("div"),P(Vs.$$.fragment),Ph=m(),ol=s("p"),$h=i(`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),Hd=m(),Tt=s("h2"),wo=s("a"),nl=s("span"),P(Os.$$.fragment),Th=m(),sl=s("span"),yh=i("CLIPImageProcessor"),Kd=m(),Oe=s("div"),P(Ns.$$.fragment),Ih=m(),rl=s("p"),Ch=i("Constructs a CLIP image processor."),wh=m(),xo=s("div"),P(Ws.$$.fragment),xh=m(),al=s("p"),kh=i("Preprocess an image or batch of images."),Gd=m(),yt=s("h2"),ko=s("a"),il=s("span"),P(Ss.$$.fragment),Lh=m(),ll=s("span"),Mh=i("CLIPFeatureExtractor"),Jd=m(),Bs=s("div"),P(Rs.$$.fragment),Xd=m(),It=s("h2"),Lo=s("a"),dl=s("span"),P(Us.$$.fragment),jh=m(),cl=s("span"),zh=i("CLIPProcessor"),Yd=m(),Q=s("div"),P(Hs.$$.fragment),Eh=m(),pl=s("p"),Fh=i("Constructs a CLIP processor which wraps a CLIP image processor and a CLIP tokenizer into a single processor."),qh=m(),ne=s("p"),Na=s("a"),Ah=i("CLIPProcessor"),Dh=i(" offers all the functionalities of "),Wa=s("a"),Vh=i("CLIPImageProcessor"),Oh=i(" and "),Sa=s("a"),Nh=i("CLIPTokenizerFast"),Wh=i(`. See the
`),ml=s("code"),Sh=i("__call__()"),Bh=i(" and "),Ba=s("a"),Rh=i("decode()"),Uh=i(" for more information."),Hh=m(),Mo=s("div"),P(Ks.$$.fragment),Kh=m(),Gs=s("p"),Gh=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Ra=s("a"),Jh=i("batch_decode()"),Xh=i(`. Please
refer to the docstring of this method for more information.`),Yh=m(),jo=s("div"),P(Js.$$.fragment),Qh=m(),Xs=s("p"),Zh=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Ua=s("a"),ef=i("decode()"),tf=i(`. Please refer to
the docstring of this method for more information.`),Qd=m(),Ct=s("h2"),zo=s("a"),hl=s("span"),P(Ys.$$.fragment),of=m(),fl=s("span"),nf=i("CLIPModel"),Zd=m(),S=s("div"),P(Qs.$$.fragment),sf=m(),Zs=s("p"),rf=i("This model inherits from "),Ha=s("a"),af=i("PreTrainedModel"),lf=i(`. 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.)`),df=m(),er=s("p"),cf=i("This model is also a PyTorch "),tr=s("a"),pf=i("torch.nn.Module"),mf=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hf=m(),be=s("div"),P(or.$$.fragment),ff=m(),wt=s("p"),uf=i("The "),Ka=s("a"),gf=i("CLIPModel"),_f=i(" forward method, overrides the "),ul=s("code"),vf=i("__call__"),bf=i(" special method."),Pf=m(),P(Eo.$$.fragment),$f=m(),P(Fo.$$.fragment),Tf=m(),Pe=s("div"),P(nr.$$.fragment),yf=m(),xt=s("p"),If=i("The "),Ga=s("a"),Cf=i("CLIPModel"),wf=i(" forward method, overrides the "),gl=s("code"),xf=i("__call__"),kf=i(" special method."),Lf=m(),P(qo.$$.fragment),Mf=m(),P(Ao.$$.fragment),jf=m(),$e=s("div"),P(sr.$$.fragment),zf=m(),kt=s("p"),Ef=i("The "),Ja=s("a"),Ff=i("CLIPModel"),qf=i(" forward method, overrides the "),_l=s("code"),Af=i("__call__"),Df=i(" special method."),Vf=m(),P(Do.$$.fragment),Of=m(),P(Vo.$$.fragment),ec=m(),Lt=s("h2"),Oo=s("a"),vl=s("span"),P(rr.$$.fragment),Nf=m(),bl=s("span"),Wf=i("CLIPTextModel"),tc=m(),de=s("div"),P(ar.$$.fragment),Sf=m(),ir=s("p"),Bf=i(`The text model from CLIP without any head or projection on top.
This model inherits from `),Xa=s("a"),Rf=i("PreTrainedModel"),Uf=i(`. 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.)`),Hf=m(),lr=s("p"),Kf=i("This model is also a PyTorch "),dr=s("a"),Gf=i("torch.nn.Module"),Jf=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xf=m(),Te=s("div"),P(cr.$$.fragment),Yf=m(),Mt=s("p"),Qf=i("The "),Ya=s("a"),Zf=i("CLIPTextModel"),eu=i(" forward method, overrides the "),Pl=s("code"),tu=i("__call__"),ou=i(" special method."),nu=m(),P(No.$$.fragment),su=m(),P(Wo.$$.fragment),oc=m(),jt=s("h2"),So=s("a"),$l=s("span"),P(pr.$$.fragment),ru=m(),Tl=s("span"),au=i("CLIPTextModelWithProjection"),nc=m(),Z=s("div"),P(mr.$$.fragment),iu=m(),yl=s("p"),lu=i("CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)."),du=m(),hr=s("p"),cu=i("This model inherits from "),Qa=s("a"),pu=i("PreTrainedModel"),mu=i(`. 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.)`),hu=m(),fr=s("p"),fu=i("This model is also a PyTorch "),ur=s("a"),uu=i("torch.nn.Module"),gu=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_u=m(),ye=s("div"),P(gr.$$.fragment),vu=m(),zt=s("p"),bu=i("The "),Za=s("a"),Pu=i("CLIPTextModelWithProjection"),$u=i(" forward method, overrides the "),Il=s("code"),Tu=i("__call__"),yu=i(" special method."),Iu=m(),P(Bo.$$.fragment),Cu=m(),P(Ro.$$.fragment),sc=m(),Et=s("h2"),Uo=s("a"),Cl=s("span"),P(_r.$$.fragment),wu=m(),wl=s("span"),xu=i("CLIPVisionModelWithProjection"),rc=m(),ee=s("div"),P(vr.$$.fragment),ku=m(),xl=s("p"),Lu=i("CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)."),Mu=m(),br=s("p"),ju=i("This model inherits from "),ei=s("a"),zu=i("PreTrainedModel"),Eu=i(`. 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.)`),Fu=m(),Pr=s("p"),qu=i("This model is also a PyTorch "),$r=s("a"),Au=i("torch.nn.Module"),Du=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vu=m(),Ie=s("div"),P(Tr.$$.fragment),Ou=m(),Ft=s("p"),Nu=i("The "),ti=s("a"),Wu=i("CLIPVisionModelWithProjection"),Su=i(" forward method, overrides the "),kl=s("code"),Bu=i("__call__"),Ru=i(" special method."),Uu=m(),P(Ho.$$.fragment),Hu=m(),P(Ko.$$.fragment),ac=m(),qt=s("h2"),Go=s("a"),Ll=s("span"),P(yr.$$.fragment),Ku=m(),Ml=s("span"),Gu=i("CLIPVisionModel"),ic=m(),ce=s("div"),P(Ir.$$.fragment),Ju=m(),Cr=s("p"),Xu=i(`The vision model from CLIP without any head or projection on top.
This model inherits from `),oi=s("a"),Yu=i("PreTrainedModel"),Qu=i(`. 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.)`),Zu=m(),wr=s("p"),eg=i("This model is also a PyTorch "),xr=s("a"),tg=i("torch.nn.Module"),og=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ng=m(),Ce=s("div"),P(kr.$$.fragment),sg=m(),At=s("p"),rg=i("The "),ni=s("a"),ag=i("CLIPVisionModel"),ig=i(" forward method, overrides the "),jl=s("code"),lg=i("__call__"),dg=i(" special method."),cg=m(),P(Jo.$$.fragment),pg=m(),P(Xo.$$.fragment),lc=m(),Dt=s("h2"),Yo=s("a"),zl=s("span"),P(Lr.$$.fragment),mg=m(),El=s("span"),hg=i("TFCLIPModel"),dc=m(),N=s("div"),P(Mr.$$.fragment),fg=m(),jr=s("p"),ug=i("This model inherits from "),si=s("a"),gg=i("TFPreTrainedModel"),_g=i(`. 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.)`),vg=m(),zr=s("p"),bg=i("This model is also a "),Er=s("a"),Pg=i("tf.keras.Model"),$g=i(` 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.`),Tg=m(),P(Qo.$$.fragment),yg=m(),we=s("div"),P(Fr.$$.fragment),Ig=m(),Vt=s("p"),Cg=i("The "),ri=s("a"),wg=i("TFCLIPModel"),xg=i(" forward method, overrides the "),Fl=s("code"),kg=i("__call__"),Lg=i(" special method."),Mg=m(),P(Zo.$$.fragment),jg=m(),P(en.$$.fragment),zg=m(),xe=s("div"),P(qr.$$.fragment),Eg=m(),Ot=s("p"),Fg=i("The "),ai=s("a"),qg=i("TFCLIPModel"),Ag=i(" forward method, overrides the "),ql=s("code"),Dg=i("__call__"),Vg=i(" special method."),Og=m(),P(tn.$$.fragment),Ng=m(),P(on.$$.fragment),Wg=m(),ke=s("div"),P(Ar.$$.fragment),Sg=m(),Nt=s("p"),Bg=i("The "),ii=s("a"),Rg=i("TFCLIPModel"),Ug=i(" forward method, overrides the "),Al=s("code"),Hg=i("__call__"),Kg=i(" special method."),Gg=m(),P(nn.$$.fragment),Jg=m(),P(sn.$$.fragment),cc=m(),Wt=s("h2"),rn=s("a"),Dl=s("span"),P(Dr.$$.fragment),Xg=m(),Vl=s("span"),Yg=i("TFCLIPTextModel"),pc=m(),St=s("div"),P(Vr.$$.fragment),Qg=m(),Le=s("div"),P(Or.$$.fragment),Zg=m(),Bt=s("p"),e_=i("The "),li=s("a"),t_=i("TFCLIPTextModel"),o_=i(" forward method, overrides the "),Ol=s("code"),n_=i("__call__"),s_=i(" special method."),r_=m(),P(an.$$.fragment),a_=m(),P(ln.$$.fragment),mc=m(),Rt=s("h2"),dn=s("a"),Nl=s("span"),P(Nr.$$.fragment),i_=m(),Wl=s("span"),l_=i("TFCLIPVisionModel"),hc=m(),Ut=s("div"),P(Wr.$$.fragment),d_=m(),Me=s("div"),P(Sr.$$.fragment),c_=m(),Ht=s("p"),p_=i("The "),di=s("a"),m_=i("TFCLIPVisionModel"),h_=i(" forward method, overrides the "),Sl=s("code"),f_=i("__call__"),u_=i(" special method."),g_=m(),P(cn.$$.fragment),__=m(),P(pn.$$.fragment),fc=m(),Kt=s("h2"),mn=s("a"),Bl=s("span"),P(Br.$$.fragment),v_=m(),Rl=s("span"),b_=i("FlaxCLIPModel"),uc=m(),F=s("div"),P(Rr.$$.fragment),P_=m(),Ur=s("p"),$_=i("This model inherits from "),ci=s("a"),T_=i("FlaxPreTrainedModel"),y_=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),I_=m(),Hr=s("p"),C_=i("This model is also a Flax Linen "),Kr=s("a"),w_=i("flax.linen.Module"),x_=i(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),k_=m(),Ul=s("p"),L_=i("Finally, this model supports inherent JAX features such as:"),M_=m(),Ne=s("ul"),Hl=s("li"),Gr=s("a"),j_=i("Just-In-Time (JIT) compilation"),z_=m(),Kl=s("li"),Jr=s("a"),E_=i("Automatic Differentiation"),F_=m(),Gl=s("li"),Xr=s("a"),q_=i("Vectorization"),A_=m(),Jl=s("li"),Yr=s("a"),D_=i("Parallelization"),V_=m(),je=s("div"),P(Qr.$$.fragment),O_=m(),Gt=s("p"),N_=i("The "),Xl=s("code"),W_=i("FlaxCLIPPreTrainedModel"),S_=i(" forward method, overrides the "),Yl=s("code"),B_=i("__call__"),R_=i(" special method."),U_=m(),P(hn.$$.fragment),H_=m(),P(fn.$$.fragment),K_=m(),un=s("div"),P(Zr.$$.fragment),G_=m(),P(gn.$$.fragment),J_=m(),_n=s("div"),P(ea.$$.fragment),X_=m(),P(vn.$$.fragment),gc=m(),Jt=s("h2"),bn=s("a"),Ql=s("span"),P(ta.$$.fragment),Y_=m(),Zl=s("span"),Q_=i("FlaxCLIPTextModel"),_c=m(),Xt=s("div"),P(oa.$$.fragment),Z_=m(),ze=s("div"),P(na.$$.fragment),ev=m(),Yt=s("p"),tv=i("The "),ed=s("code"),ov=i("FlaxCLIPTextPreTrainedModel"),nv=i(" forward method, overrides the "),td=s("code"),sv=i("__call__"),rv=i(" special method."),av=m(),P(Pn.$$.fragment),iv=m(),P($n.$$.fragment),vc=m(),Qt=s("h2"),Tn=s("a"),od=s("span"),P(sa.$$.fragment),lv=m(),nd=s("span"),dv=i("FlaxCLIPVisionModel"),bc=m(),Zt=s("div"),P(ra.$$.fragment),cv=m(),Ee=s("div"),P(aa.$$.fragment),pv=m(),eo=s("p"),mv=i("The "),sd=s("code"),hv=i("FlaxCLIPVisionPreTrainedModel"),fv=i(" forward method, overrides the "),rd=s("code"),uv=i("__call__"),gv=i(" special method."),_v=m(),P(yn.$$.fragment),vv=m(),P(In.$$.fragment),this.h()},l(t){const g=v$('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(o),b=h(t),u=r(t,"H1",{class:!0});var ia=a(u);p=r(ia,"A",{id:!0,class:!0,href:!0});var ad=a(p);_=r(ad,"SPAN",{});var id=a(_);$(n.$$.fragment,id),id.forEach(o),ad.forEach(o),c=h(ia),x=r(ia,"SPAN",{});var ld=a(x);Kn=l(ld,"CLIP"),ld.forEach(o),ia.forEach(o),oo=h(t),G=r(t,"H2",{class:!0});var la=a(G);pe=r(la,"A",{id:!0,class:!0,href:!0});var dd=a(pe);Se=r(dd,"SPAN",{});var cd=a(Se);$(j.$$.fragment,cd),cd.forEach(o),dd.forEach(o),Gn=h(la),qe=r(la,"SPAN",{});var pd=a(qe);Jn=l(pd,"Overview"),pd.forEach(o),la.forEach(o),no=h(t),te=r(t,"P",{});var da=a(te);Xn=l(da,"The CLIP model was proposed in "),Ae=r(da,"A",{href:!0,rel:!0});var md=a(Ae);tt=l(md,"Learning Transferable Visual Models From Natural Language Supervision"),md.forEach(o),Yn=l(da,` by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh,
Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. CLIP
(Contrastive Language-Image Pre-Training) is a neural network trained on a variety of (image, text) pairs. It can be
instructed in natural language to predict the most relevant text snippet, given an image, without directly optimizing
for the task, similarly to the zero-shot capabilities of GPT-2 and 3.`),da.forEach(o),so=h(t),me=r(t,"P",{});var hd=a(me);Qn=l(hd,"The abstract from the paper is the following:"),hd.forEach(o),ro=h(t),he=r(t,"P",{});var fd=a(he);ot=r(fd,"EM",{});var ud=a(ot);Zn=l(ud,`State-of-the-art computer vision systems are trained to predict a fixed set of predetermined object categories. This
restricted form of supervision limits their generality and usability since additional labeled data is needed to specify
any other visual concept. Learning directly from raw text about images is a promising alternative which leverages a
much broader source of supervision. We demonstrate that the simple pre-training task of predicting which caption goes
with which image is an efficient and scalable way to learn SOTA image representations from scratch on a dataset of 400
million (image, text) pairs collected from the internet. After pre-training, natural language is used to reference
learned visual concepts (or describe new ones) enabling zero-shot transfer of the model to downstream tasks. We study
the performance of this approach by benchmarking on over 30 different existing computer vision datasets, spanning tasks
such as OCR, action recognition in videos, geo-localization, and many types of fine-grained object classification. The
model transfers non-trivially to most tasks and is often competitive with a fully supervised baseline without the need
for any dataset specific training. For instance, we match the accuracy of the original ResNet-50 on ImageNet zero-shot
without needing to use any of the 1.28 million training examples it was trained on. We release our code and pre-trained
model weights at this https URL.`),ud.forEach(o),fd.forEach(o),nt=h(t),A=r(t,"H2",{class:!0});var ca=a(A);W=r(ca,"A",{id:!0,class:!0,href:!0});var gd=a(W);st=r(gd,"SPAN",{});var _d=a(st);$(ae.$$.fragment,_d),_d.forEach(o),gd.forEach(o),es=h(ca),rt=r(ca,"SPAN",{});var vd=a(rt);at=l(vd,"Usage"),vd.forEach(o),ca.forEach(o),ao=h(t),Be=r(t,"P",{});var bd=a(Be);fe=l(bd,`CLIP is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image
classification. CLIP uses a ViT like transformer to get visual features and a causal language model to get the text
features. Both the text and visual features are then projected to a latent space with identical dimension. The dot
product between the projected image and text features is then used as a similar score.`),bd.forEach(o),io=h(t),oe=r(t,"P",{});var pa=a(oe);ts=l(pa,`To feed images to the Transformer encoder, each image is split into a sequence of fixed-size non-overlapping patches,
which are then linearly embedded. A [CLS] token is added to serve as representation of an entire image. The authors
also add absolute position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder.
The `),Re=r(pa,"A",{href:!0});var Pd=a(Re);it=l(Pd,"CLIPFeatureExtractor"),Pd.forEach(o),os=l(pa," can be used to resize (or rescale) and normalize images for the model."),pa.forEach(o),lo=h(t),M=r(t,"P",{});var B=a(M);ns=l(B,"The "),ue=r(B,"A",{href:!0});var $d=a(ue);ss=l($d,"CLIPTokenizer"),$d.forEach(o),co=l(B," is used to encode the text. The "),J=r(B,"A",{href:!0});var Td=a(J);rs=l(Td,"CLIPProcessor"),Td.forEach(o),De=l(B,` wraps
`),Ue=r(B,"A",{href:!0});var yd=a(Ue);as=l(yd,"CLIPFeatureExtractor"),yd.forEach(o),L=l(B," and "),E=r(B,"A",{href:!0});var Id=a(E);ua=l(Id,"CLIPTokenizer"),Id.forEach(o),po=l(B,` into a single instance to both
encode the text and prepare the images. The following example shows how to get the image-text similarity scores using
`),lt=r(B,"A",{href:!0});var Cd=a(lt);ga=l(Cd,"CLIPProcessor"),Cd.forEach(o),R=l(B," and "),dt=r(B,"A",{href:!0});var wd=a(dt);_a=l(wd,"CLIPModel"),wd.forEach(o),va=l(B,"."),B.forEach(o),is=h(t),$(He.$$.fragment,t),Ve=h(t),U=r(t,"P",{});var to=a(U);ba=l(to,"This model was contributed by "),Ke=r(to,"A",{href:!0,rel:!0});var xd=a(Ke);ct=l(xd,"valhalla"),xd.forEach(o),Pa=l(to,". The original code can be found "),Ge=r(to,"A",{href:!0,rel:!0});var kd=a(Ge);ls=l(kd,"here"),kd.forEach(o),$a=l(to,"."),to.forEach(o),pt=h(t),ge=r(t,"H2",{class:!0});var ma=a(ge);mo=r(ma,"A",{id:!0,class:!0,href:!0});var Ld=a(mo);zi=r(Ld,"SPAN",{});var Md=a(zi);$(ds.$$.fragment,Md),Md.forEach(o),Ld.forEach(o),Tp=h(ma),Ei=r(ma,"SPAN",{});var jd=a(Ei);yp=l(jd,"Resources"),jd.forEach(o),ma.forEach(o),Ed=h(t),Ta=r(t,"P",{});var zd=a(Ta);Ip=l(zd,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CLIP."),zd.forEach(o),Fd=h(t),ho=r(t,"UL",{});var ha=a(ho);cs=r(ha,"LI",{});var $c=a(cs);Cp=l($c,"A blog post on "),ps=r($c,"A",{href:!0,rel:!0});var $v=a(ps);wp=l($v,"How to fine-tune CLIP on 10,000 image-text pairs"),$v.forEach(o),xp=l($c,"."),$c.forEach(o),kp=h(ha),ms=r(ha,"LI",{});var Tc=a(ms);Lp=l(Tc,"CLIP is supported by this "),hs=r(Tc,"A",{href:!0,rel:!0});var Tv=a(hs);Mp=l(Tv,"example script"),Tv.forEach(o),jp=l(Tc,"."),Tc.forEach(o),ha.forEach(o),qd=h(t),ya=r(t,"P",{});var yv=a(ya);zp=l(yv,`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),yv.forEach(o),Ad=h(t),mt=r(t,"H2",{class:!0});var yc=a(mt);fo=r(yc,"A",{id:!0,class:!0,href:!0});var Iv=a(fo);Fi=r(Iv,"SPAN",{});var Cv=a(Fi);$(fs.$$.fragment,Cv),Cv.forEach(o),Iv.forEach(o),Ep=h(yc),qi=r(yc,"SPAN",{});var wv=a(qi);Fp=l(wv,"CLIPConfig"),wv.forEach(o),yc.forEach(o),Dd=h(t),X=r(t,"DIV",{class:!0});var Xe=a(X);$(us.$$.fragment,Xe),qp=h(Xe),Je=r(Xe,"P",{});var fa=a(Je);Ia=r(fa,"A",{href:!0});var xv=a(Ia);Ap=l(xv,"CLIPConfig"),xv.forEach(o),Dp=l(fa," is the configuration class to store the configuration of a "),Ca=r(fa,"A",{href:!0});var kv=a(Ca);Vp=l(kv,"CLIPModel"),kv.forEach(o),Op=l(fa,`. It is used to instantiate
a CLIP 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 CLIP
`),gs=r(fa,"A",{href:!0,rel:!0});var Lv=a(gs);Np=l(Lv,"openai/clip-vit-base-patch32"),Lv.forEach(o),Wp=l(fa," architecture."),fa.forEach(o),Sp=h(Xe),ht=r(Xe,"P",{});var pi=a(ht);Bp=l(pi,"Configuration objects inherit from "),wa=r(pi,"A",{href:!0});var Mv=a(wa);Rp=l(Mv,"PretrainedConfig"),Mv.forEach(o),Up=l(pi,` and can be used to control the model outputs. Read the
documentation from `),xa=r(pi,"A",{href:!0});var jv=a(xa);Hp=l(jv,"PretrainedConfig"),jv.forEach(o),Kp=l(pi," for more information."),pi.forEach(o),Gp=h(Xe),$(uo.$$.fragment,Xe),Jp=h(Xe),go=r(Xe,"DIV",{class:!0});var Ic=a(go);$(_s.$$.fragment,Ic),Xp=h(Ic),vs=r(Ic,"P",{});var Cc=a(vs);Yp=l(Cc,"Instantiate a "),ka=r(Cc,"A",{href:!0});var zv=a(ka);Qp=l(zv,"CLIPConfig"),zv.forEach(o),Zp=l(Cc,` (or a derived class) from clip text model configuration and clip vision model
configuration.`),Cc.forEach(o),Ic.forEach(o),Xe.forEach(o),Vd=h(t),ft=r(t,"H2",{class:!0});var wc=a(ft);_o=r(wc,"A",{id:!0,class:!0,href:!0});var Ev=a(_o);Ai=r(Ev,"SPAN",{});var Fv=a(Ai);$(bs.$$.fragment,Fv),Fv.forEach(o),Ev.forEach(o),em=h(wc),Di=r(wc,"SPAN",{});var qv=a(Di);tm=l(qv,"CLIPTextConfig"),qv.forEach(o),wc.forEach(o),Od=h(t),ie=r(t,"DIV",{class:!0});var Cn=a(ie);$(Ps.$$.fragment,Cn),om=h(Cn),ut=r(Cn,"P",{});var mi=a(ut);nm=l(mi,"This is the configuration class to store the configuration of a "),La=r(mi,"A",{href:!0});var Av=a(La);sm=l(Av,"CLIPTextModel"),Av.forEach(o),rm=l(mi,`. It is used to instantiate a CLIP
text encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the text encoder of the CLIP
`),$s=r(mi,"A",{href:!0,rel:!0});var Dv=a($s);am=l(Dv,"openai/clip-vit-base-patch32"),Dv.forEach(o),im=l(mi," architecture."),mi.forEach(o),lm=h(Cn),gt=r(Cn,"P",{});var hi=a(gt);dm=l(hi,"Configuration objects inherit from "),Ma=r(hi,"A",{href:!0});var Vv=a(Ma);cm=l(Vv,"PretrainedConfig"),Vv.forEach(o),pm=l(hi,` and can be used to control the model outputs. Read the
documentation from `),ja=r(hi,"A",{href:!0});var Ov=a(ja);mm=l(Ov,"PretrainedConfig"),Ov.forEach(o),hm=l(hi," for more information."),hi.forEach(o),fm=h(Cn),$(vo.$$.fragment,Cn),Cn.forEach(o),Nd=h(t),_t=r(t,"H2",{class:!0});var xc=a(_t);bo=r(xc,"A",{id:!0,class:!0,href:!0});var Nv=a(bo);Vi=r(Nv,"SPAN",{});var Wv=a(Vi);$(Ts.$$.fragment,Wv),Wv.forEach(o),Nv.forEach(o),um=h(xc),Oi=r(xc,"SPAN",{});var Sv=a(Oi);gm=l(Sv,"CLIPVisionConfig"),Sv.forEach(o),xc.forEach(o),Wd=h(t),le=r(t,"DIV",{class:!0});var wn=a(le);$(ys.$$.fragment,wn),_m=h(wn),vt=r(wn,"P",{});var fi=a(vt);vm=l(fi,"This is the configuration class to store the configuration of a "),za=r(fi,"A",{href:!0});var Bv=a(za);bm=l(Bv,"CLIPVisionModel"),Bv.forEach(o),Pm=l(fi,`. It is used to instantiate a
CLIP vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the CLIP
`),Is=r(fi,"A",{href:!0,rel:!0});var Rv=a(Is);$m=l(Rv,"openai/clip-vit-base-patch32"),Rv.forEach(o),Tm=l(fi," architecture."),fi.forEach(o),ym=h(wn),bt=r(wn,"P",{});var ui=a(bt);Im=l(ui,"Configuration objects inherit from "),Ea=r(ui,"A",{href:!0});var Uv=a(Ea);Cm=l(Uv,"PretrainedConfig"),Uv.forEach(o),wm=l(ui,` and can be used to control the model outputs. Read the
documentation from `),Fa=r(ui,"A",{href:!0});var Hv=a(Fa);xm=l(Hv,"PretrainedConfig"),Hv.forEach(o),km=l(ui," for more information."),ui.forEach(o),Lm=h(wn),$(Po.$$.fragment,wn),wn.forEach(o),Sd=h(t),Pt=r(t,"H2",{class:!0});var kc=a(Pt);$o=r(kc,"A",{id:!0,class:!0,href:!0});var Kv=a($o);Ni=r(Kv,"SPAN",{});var Gv=a(Ni);$(Cs.$$.fragment,Gv),Gv.forEach(o),Kv.forEach(o),Mm=h(kc),Wi=r(kc,"SPAN",{});var Jv=a(Wi);jm=l(Jv,"CLIPTokenizer"),Jv.forEach(o),kc.forEach(o),Bd=h(t),O=r(t,"DIV",{class:!0});var se=a(O);$(ws.$$.fragment,se),zm=h(se),Si=r(se,"P",{});var Xv=a(Si);Em=l(Xv,"Construct a CLIP tokenizer. Based on byte-level Byte-Pair-Encoding."),Xv.forEach(o),Fm=h(se),xs=r(se,"P",{});var Lc=a(xs);qm=l(Lc,"This tokenizer inherits from "),qa=r(Lc,"A",{href:!0});var Yv=a(qa);Am=l(Yv,"PreTrainedTokenizer"),Yv.forEach(o),Dm=l(Lc,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Lc.forEach(o),Vm=h(se),_e=r(se,"DIV",{class:!0});var xn=a(_e);$(ks.$$.fragment,xn),Om=h(xn),Bi=r(xn,"P",{});var Qv=a(Bi);Nm=l(Qv,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),Qv.forEach(o),Wm=h(xn),Ri=r(xn,"UL",{});var Zv=a(Ri);Aa=r(Zv,"LI",{});var bv=a(Aa);Sm=l(bv,"single sequence: "),Ui=r(bv,"CODE",{});var eb=a(Ui);Bm=l(eb,"<|startoftext|> X <|endoftext|>"),eb.forEach(o),bv.forEach(o),Zv.forEach(o),Rm=h(xn),Hi=r(xn,"P",{});var tb=a(Hi);Um=l(tb,"Pairs of sequences are not the expected use case, but they will be handled without a separator."),tb.forEach(o),xn.forEach(o),Hm=h(se),To=r(se,"DIV",{class:!0});var Mc=a(To);$(Ls.$$.fragment,Mc),Km=h(Mc),Ms=r(Mc,"P",{});var jc=a(Ms);Gm=l(jc,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ki=r(jc,"CODE",{});var ob=a(Ki);Jm=l(ob,"prepare_for_model"),ob.forEach(o),Xm=l(jc," method."),jc.forEach(o),Mc.forEach(o),Ym=h(se),yo=r(se,"DIV",{class:!0});var zc=a(yo);$(js.$$.fragment,zc),Qm=h(zc),Gi=r(zc,"P",{});var nb=a(Gi);Zm=l(nb,`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),nb.forEach(o),zc.forEach(o),eh=h(se),Da=r(se,"DIV",{class:!0});var sb=a(Da);$(zs.$$.fragment,sb),sb.forEach(o),se.forEach(o),Rd=h(t),$t=r(t,"H2",{class:!0});var Ec=a($t);Io=r(Ec,"A",{id:!0,class:!0,href:!0});var rb=a(Io);Ji=r(rb,"SPAN",{});var ab=a(Ji);$(Es.$$.fragment,ab),ab.forEach(o),rb.forEach(o),th=h(Ec),Xi=r(Ec,"SPAN",{});var ib=a(Xi);oh=l(ib,"CLIPTokenizerFast"),ib.forEach(o),Ec.forEach(o),Ud=h(t),Y=r(t,"DIV",{class:!0});var Ye=a(Y);$(Fs.$$.fragment,Ye),nh=h(Ye),qs=r(Ye,"P",{});var Fc=a(qs);sh=l(Fc,"Construct a \u201Cfast\u201D CLIP tokenizer (backed by HuggingFace\u2019s "),Yi=r(Fc,"EM",{});var lb=a(Yi);rh=l(lb,"tokenizers"),lb.forEach(o),ah=l(Fc,` library). Based on byte-level
Byte-Pair-Encoding.`),Fc.forEach(o),ih=h(Ye),As=r(Ye,"P",{});var qc=a(As);lh=l(qc,"This tokenizer inherits from "),Va=r(qc,"A",{href:!0});var db=a(Va);dh=l(db,"PreTrainedTokenizerFast"),db.forEach(o),ch=l(qc,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),qc.forEach(o),ph=h(Ye),ve=r(Ye,"DIV",{class:!0});var kn=a(ve);$(Ds.$$.fragment,kn),mh=h(kn),Qi=r(kn,"P",{});var cb=a(Qi);hh=l(cb,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),cb.forEach(o),fh=h(kn),Zi=r(kn,"UL",{});var pb=a(Zi);Oa=r(pb,"LI",{});var Pv=a(Oa);uh=l(Pv,"single sequence: "),el=r(Pv,"CODE",{});var mb=a(el);gh=l(mb,"<|startoftext|> X <|endoftext|>"),mb.forEach(o),Pv.forEach(o),pb.forEach(o),_h=h(kn),tl=r(kn,"P",{});var hb=a(tl);vh=l(hb,"Pairs of sequences are not the expected use case, but they will be handled without a separator."),hb.forEach(o),kn.forEach(o),bh=h(Ye),Co=r(Ye,"DIV",{class:!0});var Ac=a(Co);$(Vs.$$.fragment,Ac),Ph=h(Ac),ol=r(Ac,"P",{});var fb=a(ol);$h=l(fb,`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),fb.forEach(o),Ac.forEach(o),Ye.forEach(o),Hd=h(t),Tt=r(t,"H2",{class:!0});var Dc=a(Tt);wo=r(Dc,"A",{id:!0,class:!0,href:!0});var ub=a(wo);nl=r(ub,"SPAN",{});var gb=a(nl);$(Os.$$.fragment,gb),gb.forEach(o),ub.forEach(o),Th=h(Dc),sl=r(Dc,"SPAN",{});var _b=a(sl);yh=l(_b,"CLIPImageProcessor"),_b.forEach(o),Dc.forEach(o),Kd=h(t),Oe=r(t,"DIV",{class:!0});var gi=a(Oe);$(Ns.$$.fragment,gi),Ih=h(gi),rl=r(gi,"P",{});var vb=a(rl);Ch=l(vb,"Constructs a CLIP image processor."),vb.forEach(o),wh=h(gi),xo=r(gi,"DIV",{class:!0});var Vc=a(xo);$(Ws.$$.fragment,Vc),xh=h(Vc),al=r(Vc,"P",{});var bb=a(al);kh=l(bb,"Preprocess an image or batch of images."),bb.forEach(o),Vc.forEach(o),gi.forEach(o),Gd=h(t),yt=r(t,"H2",{class:!0});var Oc=a(yt);ko=r(Oc,"A",{id:!0,class:!0,href:!0});var Pb=a(ko);il=r(Pb,"SPAN",{});var $b=a(il);$(Ss.$$.fragment,$b),$b.forEach(o),Pb.forEach(o),Lh=h(Oc),ll=r(Oc,"SPAN",{});var Tb=a(ll);Mh=l(Tb,"CLIPFeatureExtractor"),Tb.forEach(o),Oc.forEach(o),Jd=h(t),Bs=r(t,"DIV",{class:!0});var yb=a(Bs);$(Rs.$$.fragment,yb),yb.forEach(o),Xd=h(t),It=r(t,"H2",{class:!0});var Nc=a(It);Lo=r(Nc,"A",{id:!0,class:!0,href:!0});var Ib=a(Lo);dl=r(Ib,"SPAN",{});var Cb=a(dl);$(Us.$$.fragment,Cb),Cb.forEach(o),Ib.forEach(o),jh=h(Nc),cl=r(Nc,"SPAN",{});var wb=a(cl);zh=l(wb,"CLIPProcessor"),wb.forEach(o),Nc.forEach(o),Yd=h(t),Q=r(t,"DIV",{class:!0});var Qe=a(Q);$(Hs.$$.fragment,Qe),Eh=h(Qe),pl=r(Qe,"P",{});var xb=a(pl);Fh=l(xb,"Constructs a CLIP processor which wraps a CLIP image processor and a CLIP tokenizer into a single processor."),xb.forEach(o),qh=h(Qe),ne=r(Qe,"P",{});var We=a(ne);Na=r(We,"A",{href:!0});var kb=a(Na);Ah=l(kb,"CLIPProcessor"),kb.forEach(o),Dh=l(We," offers all the functionalities of "),Wa=r(We,"A",{href:!0});var Lb=a(Wa);Vh=l(Lb,"CLIPImageProcessor"),Lb.forEach(o),Oh=l(We," and "),Sa=r(We,"A",{href:!0});var Mb=a(Sa);Nh=l(Mb,"CLIPTokenizerFast"),Mb.forEach(o),Wh=l(We,`. See the
`),ml=r(We,"CODE",{});var jb=a(ml);Sh=l(jb,"__call__()"),jb.forEach(o),Bh=l(We," and "),Ba=r(We,"A",{href:!0});var zb=a(Ba);Rh=l(zb,"decode()"),zb.forEach(o),Uh=l(We," for more information."),We.forEach(o),Hh=h(Qe),Mo=r(Qe,"DIV",{class:!0});var Wc=a(Mo);$(Ks.$$.fragment,Wc),Kh=h(Wc),Gs=r(Wc,"P",{});var Sc=a(Gs);Gh=l(Sc,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Ra=r(Sc,"A",{href:!0});var Eb=a(Ra);Jh=l(Eb,"batch_decode()"),Eb.forEach(o),Xh=l(Sc,`. Please
refer to the docstring of this method for more information.`),Sc.forEach(o),Wc.forEach(o),Yh=h(Qe),jo=r(Qe,"DIV",{class:!0});var Bc=a(jo);$(Js.$$.fragment,Bc),Qh=h(Bc),Xs=r(Bc,"P",{});var Rc=a(Xs);Zh=l(Rc,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Ua=r(Rc,"A",{href:!0});var Fb=a(Ua);ef=l(Fb,"decode()"),Fb.forEach(o),tf=l(Rc,`. Please refer to
the docstring of this method for more information.`),Rc.forEach(o),Bc.forEach(o),Qe.forEach(o),Qd=h(t),Ct=r(t,"H2",{class:!0});var Uc=a(Ct);zo=r(Uc,"A",{id:!0,class:!0,href:!0});var qb=a(zo);hl=r(qb,"SPAN",{});var Ab=a(hl);$(Ys.$$.fragment,Ab),Ab.forEach(o),qb.forEach(o),of=h(Uc),fl=r(Uc,"SPAN",{});var Db=a(fl);nf=l(Db,"CLIPModel"),Db.forEach(o),Uc.forEach(o),Zd=h(t),S=r(t,"DIV",{class:!0});var Fe=a(S);$(Qs.$$.fragment,Fe),sf=h(Fe),Zs=r(Fe,"P",{});var Hc=a(Zs);rf=l(Hc,"This model inherits from "),Ha=r(Hc,"A",{href:!0});var Vb=a(Ha);af=l(Vb,"PreTrainedModel"),Vb.forEach(o),lf=l(Hc,`. 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.)`),Hc.forEach(o),df=h(Fe),er=r(Fe,"P",{});var Kc=a(er);cf=l(Kc,"This model is also a PyTorch "),tr=r(Kc,"A",{href:!0,rel:!0});var Ob=a(tr);pf=l(Ob,"torch.nn.Module"),Ob.forEach(o),mf=l(Kc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kc.forEach(o),hf=h(Fe),be=r(Fe,"DIV",{class:!0});var Ln=a(be);$(or.$$.fragment,Ln),ff=h(Ln),wt=r(Ln,"P",{});var _i=a(wt);uf=l(_i,"The "),Ka=r(_i,"A",{href:!0});var Nb=a(Ka);gf=l(Nb,"CLIPModel"),Nb.forEach(o),_f=l(_i," forward method, overrides the "),ul=r(_i,"CODE",{});var Wb=a(ul);vf=l(Wb,"__call__"),Wb.forEach(o),bf=l(_i," special method."),_i.forEach(o),Pf=h(Ln),$(Eo.$$.fragment,Ln),$f=h(Ln),$(Fo.$$.fragment,Ln),Ln.forEach(o),Tf=h(Fe),Pe=r(Fe,"DIV",{class:!0});var Mn=a(Pe);$(nr.$$.fragment,Mn),yf=h(Mn),xt=r(Mn,"P",{});var vi=a(xt);If=l(vi,"The "),Ga=r(vi,"A",{href:!0});var Sb=a(Ga);Cf=l(Sb,"CLIPModel"),Sb.forEach(o),wf=l(vi," forward method, overrides the "),gl=r(vi,"CODE",{});var Bb=a(gl);xf=l(Bb,"__call__"),Bb.forEach(o),kf=l(vi," special method."),vi.forEach(o),Lf=h(Mn),$(qo.$$.fragment,Mn),Mf=h(Mn),$(Ao.$$.fragment,Mn),Mn.forEach(o),jf=h(Fe),$e=r(Fe,"DIV",{class:!0});var jn=a($e);$(sr.$$.fragment,jn),zf=h(jn),kt=r(jn,"P",{});var bi=a(kt);Ef=l(bi,"The "),Ja=r(bi,"A",{href:!0});var Rb=a(Ja);Ff=l(Rb,"CLIPModel"),Rb.forEach(o),qf=l(bi," forward method, overrides the "),_l=r(bi,"CODE",{});var Ub=a(_l);Af=l(Ub,"__call__"),Ub.forEach(o),Df=l(bi," special method."),bi.forEach(o),Vf=h(jn),$(Do.$$.fragment,jn),Of=h(jn),$(Vo.$$.fragment,jn),jn.forEach(o),Fe.forEach(o),ec=h(t),Lt=r(t,"H2",{class:!0});var Gc=a(Lt);Oo=r(Gc,"A",{id:!0,class:!0,href:!0});var Hb=a(Oo);vl=r(Hb,"SPAN",{});var Kb=a(vl);$(rr.$$.fragment,Kb),Kb.forEach(o),Hb.forEach(o),Nf=h(Gc),bl=r(Gc,"SPAN",{});var Gb=a(bl);Wf=l(Gb,"CLIPTextModel"),Gb.forEach(o),Gc.forEach(o),tc=h(t),de=r(t,"DIV",{class:!0});var zn=a(de);$(ar.$$.fragment,zn),Sf=h(zn),ir=r(zn,"P",{});var Jc=a(ir);Bf=l(Jc,`The text model from CLIP without any head or projection on top.
This model inherits from `),Xa=r(Jc,"A",{href:!0});var Jb=a(Xa);Rf=l(Jb,"PreTrainedModel"),Jb.forEach(o),Uf=l(Jc,`. 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.)`),Jc.forEach(o),Hf=h(zn),lr=r(zn,"P",{});var Xc=a(lr);Kf=l(Xc,"This model is also a PyTorch "),dr=r(Xc,"A",{href:!0,rel:!0});var Xb=a(dr);Gf=l(Xb,"torch.nn.Module"),Xb.forEach(o),Jf=l(Xc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xc.forEach(o),Xf=h(zn),Te=r(zn,"DIV",{class:!0});var En=a(Te);$(cr.$$.fragment,En),Yf=h(En),Mt=r(En,"P",{});var Pi=a(Mt);Qf=l(Pi,"The "),Ya=r(Pi,"A",{href:!0});var Yb=a(Ya);Zf=l(Yb,"CLIPTextModel"),Yb.forEach(o),eu=l(Pi," forward method, overrides the "),Pl=r(Pi,"CODE",{});var Qb=a(Pl);tu=l(Qb,"__call__"),Qb.forEach(o),ou=l(Pi," special method."),Pi.forEach(o),nu=h(En),$(No.$$.fragment,En),su=h(En),$(Wo.$$.fragment,En),En.forEach(o),zn.forEach(o),oc=h(t),jt=r(t,"H2",{class:!0});var Yc=a(jt);So=r(Yc,"A",{id:!0,class:!0,href:!0});var Zb=a(So);$l=r(Zb,"SPAN",{});var eP=a($l);$(pr.$$.fragment,eP),eP.forEach(o),Zb.forEach(o),ru=h(Yc),Tl=r(Yc,"SPAN",{});var tP=a(Tl);au=l(tP,"CLIPTextModelWithProjection"),tP.forEach(o),Yc.forEach(o),nc=h(t),Z=r(t,"DIV",{class:!0});var Ze=a(Z);$(mr.$$.fragment,Ze),iu=h(Ze),yl=r(Ze,"P",{});var oP=a(yl);lu=l(oP,"CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)."),oP.forEach(o),du=h(Ze),hr=r(Ze,"P",{});var Qc=a(hr);cu=l(Qc,"This model inherits from "),Qa=r(Qc,"A",{href:!0});var nP=a(Qa);pu=l(nP,"PreTrainedModel"),nP.forEach(o),mu=l(Qc,`. 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.)`),Qc.forEach(o),hu=h(Ze),fr=r(Ze,"P",{});var Zc=a(fr);fu=l(Zc,"This model is also a PyTorch "),ur=r(Zc,"A",{href:!0,rel:!0});var sP=a(ur);uu=l(sP,"torch.nn.Module"),sP.forEach(o),gu=l(Zc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zc.forEach(o),_u=h(Ze),ye=r(Ze,"DIV",{class:!0});var Fn=a(ye);$(gr.$$.fragment,Fn),vu=h(Fn),zt=r(Fn,"P",{});var $i=a(zt);bu=l($i,"The "),Za=r($i,"A",{href:!0});var rP=a(Za);Pu=l(rP,"CLIPTextModelWithProjection"),rP.forEach(o),$u=l($i," forward method, overrides the "),Il=r($i,"CODE",{});var aP=a(Il);Tu=l(aP,"__call__"),aP.forEach(o),yu=l($i," special method."),$i.forEach(o),Iu=h(Fn),$(Bo.$$.fragment,Fn),Cu=h(Fn),$(Ro.$$.fragment,Fn),Fn.forEach(o),Ze.forEach(o),sc=h(t),Et=r(t,"H2",{class:!0});var ep=a(Et);Uo=r(ep,"A",{id:!0,class:!0,href:!0});var iP=a(Uo);Cl=r(iP,"SPAN",{});var lP=a(Cl);$(_r.$$.fragment,lP),lP.forEach(o),iP.forEach(o),wu=h(ep),wl=r(ep,"SPAN",{});var dP=a(wl);xu=l(dP,"CLIPVisionModelWithProjection"),dP.forEach(o),ep.forEach(o),rc=h(t),ee=r(t,"DIV",{class:!0});var et=a(ee);$(vr.$$.fragment,et),ku=h(et),xl=r(et,"P",{});var cP=a(xl);Lu=l(cP,"CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)."),cP.forEach(o),Mu=h(et),br=r(et,"P",{});var tp=a(br);ju=l(tp,"This model inherits from "),ei=r(tp,"A",{href:!0});var pP=a(ei);zu=l(pP,"PreTrainedModel"),pP.forEach(o),Eu=l(tp,`. 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.)`),tp.forEach(o),Fu=h(et),Pr=r(et,"P",{});var op=a(Pr);qu=l(op,"This model is also a PyTorch "),$r=r(op,"A",{href:!0,rel:!0});var mP=a($r);Au=l(mP,"torch.nn.Module"),mP.forEach(o),Du=l(op,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),op.forEach(o),Vu=h(et),Ie=r(et,"DIV",{class:!0});var qn=a(Ie);$(Tr.$$.fragment,qn),Ou=h(qn),Ft=r(qn,"P",{});var Ti=a(Ft);Nu=l(Ti,"The "),ti=r(Ti,"A",{href:!0});var hP=a(ti);Wu=l(hP,"CLIPVisionModelWithProjection"),hP.forEach(o),Su=l(Ti," forward method, overrides the "),kl=r(Ti,"CODE",{});var fP=a(kl);Bu=l(fP,"__call__"),fP.forEach(o),Ru=l(Ti," special method."),Ti.forEach(o),Uu=h(qn),$(Ho.$$.fragment,qn),Hu=h(qn),$(Ko.$$.fragment,qn),qn.forEach(o),et.forEach(o),ac=h(t),qt=r(t,"H2",{class:!0});var np=a(qt);Go=r(np,"A",{id:!0,class:!0,href:!0});var uP=a(Go);Ll=r(uP,"SPAN",{});var gP=a(Ll);$(yr.$$.fragment,gP),gP.forEach(o),uP.forEach(o),Ku=h(np),Ml=r(np,"SPAN",{});var _P=a(Ml);Gu=l(_P,"CLIPVisionModel"),_P.forEach(o),np.forEach(o),ic=h(t),ce=r(t,"DIV",{class:!0});var An=a(ce);$(Ir.$$.fragment,An),Ju=h(An),Cr=r(An,"P",{});var sp=a(Cr);Xu=l(sp,`The vision model from CLIP without any head or projection on top.
This model inherits from `),oi=r(sp,"A",{href:!0});var vP=a(oi);Yu=l(vP,"PreTrainedModel"),vP.forEach(o),Qu=l(sp,`. 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.)`),sp.forEach(o),Zu=h(An),wr=r(An,"P",{});var rp=a(wr);eg=l(rp,"This model is also a PyTorch "),xr=r(rp,"A",{href:!0,rel:!0});var bP=a(xr);tg=l(bP,"torch.nn.Module"),bP.forEach(o),og=l(rp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rp.forEach(o),ng=h(An),Ce=r(An,"DIV",{class:!0});var Dn=a(Ce);$(kr.$$.fragment,Dn),sg=h(Dn),At=r(Dn,"P",{});var yi=a(At);rg=l(yi,"The "),ni=r(yi,"A",{href:!0});var PP=a(ni);ag=l(PP,"CLIPVisionModel"),PP.forEach(o),ig=l(yi," forward method, overrides the "),jl=r(yi,"CODE",{});var $P=a(jl);lg=l($P,"__call__"),$P.forEach(o),dg=l(yi," special method."),yi.forEach(o),cg=h(Dn),$(Jo.$$.fragment,Dn),pg=h(Dn),$(Xo.$$.fragment,Dn),Dn.forEach(o),An.forEach(o),lc=h(t),Dt=r(t,"H2",{class:!0});var ap=a(Dt);Yo=r(ap,"A",{id:!0,class:!0,href:!0});var TP=a(Yo);zl=r(TP,"SPAN",{});var yP=a(zl);$(Lr.$$.fragment,yP),yP.forEach(o),TP.forEach(o),mg=h(ap),El=r(ap,"SPAN",{});var IP=a(El);hg=l(IP,"TFCLIPModel"),IP.forEach(o),ap.forEach(o),dc=h(t),N=r(t,"DIV",{class:!0});var re=a(N);$(Mr.$$.fragment,re),fg=h(re),jr=r(re,"P",{});var ip=a(jr);ug=l(ip,"This model inherits from "),si=r(ip,"A",{href:!0});var CP=a(si);gg=l(CP,"TFPreTrainedModel"),CP.forEach(o),_g=l(ip,`. 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.)`),ip.forEach(o),vg=h(re),zr=r(re,"P",{});var lp=a(zr);bg=l(lp,"This model is also a "),Er=r(lp,"A",{href:!0,rel:!0});var wP=a(Er);Pg=l(wP,"tf.keras.Model"),wP.forEach(o),$g=l(lp,` 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.`),lp.forEach(o),Tg=h(re),$(Qo.$$.fragment,re),yg=h(re),we=r(re,"DIV",{class:!0});var Vn=a(we);$(Fr.$$.fragment,Vn),Ig=h(Vn),Vt=r(Vn,"P",{});var Ii=a(Vt);Cg=l(Ii,"The "),ri=r(Ii,"A",{href:!0});var xP=a(ri);wg=l(xP,"TFCLIPModel"),xP.forEach(o),xg=l(Ii," forward method, overrides the "),Fl=r(Ii,"CODE",{});var kP=a(Fl);kg=l(kP,"__call__"),kP.forEach(o),Lg=l(Ii," special method."),Ii.forEach(o),Mg=h(Vn),$(Zo.$$.fragment,Vn),jg=h(Vn),$(en.$$.fragment,Vn),Vn.forEach(o),zg=h(re),xe=r(re,"DIV",{class:!0});var On=a(xe);$(qr.$$.fragment,On),Eg=h(On),Ot=r(On,"P",{});var Ci=a(Ot);Fg=l(Ci,"The "),ai=r(Ci,"A",{href:!0});var LP=a(ai);qg=l(LP,"TFCLIPModel"),LP.forEach(o),Ag=l(Ci," forward method, overrides the "),ql=r(Ci,"CODE",{});var MP=a(ql);Dg=l(MP,"__call__"),MP.forEach(o),Vg=l(Ci," special method."),Ci.forEach(o),Og=h(On),$(tn.$$.fragment,On),Ng=h(On),$(on.$$.fragment,On),On.forEach(o),Wg=h(re),ke=r(re,"DIV",{class:!0});var Nn=a(ke);$(Ar.$$.fragment,Nn),Sg=h(Nn),Nt=r(Nn,"P",{});var wi=a(Nt);Bg=l(wi,"The "),ii=r(wi,"A",{href:!0});var jP=a(ii);Rg=l(jP,"TFCLIPModel"),jP.forEach(o),Ug=l(wi," forward method, overrides the "),Al=r(wi,"CODE",{});var zP=a(Al);Hg=l(zP,"__call__"),zP.forEach(o),Kg=l(wi," special method."),wi.forEach(o),Gg=h(Nn),$(nn.$$.fragment,Nn),Jg=h(Nn),$(sn.$$.fragment,Nn),Nn.forEach(o),re.forEach(o),cc=h(t),Wt=r(t,"H2",{class:!0});var dp=a(Wt);rn=r(dp,"A",{id:!0,class:!0,href:!0});var EP=a(rn);Dl=r(EP,"SPAN",{});var FP=a(Dl);$(Dr.$$.fragment,FP),FP.forEach(o),EP.forEach(o),Xg=h(dp),Vl=r(dp,"SPAN",{});var qP=a(Vl);Yg=l(qP,"TFCLIPTextModel"),qP.forEach(o),dp.forEach(o),pc=h(t),St=r(t,"DIV",{class:!0});var cp=a(St);$(Vr.$$.fragment,cp),Qg=h(cp),Le=r(cp,"DIV",{class:!0});var Wn=a(Le);$(Or.$$.fragment,Wn),Zg=h(Wn),Bt=r(Wn,"P",{});var xi=a(Bt);e_=l(xi,"The "),li=r(xi,"A",{href:!0});var AP=a(li);t_=l(AP,"TFCLIPTextModel"),AP.forEach(o),o_=l(xi," forward method, overrides the "),Ol=r(xi,"CODE",{});var DP=a(Ol);n_=l(DP,"__call__"),DP.forEach(o),s_=l(xi," special method."),xi.forEach(o),r_=h(Wn),$(an.$$.fragment,Wn),a_=h(Wn),$(ln.$$.fragment,Wn),Wn.forEach(o),cp.forEach(o),mc=h(t),Rt=r(t,"H2",{class:!0});var pp=a(Rt);dn=r(pp,"A",{id:!0,class:!0,href:!0});var VP=a(dn);Nl=r(VP,"SPAN",{});var OP=a(Nl);$(Nr.$$.fragment,OP),OP.forEach(o),VP.forEach(o),i_=h(pp),Wl=r(pp,"SPAN",{});var NP=a(Wl);l_=l(NP,"TFCLIPVisionModel"),NP.forEach(o),pp.forEach(o),hc=h(t),Ut=r(t,"DIV",{class:!0});var mp=a(Ut);$(Wr.$$.fragment,mp),d_=h(mp),Me=r(mp,"DIV",{class:!0});var Sn=a(Me);$(Sr.$$.fragment,Sn),c_=h(Sn),Ht=r(Sn,"P",{});var ki=a(Ht);p_=l(ki,"The "),di=r(ki,"A",{href:!0});var WP=a(di);m_=l(WP,"TFCLIPVisionModel"),WP.forEach(o),h_=l(ki," forward method, overrides the "),Sl=r(ki,"CODE",{});var SP=a(Sl);f_=l(SP,"__call__"),SP.forEach(o),u_=l(ki," special method."),ki.forEach(o),g_=h(Sn),$(cn.$$.fragment,Sn),__=h(Sn),$(pn.$$.fragment,Sn),Sn.forEach(o),mp.forEach(o),fc=h(t),Kt=r(t,"H2",{class:!0});var hp=a(Kt);mn=r(hp,"A",{id:!0,class:!0,href:!0});var BP=a(mn);Bl=r(BP,"SPAN",{});var RP=a(Bl);$(Br.$$.fragment,RP),RP.forEach(o),BP.forEach(o),v_=h(hp),Rl=r(hp,"SPAN",{});var UP=a(Rl);b_=l(UP,"FlaxCLIPModel"),UP.forEach(o),hp.forEach(o),uc=h(t),F=r(t,"DIV",{class:!0});var H=a(F);$(Rr.$$.fragment,H),P_=h(H),Ur=r(H,"P",{});var fp=a(Ur);$_=l(fp,"This model inherits from "),ci=r(fp,"A",{href:!0});var HP=a(ci);T_=l(HP,"FlaxPreTrainedModel"),HP.forEach(o),y_=l(fp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),fp.forEach(o),I_=h(H),Hr=r(H,"P",{});var up=a(Hr);C_=l(up,"This model is also a Flax Linen "),Kr=r(up,"A",{href:!0,rel:!0});var KP=a(Kr);w_=l(KP,"flax.linen.Module"),KP.forEach(o),x_=l(up,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),up.forEach(o),k_=h(H),Ul=r(H,"P",{});var GP=a(Ul);L_=l(GP,"Finally, this model supports inherent JAX features such as:"),GP.forEach(o),M_=h(H),Ne=r(H,"UL",{});var Bn=a(Ne);Hl=r(Bn,"LI",{});var JP=a(Hl);Gr=r(JP,"A",{href:!0,rel:!0});var XP=a(Gr);j_=l(XP,"Just-In-Time (JIT) compilation"),XP.forEach(o),JP.forEach(o),z_=h(Bn),Kl=r(Bn,"LI",{});var YP=a(Kl);Jr=r(YP,"A",{href:!0,rel:!0});var QP=a(Jr);E_=l(QP,"Automatic Differentiation"),QP.forEach(o),YP.forEach(o),F_=h(Bn),Gl=r(Bn,"LI",{});var ZP=a(Gl);Xr=r(ZP,"A",{href:!0,rel:!0});var e$=a(Xr);q_=l(e$,"Vectorization"),e$.forEach(o),ZP.forEach(o),A_=h(Bn),Jl=r(Bn,"LI",{});var t$=a(Jl);Yr=r(t$,"A",{href:!0,rel:!0});var o$=a(Yr);D_=l(o$,"Parallelization"),o$.forEach(o),t$.forEach(o),Bn.forEach(o),V_=h(H),je=r(H,"DIV",{class:!0});var Rn=a(je);$(Qr.$$.fragment,Rn),O_=h(Rn),Gt=r(Rn,"P",{});var Li=a(Gt);N_=l(Li,"The "),Xl=r(Li,"CODE",{});var n$=a(Xl);W_=l(n$,"FlaxCLIPPreTrainedModel"),n$.forEach(o),S_=l(Li," forward method, overrides the "),Yl=r(Li,"CODE",{});var s$=a(Yl);B_=l(s$,"__call__"),s$.forEach(o),R_=l(Li," special method."),Li.forEach(o),U_=h(Rn),$(hn.$$.fragment,Rn),H_=h(Rn),$(fn.$$.fragment,Rn),Rn.forEach(o),K_=h(H),un=r(H,"DIV",{class:!0});var gp=a(un);$(Zr.$$.fragment,gp),G_=h(gp),$(gn.$$.fragment,gp),gp.forEach(o),J_=h(H),_n=r(H,"DIV",{class:!0});var _p=a(_n);$(ea.$$.fragment,_p),X_=h(_p),$(vn.$$.fragment,_p),_p.forEach(o),H.forEach(o),gc=h(t),Jt=r(t,"H2",{class:!0});var vp=a(Jt);bn=r(vp,"A",{id:!0,class:!0,href:!0});var r$=a(bn);Ql=r(r$,"SPAN",{});var a$=a(Ql);$(ta.$$.fragment,a$),a$.forEach(o),r$.forEach(o),Y_=h(vp),Zl=r(vp,"SPAN",{});var i$=a(Zl);Q_=l(i$,"FlaxCLIPTextModel"),i$.forEach(o),vp.forEach(o),_c=h(t),Xt=r(t,"DIV",{class:!0});var bp=a(Xt);$(oa.$$.fragment,bp),Z_=h(bp),ze=r(bp,"DIV",{class:!0});var Un=a(ze);$(na.$$.fragment,Un),ev=h(Un),Yt=r(Un,"P",{});var Mi=a(Yt);tv=l(Mi,"The "),ed=r(Mi,"CODE",{});var l$=a(ed);ov=l(l$,"FlaxCLIPTextPreTrainedModel"),l$.forEach(o),nv=l(Mi," forward method, overrides the "),td=r(Mi,"CODE",{});var d$=a(td);sv=l(d$,"__call__"),d$.forEach(o),rv=l(Mi," special method."),Mi.forEach(o),av=h(Un),$(Pn.$$.fragment,Un),iv=h(Un),$($n.$$.fragment,Un),Un.forEach(o),bp.forEach(o),vc=h(t),Qt=r(t,"H2",{class:!0});var Pp=a(Qt);Tn=r(Pp,"A",{id:!0,class:!0,href:!0});var c$=a(Tn);od=r(c$,"SPAN",{});var p$=a(od);$(sa.$$.fragment,p$),p$.forEach(o),c$.forEach(o),lv=h(Pp),nd=r(Pp,"SPAN",{});var m$=a(nd);dv=l(m$,"FlaxCLIPVisionModel"),m$.forEach(o),Pp.forEach(o),bc=h(t),Zt=r(t,"DIV",{class:!0});var $p=a(Zt);$(ra.$$.fragment,$p),cv=h($p),Ee=r($p,"DIV",{class:!0});var Hn=a(Ee);$(aa.$$.fragment,Hn),pv=h(Hn),eo=r(Hn,"P",{});var ji=a(eo);mv=l(ji,"The "),sd=r(ji,"CODE",{});var h$=a(sd);hv=l(h$,"FlaxCLIPVisionPreTrainedModel"),h$.forEach(o),fv=l(ji," forward method, overrides the "),rd=r(ji,"CODE",{});var f$=a(rd);uv=l(f$,"__call__"),f$.forEach(o),gv=l(ji," special method."),ji.forEach(o),_v=h(Hn),$(yn.$$.fragment,Hn),vv=h(Hn),$(In.$$.fragment,Hn),Hn.forEach(o),$p.forEach(o),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(n2)),f(p,"id","clip"),f(p,"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"),f(p,"href","#clip"),f(u,"class","relative group"),f(pe,"id","overview"),f(pe,"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"),f(pe,"href","#overview"),f(G,"class","relative group"),f(Ae,"href","https://arxiv.org/abs/2103.00020"),f(Ae,"rel","nofollow"),f(W,"id","usage"),f(W,"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"),f(W,"href","#usage"),f(A,"class","relative group"),f(Re,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPFeatureExtractor"),f(ue,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTokenizer"),f(J,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPProcessor"),f(Ue,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPFeatureExtractor"),f(E,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTokenizer"),f(lt,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPProcessor"),f(dt,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPModel"),f(Ke,"href","https://huggingface.co/valhalla"),f(Ke,"rel","nofollow"),f(Ge,"href","https://github.com/openai/CLIP"),f(Ge,"rel","nofollow"),f(mo,"id","resources"),f(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"),f(mo,"href","#resources"),f(ge,"class","relative group"),f(ps,"href","https://huggingface.co/blog/fine-tune-clip-rsicd"),f(ps,"rel","nofollow"),f(hs,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text"),f(hs,"rel","nofollow"),f(fo,"id","transformers.CLIPConfig"),f(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"),f(fo,"href","#transformers.CLIPConfig"),f(mt,"class","relative group"),f(Ia,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig"),f(Ca,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPModel"),f(gs,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(gs,"rel","nofollow"),f(wa,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(xa,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(ka,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPConfig"),f(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_o,"id","transformers.CLIPTextConfig"),f(_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"),f(_o,"href","#transformers.CLIPTextConfig"),f(ft,"class","relative group"),f(La,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextModel"),f($s,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f($s,"rel","nofollow"),f(Ma,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(ja,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(bo,"id","transformers.CLIPVisionConfig"),f(bo,"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"),f(bo,"href","#transformers.CLIPVisionConfig"),f(_t,"class","relative group"),f(za,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionModel"),f(Is,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(Is,"rel","nofollow"),f(Ea,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(Fa,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f($o,"id","transformers.CLIPTokenizer"),f($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"),f($o,"href","#transformers.CLIPTokenizer"),f(Pt,"class","relative group"),f(qa,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),f(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Da,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Io,"id","transformers.CLIPTokenizerFast"),f(Io,"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"),f(Io,"href","#transformers.CLIPTokenizerFast"),f($t,"class","relative group"),f(Va,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),f(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(wo,"id","transformers.CLIPImageProcessor"),f(wo,"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"),f(wo,"href","#transformers.CLIPImageProcessor"),f(Tt,"class","relative group"),f(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ko,"id","transformers.CLIPFeatureExtractor"),f(ko,"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"),f(ko,"href","#transformers.CLIPFeatureExtractor"),f(yt,"class","relative group"),f(Bs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Lo,"id","transformers.CLIPProcessor"),f(Lo,"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"),f(Lo,"href","#transformers.CLIPProcessor"),f(It,"class","relative group"),f(Na,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPProcessor"),f(Wa,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPImageProcessor"),f(Sa,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTokenizerFast"),f(Ba,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPProcessor.decode"),f(Ra,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),f(Mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ua,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),f(jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(zo,"id","transformers.CLIPModel"),f(zo,"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"),f(zo,"href","#transformers.CLIPModel"),f(Ct,"class","relative group"),f(Ha,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),f(tr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(tr,"rel","nofollow"),f(Ka,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPModel"),f(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ga,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPModel"),f(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ja,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPModel"),f($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Oo,"id","transformers.CLIPTextModel"),f(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"),f(Oo,"href","#transformers.CLIPTextModel"),f(Lt,"class","relative group"),f(Xa,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),f(dr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(dr,"rel","nofollow"),f(Ya,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextModel"),f(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(So,"id","transformers.CLIPTextModelWithProjection"),f(So,"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"),f(So,"href","#transformers.CLIPTextModelWithProjection"),f(jt,"class","relative group"),f(Qa,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),f(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ur,"rel","nofollow"),f(Za,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPTextModelWithProjection"),f(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Uo,"id","transformers.CLIPVisionModelWithProjection"),f(Uo,"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"),f(Uo,"href","#transformers.CLIPVisionModelWithProjection"),f(Et,"class","relative group"),f(ei,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),f($r,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f($r,"rel","nofollow"),f(ti,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionModelWithProjection"),f(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Go,"id","transformers.CLIPVisionModel"),f(Go,"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"),f(Go,"href","#transformers.CLIPVisionModel"),f(qt,"class","relative group"),f(oi,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),f(xr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(xr,"rel","nofollow"),f(ni,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPVisionModel"),f(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Yo,"id","transformers.TFCLIPModel"),f(Yo,"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"),f(Yo,"href","#transformers.TFCLIPModel"),f(Dt,"class","relative group"),f(si,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),f(Er,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Er,"rel","nofollow"),f(ri,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPModel"),f(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ai,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPModel"),f(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ii,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPModel"),f(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rn,"id","transformers.TFCLIPTextModel"),f(rn,"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"),f(rn,"href","#transformers.TFCLIPTextModel"),f(Wt,"class","relative group"),f(li,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPTextModel"),f(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(dn,"id","transformers.TFCLIPVisionModel"),f(dn,"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"),f(dn,"href","#transformers.TFCLIPVisionModel"),f(Rt,"class","relative group"),f(di,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.TFCLIPVisionModel"),f(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mn,"id","transformers.FlaxCLIPModel"),f(mn,"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"),f(mn,"href","#transformers.FlaxCLIPModel"),f(Kt,"class","relative group"),f(ci,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),f(Kr,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),f(Kr,"rel","nofollow"),f(Gr,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),f(Gr,"rel","nofollow"),f(Jr,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),f(Jr,"rel","nofollow"),f(Xr,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),f(Xr,"rel","nofollow"),f(Yr,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),f(Yr,"rel","nofollow"),f(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(bn,"id","transformers.FlaxCLIPTextModel"),f(bn,"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"),f(bn,"href","#transformers.FlaxCLIPTextModel"),f(Jt,"class","relative group"),f(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Tn,"id","transformers.FlaxCLIPVisionModel"),f(Tn,"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"),f(Tn,"href","#transformers.FlaxCLIPVisionModel"),f(Qt,"class","relative group"),f(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),v(t,b,g),v(t,u,g),e(u,p),e(p,_),T(n,_,null),e(u,c),e(u,x),e(x,Kn),v(t,oo,g),v(t,G,g),e(G,pe),e(pe,Se),T(j,Se,null),e(G,Gn),e(G,qe),e(qe,Jn),v(t,no,g),v(t,te,g),e(te,Xn),e(te,Ae),e(Ae,tt),e(te,Yn),v(t,so,g),v(t,me,g),e(me,Qn),v(t,ro,g),v(t,he,g),e(he,ot),e(ot,Zn),v(t,nt,g),v(t,A,g),e(A,W),e(W,st),T(ae,st,null),e(A,es),e(A,rt),e(rt,at),v(t,ao,g),v(t,Be,g),e(Be,fe),v(t,io,g),v(t,oe,g),e(oe,ts),e(oe,Re),e(Re,it),e(oe,os),v(t,lo,g),v(t,M,g),e(M,ns),e(M,ue),e(ue,ss),e(M,co),e(M,J),e(J,rs),e(M,De),e(M,Ue),e(Ue,as),e(M,L),e(M,E),e(E,ua),e(M,po),e(M,lt),e(lt,ga),e(M,R),e(M,dt),e(dt,_a),e(M,va),v(t,is,g),T(He,t,g),v(t,Ve,g),v(t,U,g),e(U,ba),e(U,Ke),e(Ke,ct),e(U,Pa),e(U,Ge),e(Ge,ls),e(U,$a),v(t,pt,g),v(t,ge,g),e(ge,mo),e(mo,zi),T(ds,zi,null),e(ge,Tp),e(ge,Ei),e(Ei,yp),v(t,Ed,g),v(t,Ta,g),e(Ta,Ip),v(t,Fd,g),v(t,ho,g),e(ho,cs),e(cs,Cp),e(cs,ps),e(ps,wp),e(cs,xp),e(ho,kp),e(ho,ms),e(ms,Lp),e(ms,hs),e(hs,Mp),e(ms,jp),v(t,qd,g),v(t,ya,g),e(ya,zp),v(t,Ad,g),v(t,mt,g),e(mt,fo),e(fo,Fi),T(fs,Fi,null),e(mt,Ep),e(mt,qi),e(qi,Fp),v(t,Dd,g),v(t,X,g),T(us,X,null),e(X,qp),e(X,Je),e(Je,Ia),e(Ia,Ap),e(Je,Dp),e(Je,Ca),e(Ca,Vp),e(Je,Op),e(Je,gs),e(gs,Np),e(Je,Wp),e(X,Sp),e(X,ht),e(ht,Bp),e(ht,wa),e(wa,Rp),e(ht,Up),e(ht,xa),e(xa,Hp),e(ht,Kp),e(X,Gp),T(uo,X,null),e(X,Jp),e(X,go),T(_s,go,null),e(go,Xp),e(go,vs),e(vs,Yp),e(vs,ka),e(ka,Qp),e(vs,Zp),v(t,Vd,g),v(t,ft,g),e(ft,_o),e(_o,Ai),T(bs,Ai,null),e(ft,em),e(ft,Di),e(Di,tm),v(t,Od,g),v(t,ie,g),T(Ps,ie,null),e(ie,om),e(ie,ut),e(ut,nm),e(ut,La),e(La,sm),e(ut,rm),e(ut,$s),e($s,am),e(ut,im),e(ie,lm),e(ie,gt),e(gt,dm),e(gt,Ma),e(Ma,cm),e(gt,pm),e(gt,ja),e(ja,mm),e(gt,hm),e(ie,fm),T(vo,ie,null),v(t,Nd,g),v(t,_t,g),e(_t,bo),e(bo,Vi),T(Ts,Vi,null),e(_t,um),e(_t,Oi),e(Oi,gm),v(t,Wd,g),v(t,le,g),T(ys,le,null),e(le,_m),e(le,vt),e(vt,vm),e(vt,za),e(za,bm),e(vt,Pm),e(vt,Is),e(Is,$m),e(vt,Tm),e(le,ym),e(le,bt),e(bt,Im),e(bt,Ea),e(Ea,Cm),e(bt,wm),e(bt,Fa),e(Fa,xm),e(bt,km),e(le,Lm),T(Po,le,null),v(t,Sd,g),v(t,Pt,g),e(Pt,$o),e($o,Ni),T(Cs,Ni,null),e(Pt,Mm),e(Pt,Wi),e(Wi,jm),v(t,Bd,g),v(t,O,g),T(ws,O,null),e(O,zm),e(O,Si),e(Si,Em),e(O,Fm),e(O,xs),e(xs,qm),e(xs,qa),e(qa,Am),e(xs,Dm),e(O,Vm),e(O,_e),T(ks,_e,null),e(_e,Om),e(_e,Bi),e(Bi,Nm),e(_e,Wm),e(_e,Ri),e(Ri,Aa),e(Aa,Sm),e(Aa,Ui),e(Ui,Bm),e(_e,Rm),e(_e,Hi),e(Hi,Um),e(O,Hm),e(O,To),T(Ls,To,null),e(To,Km),e(To,Ms),e(Ms,Gm),e(Ms,Ki),e(Ki,Jm),e(Ms,Xm),e(O,Ym),e(O,yo),T(js,yo,null),e(yo,Qm),e(yo,Gi),e(Gi,Zm),e(O,eh),e(O,Da),T(zs,Da,null),v(t,Rd,g),v(t,$t,g),e($t,Io),e(Io,Ji),T(Es,Ji,null),e($t,th),e($t,Xi),e(Xi,oh),v(t,Ud,g),v(t,Y,g),T(Fs,Y,null),e(Y,nh),e(Y,qs),e(qs,sh),e(qs,Yi),e(Yi,rh),e(qs,ah),e(Y,ih),e(Y,As),e(As,lh),e(As,Va),e(Va,dh),e(As,ch),e(Y,ph),e(Y,ve),T(Ds,ve,null),e(ve,mh),e(ve,Qi),e(Qi,hh),e(ve,fh),e(ve,Zi),e(Zi,Oa),e(Oa,uh),e(Oa,el),e(el,gh),e(ve,_h),e(ve,tl),e(tl,vh),e(Y,bh),e(Y,Co),T(Vs,Co,null),e(Co,Ph),e(Co,ol),e(ol,$h),v(t,Hd,g),v(t,Tt,g),e(Tt,wo),e(wo,nl),T(Os,nl,null),e(Tt,Th),e(Tt,sl),e(sl,yh),v(t,Kd,g),v(t,Oe,g),T(Ns,Oe,null),e(Oe,Ih),e(Oe,rl),e(rl,Ch),e(Oe,wh),e(Oe,xo),T(Ws,xo,null),e(xo,xh),e(xo,al),e(al,kh),v(t,Gd,g),v(t,yt,g),e(yt,ko),e(ko,il),T(Ss,il,null),e(yt,Lh),e(yt,ll),e(ll,Mh),v(t,Jd,g),v(t,Bs,g),T(Rs,Bs,null),v(t,Xd,g),v(t,It,g),e(It,Lo),e(Lo,dl),T(Us,dl,null),e(It,jh),e(It,cl),e(cl,zh),v(t,Yd,g),v(t,Q,g),T(Hs,Q,null),e(Q,Eh),e(Q,pl),e(pl,Fh),e(Q,qh),e(Q,ne),e(ne,Na),e(Na,Ah),e(ne,Dh),e(ne,Wa),e(Wa,Vh),e(ne,Oh),e(ne,Sa),e(Sa,Nh),e(ne,Wh),e(ne,ml),e(ml,Sh),e(ne,Bh),e(ne,Ba),e(Ba,Rh),e(ne,Uh),e(Q,Hh),e(Q,Mo),T(Ks,Mo,null),e(Mo,Kh),e(Mo,Gs),e(Gs,Gh),e(Gs,Ra),e(Ra,Jh),e(Gs,Xh),e(Q,Yh),e(Q,jo),T(Js,jo,null),e(jo,Qh),e(jo,Xs),e(Xs,Zh),e(Xs,Ua),e(Ua,ef),e(Xs,tf),v(t,Qd,g),v(t,Ct,g),e(Ct,zo),e(zo,hl),T(Ys,hl,null),e(Ct,of),e(Ct,fl),e(fl,nf),v(t,Zd,g),v(t,S,g),T(Qs,S,null),e(S,sf),e(S,Zs),e(Zs,rf),e(Zs,Ha),e(Ha,af),e(Zs,lf),e(S,df),e(S,er),e(er,cf),e(er,tr),e(tr,pf),e(er,mf),e(S,hf),e(S,be),T(or,be,null),e(be,ff),e(be,wt),e(wt,uf),e(wt,Ka),e(Ka,gf),e(wt,_f),e(wt,ul),e(ul,vf),e(wt,bf),e(be,Pf),T(Eo,be,null),e(be,$f),T(Fo,be,null),e(S,Tf),e(S,Pe),T(nr,Pe,null),e(Pe,yf),e(Pe,xt),e(xt,If),e(xt,Ga),e(Ga,Cf),e(xt,wf),e(xt,gl),e(gl,xf),e(xt,kf),e(Pe,Lf),T(qo,Pe,null),e(Pe,Mf),T(Ao,Pe,null),e(S,jf),e(S,$e),T(sr,$e,null),e($e,zf),e($e,kt),e(kt,Ef),e(kt,Ja),e(Ja,Ff),e(kt,qf),e(kt,_l),e(_l,Af),e(kt,Df),e($e,Vf),T(Do,$e,null),e($e,Of),T(Vo,$e,null),v(t,ec,g),v(t,Lt,g),e(Lt,Oo),e(Oo,vl),T(rr,vl,null),e(Lt,Nf),e(Lt,bl),e(bl,Wf),v(t,tc,g),v(t,de,g),T(ar,de,null),e(de,Sf),e(de,ir),e(ir,Bf),e(ir,Xa),e(Xa,Rf),e(ir,Uf),e(de,Hf),e(de,lr),e(lr,Kf),e(lr,dr),e(dr,Gf),e(lr,Jf),e(de,Xf),e(de,Te),T(cr,Te,null),e(Te,Yf),e(Te,Mt),e(Mt,Qf),e(Mt,Ya),e(Ya,Zf),e(Mt,eu),e(Mt,Pl),e(Pl,tu),e(Mt,ou),e(Te,nu),T(No,Te,null),e(Te,su),T(Wo,Te,null),v(t,oc,g),v(t,jt,g),e(jt,So),e(So,$l),T(pr,$l,null),e(jt,ru),e(jt,Tl),e(Tl,au),v(t,nc,g),v(t,Z,g),T(mr,Z,null),e(Z,iu),e(Z,yl),e(yl,lu),e(Z,du),e(Z,hr),e(hr,cu),e(hr,Qa),e(Qa,pu),e(hr,mu),e(Z,hu),e(Z,fr),e(fr,fu),e(fr,ur),e(ur,uu),e(fr,gu),e(Z,_u),e(Z,ye),T(gr,ye,null),e(ye,vu),e(ye,zt),e(zt,bu),e(zt,Za),e(Za,Pu),e(zt,$u),e(zt,Il),e(Il,Tu),e(zt,yu),e(ye,Iu),T(Bo,ye,null),e(ye,Cu),T(Ro,ye,null),v(t,sc,g),v(t,Et,g),e(Et,Uo),e(Uo,Cl),T(_r,Cl,null),e(Et,wu),e(Et,wl),e(wl,xu),v(t,rc,g),v(t,ee,g),T(vr,ee,null),e(ee,ku),e(ee,xl),e(xl,Lu),e(ee,Mu),e(ee,br),e(br,ju),e(br,ei),e(ei,zu),e(br,Eu),e(ee,Fu),e(ee,Pr),e(Pr,qu),e(Pr,$r),e($r,Au),e(Pr,Du),e(ee,Vu),e(ee,Ie),T(Tr,Ie,null),e(Ie,Ou),e(Ie,Ft),e(Ft,Nu),e(Ft,ti),e(ti,Wu),e(Ft,Su),e(Ft,kl),e(kl,Bu),e(Ft,Ru),e(Ie,Uu),T(Ho,Ie,null),e(Ie,Hu),T(Ko,Ie,null),v(t,ac,g),v(t,qt,g),e(qt,Go),e(Go,Ll),T(yr,Ll,null),e(qt,Ku),e(qt,Ml),e(Ml,Gu),v(t,ic,g),v(t,ce,g),T(Ir,ce,null),e(ce,Ju),e(ce,Cr),e(Cr,Xu),e(Cr,oi),e(oi,Yu),e(Cr,Qu),e(ce,Zu),e(ce,wr),e(wr,eg),e(wr,xr),e(xr,tg),e(wr,og),e(ce,ng),e(ce,Ce),T(kr,Ce,null),e(Ce,sg),e(Ce,At),e(At,rg),e(At,ni),e(ni,ag),e(At,ig),e(At,jl),e(jl,lg),e(At,dg),e(Ce,cg),T(Jo,Ce,null),e(Ce,pg),T(Xo,Ce,null),v(t,lc,g),v(t,Dt,g),e(Dt,Yo),e(Yo,zl),T(Lr,zl,null),e(Dt,mg),e(Dt,El),e(El,hg),v(t,dc,g),v(t,N,g),T(Mr,N,null),e(N,fg),e(N,jr),e(jr,ug),e(jr,si),e(si,gg),e(jr,_g),e(N,vg),e(N,zr),e(zr,bg),e(zr,Er),e(Er,Pg),e(zr,$g),e(N,Tg),T(Qo,N,null),e(N,yg),e(N,we),T(Fr,we,null),e(we,Ig),e(we,Vt),e(Vt,Cg),e(Vt,ri),e(ri,wg),e(Vt,xg),e(Vt,Fl),e(Fl,kg),e(Vt,Lg),e(we,Mg),T(Zo,we,null),e(we,jg),T(en,we,null),e(N,zg),e(N,xe),T(qr,xe,null),e(xe,Eg),e(xe,Ot),e(Ot,Fg),e(Ot,ai),e(ai,qg),e(Ot,Ag),e(Ot,ql),e(ql,Dg),e(Ot,Vg),e(xe,Og),T(tn,xe,null),e(xe,Ng),T(on,xe,null),e(N,Wg),e(N,ke),T(Ar,ke,null),e(ke,Sg),e(ke,Nt),e(Nt,Bg),e(Nt,ii),e(ii,Rg),e(Nt,Ug),e(Nt,Al),e(Al,Hg),e(Nt,Kg),e(ke,Gg),T(nn,ke,null),e(ke,Jg),T(sn,ke,null),v(t,cc,g),v(t,Wt,g),e(Wt,rn),e(rn,Dl),T(Dr,Dl,null),e(Wt,Xg),e(Wt,Vl),e(Vl,Yg),v(t,pc,g),v(t,St,g),T(Vr,St,null),e(St,Qg),e(St,Le),T(Or,Le,null),e(Le,Zg),e(Le,Bt),e(Bt,e_),e(Bt,li),e(li,t_),e(Bt,o_),e(Bt,Ol),e(Ol,n_),e(Bt,s_),e(Le,r_),T(an,Le,null),e(Le,a_),T(ln,Le,null),v(t,mc,g),v(t,Rt,g),e(Rt,dn),e(dn,Nl),T(Nr,Nl,null),e(Rt,i_),e(Rt,Wl),e(Wl,l_),v(t,hc,g),v(t,Ut,g),T(Wr,Ut,null),e(Ut,d_),e(Ut,Me),T(Sr,Me,null),e(Me,c_),e(Me,Ht),e(Ht,p_),e(Ht,di),e(di,m_),e(Ht,h_),e(Ht,Sl),e(Sl,f_),e(Ht,u_),e(Me,g_),T(cn,Me,null),e(Me,__),T(pn,Me,null),v(t,fc,g),v(t,Kt,g),e(Kt,mn),e(mn,Bl),T(Br,Bl,null),e(Kt,v_),e(Kt,Rl),e(Rl,b_),v(t,uc,g),v(t,F,g),T(Rr,F,null),e(F,P_),e(F,Ur),e(Ur,$_),e(Ur,ci),e(ci,T_),e(Ur,y_),e(F,I_),e(F,Hr),e(Hr,C_),e(Hr,Kr),e(Kr,w_),e(Hr,x_),e(F,k_),e(F,Ul),e(Ul,L_),e(F,M_),e(F,Ne),e(Ne,Hl),e(Hl,Gr),e(Gr,j_),e(Ne,z_),e(Ne,Kl),e(Kl,Jr),e(Jr,E_),e(Ne,F_),e(Ne,Gl),e(Gl,Xr),e(Xr,q_),e(Ne,A_),e(Ne,Jl),e(Jl,Yr),e(Yr,D_),e(F,V_),e(F,je),T(Qr,je,null),e(je,O_),e(je,Gt),e(Gt,N_),e(Gt,Xl),e(Xl,W_),e(Gt,S_),e(Gt,Yl),e(Yl,B_),e(Gt,R_),e(je,U_),T(hn,je,null),e(je,H_),T(fn,je,null),e(F,K_),e(F,un),T(Zr,un,null),e(un,G_),T(gn,un,null),e(F,J_),e(F,_n),T(ea,_n,null),e(_n,X_),T(vn,_n,null),v(t,gc,g),v(t,Jt,g),e(Jt,bn),e(bn,Ql),T(ta,Ql,null),e(Jt,Y_),e(Jt,Zl),e(Zl,Q_),v(t,_c,g),v(t,Xt,g),T(oa,Xt,null),e(Xt,Z_),e(Xt,ze),T(na,ze,null),e(ze,ev),e(ze,Yt),e(Yt,tv),e(Yt,ed),e(ed,ov),e(Yt,nv),e(Yt,td),e(td,sv),e(Yt,rv),e(ze,av),T(Pn,ze,null),e(ze,iv),T($n,ze,null),v(t,vc,g),v(t,Qt,g),e(Qt,Tn),e(Tn,od),T(sa,od,null),e(Qt,lv),e(Qt,nd),e(nd,dv),v(t,bc,g),v(t,Zt,g),T(ra,Zt,null),e(Zt,cv),e(Zt,Ee),T(aa,Ee,null),e(Ee,pv),e(Ee,eo),e(eo,mv),e(eo,sd),e(sd,hv),e(eo,fv),e(eo,rd),e(rd,uv),e(eo,gv),e(Ee,_v),T(yn,Ee,null),e(Ee,vv),T(In,Ee,null),Pc=!0},p(t,[g]){const ia={};g&2&&(ia.$$scope={dirty:g,ctx:t}),uo.$set(ia);const ad={};g&2&&(ad.$$scope={dirty:g,ctx:t}),vo.$set(ad);const id={};g&2&&(id.$$scope={dirty:g,ctx:t}),Po.$set(id);const ld={};g&2&&(ld.$$scope={dirty:g,ctx:t}),Eo.$set(ld);const la={};g&2&&(la.$$scope={dirty:g,ctx:t}),Fo.$set(la);const dd={};g&2&&(dd.$$scope={dirty:g,ctx:t}),qo.$set(dd);const cd={};g&2&&(cd.$$scope={dirty:g,ctx:t}),Ao.$set(cd);const pd={};g&2&&(pd.$$scope={dirty:g,ctx:t}),Do.$set(pd);const da={};g&2&&(da.$$scope={dirty:g,ctx:t}),Vo.$set(da);const md={};g&2&&(md.$$scope={dirty:g,ctx:t}),No.$set(md);const hd={};g&2&&(hd.$$scope={dirty:g,ctx:t}),Wo.$set(hd);const fd={};g&2&&(fd.$$scope={dirty:g,ctx:t}),Bo.$set(fd);const ud={};g&2&&(ud.$$scope={dirty:g,ctx:t}),Ro.$set(ud);const ca={};g&2&&(ca.$$scope={dirty:g,ctx:t}),Ho.$set(ca);const gd={};g&2&&(gd.$$scope={dirty:g,ctx:t}),Ko.$set(gd);const _d={};g&2&&(_d.$$scope={dirty:g,ctx:t}),Jo.$set(_d);const vd={};g&2&&(vd.$$scope={dirty:g,ctx:t}),Xo.$set(vd);const bd={};g&2&&(bd.$$scope={dirty:g,ctx:t}),Qo.$set(bd);const pa={};g&2&&(pa.$$scope={dirty:g,ctx:t}),Zo.$set(pa);const Pd={};g&2&&(Pd.$$scope={dirty:g,ctx:t}),en.$set(Pd);const B={};g&2&&(B.$$scope={dirty:g,ctx:t}),tn.$set(B);const $d={};g&2&&($d.$$scope={dirty:g,ctx:t}),on.$set($d);const Td={};g&2&&(Td.$$scope={dirty:g,ctx:t}),nn.$set(Td);const yd={};g&2&&(yd.$$scope={dirty:g,ctx:t}),sn.$set(yd);const Id={};g&2&&(Id.$$scope={dirty:g,ctx:t}),an.$set(Id);const Cd={};g&2&&(Cd.$$scope={dirty:g,ctx:t}),ln.$set(Cd);const wd={};g&2&&(wd.$$scope={dirty:g,ctx:t}),cn.$set(wd);const to={};g&2&&(to.$$scope={dirty:g,ctx:t}),pn.$set(to);const xd={};g&2&&(xd.$$scope={dirty:g,ctx:t}),hn.$set(xd);const kd={};g&2&&(kd.$$scope={dirty:g,ctx:t}),fn.$set(kd);const ma={};g&2&&(ma.$$scope={dirty:g,ctx:t}),gn.$set(ma);const Ld={};g&2&&(Ld.$$scope={dirty:g,ctx:t}),vn.$set(Ld);const Md={};g&2&&(Md.$$scope={dirty:g,ctx:t}),Pn.$set(Md);const jd={};g&2&&(jd.$$scope={dirty:g,ctx:t}),$n.$set(jd);const zd={};g&2&&(zd.$$scope={dirty:g,ctx:t}),yn.$set(zd);const ha={};g&2&&(ha.$$scope={dirty:g,ctx:t}),In.$set(ha)},i(t){Pc||(y(n.$$.fragment,t),y(j.$$.fragment,t),y(ae.$$.fragment,t),y(He.$$.fragment,t),y(ds.$$.fragment,t),y(fs.$$.fragment,t),y(us.$$.fragment,t),y(uo.$$.fragment,t),y(_s.$$.fragment,t),y(bs.$$.fragment,t),y(Ps.$$.fragment,t),y(vo.$$.fragment,t),y(Ts.$$.fragment,t),y(ys.$$.fragment,t),y(Po.$$.fragment,t),y(Cs.$$.fragment,t),y(ws.$$.fragment,t),y(ks.$$.fragment,t),y(Ls.$$.fragment,t),y(js.$$.fragment,t),y(zs.$$.fragment,t),y(Es.$$.fragment,t),y(Fs.$$.fragment,t),y(Ds.$$.fragment,t),y(Vs.$$.fragment,t),y(Os.$$.fragment,t),y(Ns.$$.fragment,t),y(Ws.$$.fragment,t),y(Ss.$$.fragment,t),y(Rs.$$.fragment,t),y(Us.$$.fragment,t),y(Hs.$$.fragment,t),y(Ks.$$.fragment,t),y(Js.$$.fragment,t),y(Ys.$$.fragment,t),y(Qs.$$.fragment,t),y(or.$$.fragment,t),y(Eo.$$.fragment,t),y(Fo.$$.fragment,t),y(nr.$$.fragment,t),y(qo.$$.fragment,t),y(Ao.$$.fragment,t),y(sr.$$.fragment,t),y(Do.$$.fragment,t),y(Vo.$$.fragment,t),y(rr.$$.fragment,t),y(ar.$$.fragment,t),y(cr.$$.fragment,t),y(No.$$.fragment,t),y(Wo.$$.fragment,t),y(pr.$$.fragment,t),y(mr.$$.fragment,t),y(gr.$$.fragment,t),y(Bo.$$.fragment,t),y(Ro.$$.fragment,t),y(_r.$$.fragment,t),y(vr.$$.fragment,t),y(Tr.$$.fragment,t),y(Ho.$$.fragment,t),y(Ko.$$.fragment,t),y(yr.$$.fragment,t),y(Ir.$$.fragment,t),y(kr.$$.fragment,t),y(Jo.$$.fragment,t),y(Xo.$$.fragment,t),y(Lr.$$.fragment,t),y(Mr.$$.fragment,t),y(Qo.$$.fragment,t),y(Fr.$$.fragment,t),y(Zo.$$.fragment,t),y(en.$$.fragment,t),y(qr.$$.fragment,t),y(tn.$$.fragment,t),y(on.$$.fragment,t),y(Ar.$$.fragment,t),y(nn.$$.fragment,t),y(sn.$$.fragment,t),y(Dr.$$.fragment,t),y(Vr.$$.fragment,t),y(Or.$$.fragment,t),y(an.$$.fragment,t),y(ln.$$.fragment,t),y(Nr.$$.fragment,t),y(Wr.$$.fragment,t),y(Sr.$$.fragment,t),y(cn.$$.fragment,t),y(pn.$$.fragment,t),y(Br.$$.fragment,t),y(Rr.$$.fragment,t),y(Qr.$$.fragment,t),y(hn.$$.fragment,t),y(fn.$$.fragment,t),y(Zr.$$.fragment,t),y(gn.$$.fragment,t),y(ea.$$.fragment,t),y(vn.$$.fragment,t),y(ta.$$.fragment,t),y(oa.$$.fragment,t),y(na.$$.fragment,t),y(Pn.$$.fragment,t),y($n.$$.fragment,t),y(sa.$$.fragment,t),y(ra.$$.fragment,t),y(aa.$$.fragment,t),y(yn.$$.fragment,t),y(In.$$.fragment,t),Pc=!0)},o(t){I(n.$$.fragment,t),I(j.$$.fragment,t),I(ae.$$.fragment,t),I(He.$$.fragment,t),I(ds.$$.fragment,t),I(fs.$$.fragment,t),I(us.$$.fragment,t),I(uo.$$.fragment,t),I(_s.$$.fragment,t),I(bs.$$.fragment,t),I(Ps.$$.fragment,t),I(vo.$$.fragment,t),I(Ts.$$.fragment,t),I(ys.$$.fragment,t),I(Po.$$.fragment,t),I(Cs.$$.fragment,t),I(ws.$$.fragment,t),I(ks.$$.fragment,t),I(Ls.$$.fragment,t),I(js.$$.fragment,t),I(zs.$$.fragment,t),I(Es.$$.fragment,t),I(Fs.$$.fragment,t),I(Ds.$$.fragment,t),I(Vs.$$.fragment,t),I(Os.$$.fragment,t),I(Ns.$$.fragment,t),I(Ws.$$.fragment,t),I(Ss.$$.fragment,t),I(Rs.$$.fragment,t),I(Us.$$.fragment,t),I(Hs.$$.fragment,t),I(Ks.$$.fragment,t),I(Js.$$.fragment,t),I(Ys.$$.fragment,t),I(Qs.$$.fragment,t),I(or.$$.fragment,t),I(Eo.$$.fragment,t),I(Fo.$$.fragment,t),I(nr.$$.fragment,t),I(qo.$$.fragment,t),I(Ao.$$.fragment,t),I(sr.$$.fragment,t),I(Do.$$.fragment,t),I(Vo.$$.fragment,t),I(rr.$$.fragment,t),I(ar.$$.fragment,t),I(cr.$$.fragment,t),I(No.$$.fragment,t),I(Wo.$$.fragment,t),I(pr.$$.fragment,t),I(mr.$$.fragment,t),I(gr.$$.fragment,t),I(Bo.$$.fragment,t),I(Ro.$$.fragment,t),I(_r.$$.fragment,t),I(vr.$$.fragment,t),I(Tr.$$.fragment,t),I(Ho.$$.fragment,t),I(Ko.$$.fragment,t),I(yr.$$.fragment,t),I(Ir.$$.fragment,t),I(kr.$$.fragment,t),I(Jo.$$.fragment,t),I(Xo.$$.fragment,t),I(Lr.$$.fragment,t),I(Mr.$$.fragment,t),I(Qo.$$.fragment,t),I(Fr.$$.fragment,t),I(Zo.$$.fragment,t),I(en.$$.fragment,t),I(qr.$$.fragment,t),I(tn.$$.fragment,t),I(on.$$.fragment,t),I(Ar.$$.fragment,t),I(nn.$$.fragment,t),I(sn.$$.fragment,t),I(Dr.$$.fragment,t),I(Vr.$$.fragment,t),I(Or.$$.fragment,t),I(an.$$.fragment,t),I(ln.$$.fragment,t),I(Nr.$$.fragment,t),I(Wr.$$.fragment,t),I(Sr.$$.fragment,t),I(cn.$$.fragment,t),I(pn.$$.fragment,t),I(Br.$$.fragment,t),I(Rr.$$.fragment,t),I(Qr.$$.fragment,t),I(hn.$$.fragment,t),I(fn.$$.fragment,t),I(Zr.$$.fragment,t),I(gn.$$.fragment,t),I(ea.$$.fragment,t),I(vn.$$.fragment,t),I(ta.$$.fragment,t),I(oa.$$.fragment,t),I(na.$$.fragment,t),I(Pn.$$.fragment,t),I($n.$$.fragment,t),I(sa.$$.fragment,t),I(ra.$$.fragment,t),I(aa.$$.fragment,t),I(yn.$$.fragment,t),I(In.$$.fragment,t),Pc=!1},d(t){o(d),t&&o(b),t&&o(u),C(n),t&&o(oo),t&&o(G),C(j),t&&o(no),t&&o(te),t&&o(so),t&&o(me),t&&o(ro),t&&o(he),t&&o(nt),t&&o(A),C(ae),t&&o(ao),t&&o(Be),t&&o(io),t&&o(oe),t&&o(lo),t&&o(M),t&&o(is),C(He,t),t&&o(Ve),t&&o(U),t&&o(pt),t&&o(ge),C(ds),t&&o(Ed),t&&o(Ta),t&&o(Fd),t&&o(ho),t&&o(qd),t&&o(ya),t&&o(Ad),t&&o(mt),C(fs),t&&o(Dd),t&&o(X),C(us),C(uo),C(_s),t&&o(Vd),t&&o(ft),C(bs),t&&o(Od),t&&o(ie),C(Ps),C(vo),t&&o(Nd),t&&o(_t),C(Ts),t&&o(Wd),t&&o(le),C(ys),C(Po),t&&o(Sd),t&&o(Pt),C(Cs),t&&o(Bd),t&&o(O),C(ws),C(ks),C(Ls),C(js),C(zs),t&&o(Rd),t&&o($t),C(Es),t&&o(Ud),t&&o(Y),C(Fs),C(Ds),C(Vs),t&&o(Hd),t&&o(Tt),C(Os),t&&o(Kd),t&&o(Oe),C(Ns),C(Ws),t&&o(Gd),t&&o(yt),C(Ss),t&&o(Jd),t&&o(Bs),C(Rs),t&&o(Xd),t&&o(It),C(Us),t&&o(Yd),t&&o(Q),C(Hs),C(Ks),C(Js),t&&o(Qd),t&&o(Ct),C(Ys),t&&o(Zd),t&&o(S),C(Qs),C(or),C(Eo),C(Fo),C(nr),C(qo),C(Ao),C(sr),C(Do),C(Vo),t&&o(ec),t&&o(Lt),C(rr),t&&o(tc),t&&o(de),C(ar),C(cr),C(No),C(Wo),t&&o(oc),t&&o(jt),C(pr),t&&o(nc),t&&o(Z),C(mr),C(gr),C(Bo),C(Ro),t&&o(sc),t&&o(Et),C(_r),t&&o(rc),t&&o(ee),C(vr),C(Tr),C(Ho),C(Ko),t&&o(ac),t&&o(qt),C(yr),t&&o(ic),t&&o(ce),C(Ir),C(kr),C(Jo),C(Xo),t&&o(lc),t&&o(Dt),C(Lr),t&&o(dc),t&&o(N),C(Mr),C(Qo),C(Fr),C(Zo),C(en),C(qr),C(tn),C(on),C(Ar),C(nn),C(sn),t&&o(cc),t&&o(Wt),C(Dr),t&&o(pc),t&&o(St),C(Vr),C(Or),C(an),C(ln),t&&o(mc),t&&o(Rt),C(Nr),t&&o(hc),t&&o(Ut),C(Wr),C(Sr),C(cn),C(pn),t&&o(fc),t&&o(Kt),C(Br),t&&o(uc),t&&o(F),C(Rr),C(Qr),C(hn),C(fn),C(Zr),C(gn),C(ea),C(vn),t&&o(gc),t&&o(Jt),C(ta),t&&o(_c),t&&o(Xt),C(oa),C(na),C(Pn),C($n),t&&o(vc),t&&o(Qt),C(sa),t&&o(bc),t&&o(Zt),C(ra),C(aa),C(yn),C(In)}}}const n2={local:"clip",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"resources",title:"Resources"},{local:"transformers.CLIPConfig",title:"CLIPConfig"},{local:"transformers.CLIPTextConfig",title:"CLIPTextConfig"},{local:"transformers.CLIPVisionConfig",title:"CLIPVisionConfig"},{local:"transformers.CLIPTokenizer",title:"CLIPTokenizer"},{local:"transformers.CLIPTokenizerFast",title:"CLIPTokenizerFast"},{local:"transformers.CLIPImageProcessor",title:"CLIPImageProcessor"},{local:"transformers.CLIPFeatureExtractor",title:"CLIPFeatureExtractor"},{local:"transformers.CLIPProcessor",title:"CLIPProcessor"},{local:"transformers.CLIPModel",title:"CLIPModel"},{local:"transformers.CLIPTextModel",title:"CLIPTextModel"},{local:"transformers.CLIPTextModelWithProjection",title:"CLIPTextModelWithProjection"},{local:"transformers.CLIPVisionModelWithProjection",title:"CLIPVisionModelWithProjection"},{local:"transformers.CLIPVisionModel",title:"CLIPVisionModel"},{local:"transformers.TFCLIPModel",title:"TFCLIPModel"},{local:"transformers.TFCLIPTextModel",title:"TFCLIPTextModel"},{local:"transformers.TFCLIPVisionModel",title:"TFCLIPVisionModel"},{local:"transformers.FlaxCLIPModel",title:"FlaxCLIPModel"},{local:"transformers.FlaxCLIPTextModel",title:"FlaxCLIPTextModel"},{local:"transformers.FlaxCLIPVisionModel",title:"FlaxCLIPVisionModel"}],title:"CLIP"};function s2(w){return b$(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class p2 extends u${constructor(d){super();g$(this,d,s2,o2,_$,{})}}export{p2 as default,n2 as metadata};
