import{s as os,o as ns,n as W}from"../chunks/scheduler.25b97de1.js";import{S as ss,i as as,g as d,s as i,r as g,A as rs,h as c,f as a,c as l,j as L,u as _,x as f,k as j,y as r,a as p,v as b,d as T,t as M,w as y}from"../chunks/index.d9030fc9.js";import{T as Mt}from"../chunks/Tip.baa67368.js";import{D as z}from"../chunks/Docstring.e257edda.js";import{C as je}from"../chunks/CodeBlock.e6cd0d95.js";import{F as is,M as Rn}from"../chunks/Markdown.7217f838.js";import{E as He}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as ls}from"../chunks/PipelineTag.5f100392.js";import{H as sn,E as ds}from"../chunks/EditOnGithub.91d95064.js";function cs(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBDb25maWclMkMlMjBDTElQTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUENvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmlnJTBBJTBBJTIzJTIwV2UlMjBjYW4lMjBhbHNvJTIwaW5pdGlhbGl6ZSUyMGElMjBDTElQQ29uZmlnJTIwZnJvbSUyMGElMjBDTElQVGV4dENvbmZpZyUyMGFuZCUyMGElMjBDTElQVmlzaW9uQ29uZmlnJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUZXh0Q29uZmlnJTJDJTIwQ0xJUFZpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dCUyMGFuZCUyMENMSVBWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBDTElQVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMENMSVBWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENMSVBDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function ps(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUZXh0Q29uZmlnJTJDJTIwQ0xJUFRleHRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dENvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUFRleHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dE1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENMSVBUZXh0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",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`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function ms(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBWaXNpb25Db25maWclMkMlMjBDTElQVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFZpc2lvbkNvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUFZpc2lvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBWaXNpb25Nb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",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`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function us(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function fs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwbG9naXRzX3Blcl9pbWFnZS5zb2Z0bWF4KGRpbSUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function hs(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function gs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMENMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfdGV4dF9mZWF0dXJlcygqKmlucHV0cyk=",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function _s(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function bs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Ts(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Ms(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQVGV4dE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBDTElQVGV4dE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlZF9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjAoRU9TJTIwdG9rZW4pJTIwc3RhdGVz",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function ys(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function vs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQVGV4dE1vZGVsV2l0aFByb2plY3Rpb24lMEElMEFtb2RlbCUyMCUzRCUyMENMSVBUZXh0TW9kZWxXaXRoUHJvamVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEF0ZXh0X2VtYmVkcyUyMCUzRCUyMG91dHB1dHMudGV4dF9lbWJlZHM=",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`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Cs(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function ws(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBWaXNpb25Nb2RlbFdpdGhQcm9qZWN0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBDTElQVmlzaW9uTW9kZWxXaXRoUHJvamVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBaW1hZ2VfZW1iZWRzJTIwJTNEJTIwb3V0cHV0cy5pbWFnZV9lbWJlZHM=",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`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Is(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function xs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBWaXNpb25Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUFZpc2lvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function $s(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Ps(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMENMSVBGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, CLIPForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
LABEL_0`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function ks(x){let e,u="## CLIPModel[[transformers.CLIPModel]]",n,o,m,t,v,Ct=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Te,H,wt=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Me,F,Je,J,B,zt='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a> forward method, overrides the <code>__call__</code> special method.',ze,ie,Qe,Q,st,q,dt,R,pe,ct='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a> forward method, overrides the <code>__call__</code> special method.',at,K,pt,me,ye,X,ee,D,ue,mt='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a> forward method, overrides the <code>__call__</code> special method.',De,le,Et,de,fe,A,rt="## CLIPTextModel[[transformers.CLIPTextModel]]",te,O,ve,Ie,Ue,ut=`The text model from CLIP without any head or projection on top.
This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,oe,xe,$e=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ft,ne,We,Ae,be,ce='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTextModel">CLIPTextModel</a> forward method, overrides the <code>__call__</code> special method.',Pt,G,Fe,Ze,Z,he,Ut="## CLIPTextModelWithProjection[[transformers.CLIPTextModelWithProjection]]",N,S,Ce,Ve,Oe,Ht="CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output).",ge,we,se=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ke,C,k=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Be,V,Y,et,U,Ge='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTextModelWithProjection">CLIPTextModelWithProjection</a> forward method, overrides the <code>__call__</code> special method.',ae,Pe,w,P,_e,ht,Wt="## CLIPVisionModelWithProjection[[transformers.CLIPVisionModelWithProjection]]",Re,E,ke,tt,re,Ne="CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output).",co,Rt,gn=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Fo,Xt,_n=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Zo,Xe,Dt,Kt,vo,Vo='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPVisionModelWithProjection">CLIPVisionModelWithProjection</a> forward method, overrides the <code>__call__</code> special method.',Le,It,Bo,kt,Go,eo,Co="## CLIPVisionModel[[transformers.CLIPVisionModel]]",No,yt,ot,to,po,wo=`The vision model from CLIP without any head or projection on top.
This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,an,mo,Io=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,rn,xt,Ft,ln,uo,oo='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPVisionModel">CLIPVisionModel</a> forward method, overrides the <code>__call__</code> special method.',no,At,fo,so,xo,$t,ho="## CLIPForImageClassification[[transformers.CLIPForImageClassification]]",$o,qe,go,qo,St,_o=`CLIP vision encoder with an image classification head on top (a linear layer on top of the pooled final hidden states of
the patch tokens) e.g. for ImageNet.`,Po,Zt,bn=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ko,Ee,bo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Eo,it,To,Ho,Yt,Tn='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPForImageClassification">CLIPForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Ro,Se,ao,Ot,ro;return m=new z({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/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_clip.py#L933"}}),Je=new z({props:{name:"forward",anchor:"transformers.CLIPModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"pixel_values",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"return_loss",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L1066",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/pr_31208/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>) — The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/pr_31208/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/pr_31208/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/pr_31208/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.clip.modeling_clip.CLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ie=new Mt({props:{$$slots:{default:[us]},$$scope:{ctx:x}}}),Q=new He({props:{anchor:"transformers.CLIPModel.forward.example",$$slots:{default:[fs]},$$scope:{ctx:x}}}),dt=new z({props:{name:"get_text_features",anchor:"transformers.CLIPModel.get_text_features",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L970",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),K=new Mt({props:{$$slots:{default:[hs]},$$scope:{ctx:x}}}),me=new He({props:{anchor:"transformers.CLIPModel.get_text_features.example",$$slots:{default:[gs]},$$scope:{ctx:x}}}),ee=new z({props:{name:"get_image_features",anchor:"transformers.CLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L1017",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),le=new Mt({props:{$$slots:{default:[_s]},$$scope:{ctx:x}}}),de=new He({props:{anchor:"transformers.CLIPModel.get_image_features.example",$$slots:{default:[bs]},$$scope:{ctx:x}}}),ve=new z({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/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_clip.py#L755"}}),We=new z({props:{name:"forward",anchor:"transformers.CLIPTextModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L776",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),G=new Mt({props:{$$slots:{default:[Ts]},$$scope:{ctx:x}}}),Ze=new He({props:{anchor:"transformers.CLIPTextModel.forward.example",$$slots:{default:[Ms]},$$scope:{ctx:x}}}),Ce=new z({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/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_clip.py#L1162"}}),Y=new z({props:{name:"forward",anchor:"transformers.CLIPTextModelWithProjection.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L1189",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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>) — 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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.clip.modeling_clip.CLIPTextModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new Mt({props:{$$slots:{default:[ys]},$$scope:{ctx:x}}}),P=new He({props:{anchor:"transformers.CLIPTextModelWithProjection.forward.example",$$slots:{default:[vs]},$$scope:{ctx:x}}}),ke=new z({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/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_clip.py#L1243"}}),Dt=new z({props:{name:"forward",anchor:"transformers.CLIPVisionModelWithProjection.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L1266",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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>) — The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.clip.modeling_clip.CLIPVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),It=new Mt({props:{$$slots:{default:[Cs]},$$scope:{ctx:x}}}),kt=new He({props:{anchor:"transformers.CLIPVisionModelWithProjection.forward.example",$$slots:{default:[ws]},$$scope:{ctx:x}}}),ot=new z({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/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_clip.py#L874"}}),Ft=new z({props:{name:"forward",anchor:"transformers.CLIPVisionModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L892",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),At=new Mt({props:{$$slots:{default:[Is]},$$scope:{ctx:x}}}),so=new He({props:{anchor:"transformers.CLIPVisionModel.forward.example",$$slots:{default:[xs]},$$scope:{ctx:x}}}),go=new z({props:{name:"class transformers.CLIPForImageClassification",anchor:"transformers.CLIPForImageClassification",parameters:[{name:"config",val:": CLIPConfig"}],parametersDescription:[{anchor:"transformers.CLIPForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_clip.py#L1321"}}),To=new z({props:{name:"forward",anchor:"transformers.CLIPForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.CLIPForImageClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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.CLIPForImageClassification.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.CLIPForImageClassification.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.CLIPForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPForImageClassification.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.CLIPForImageClassification.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.CLIPForImageClassification.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.CLIPForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CLIPForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_clip.py#L1345",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</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 (<a
  href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPConfig"
>CLIPConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Se=new Mt({props:{$$slots:{default:[$s]},$$scope:{ctx:x}}}),Ot=new He({props:{anchor:"transformers.CLIPForImageClassification.forward.example",$$slots:{default:[Ps]},$$scope:{ctx:x}}}),{c(){e=d("p"),e.textContent=u,n=i(),o=d("div"),g(m.$$.fragment),t=i(),v=d("p"),v.innerHTML=Ct,Te=i(),H=d("p"),H.innerHTML=wt,Me=i(),F=d("div"),g(Je.$$.fragment),J=i(),B=d("p"),B.innerHTML=zt,ze=i(),g(ie.$$.fragment),Qe=i(),g(Q.$$.fragment),st=i(),q=d("div"),g(dt.$$.fragment),R=i(),pe=d("p"),pe.innerHTML=ct,at=i(),g(K.$$.fragment),pt=i(),g(me.$$.fragment),ye=i(),X=d("div"),g(ee.$$.fragment),D=i(),ue=d("p"),ue.innerHTML=mt,De=i(),g(le.$$.fragment),Et=i(),g(de.$$.fragment),fe=i(),A=d("p"),A.textContent=rt,te=i(),O=d("div"),g(ve.$$.fragment),Ie=i(),Ue=d("p"),Ue.innerHTML=ut,oe=i(),xe=d("p"),xe.innerHTML=$e,ft=i(),ne=d("div"),g(We.$$.fragment),Ae=i(),be=d("p"),be.innerHTML=ce,Pt=i(),g(G.$$.fragment),Fe=i(),g(Ze.$$.fragment),Z=i(),he=d("p"),he.textContent=Ut,N=i(),S=d("div"),g(Ce.$$.fragment),Ve=i(),Oe=d("p"),Oe.textContent=Ht,ge=i(),we=d("p"),we.innerHTML=se,Ke=i(),C=d("p"),C.innerHTML=k,Be=i(),V=d("div"),g(Y.$$.fragment),et=i(),U=d("p"),U.innerHTML=Ge,ae=i(),g(Pe.$$.fragment),w=i(),g(P.$$.fragment),_e=i(),ht=d("p"),ht.textContent=Wt,Re=i(),E=d("div"),g(ke.$$.fragment),tt=i(),re=d("p"),re.textContent=Ne,co=i(),Rt=d("p"),Rt.innerHTML=gn,Fo=i(),Xt=d("p"),Xt.innerHTML=_n,Zo=i(),Xe=d("div"),g(Dt.$$.fragment),Kt=i(),vo=d("p"),vo.innerHTML=Vo,Le=i(),g(It.$$.fragment),Bo=i(),g(kt.$$.fragment),Go=i(),eo=d("p"),eo.textContent=Co,No=i(),yt=d("div"),g(ot.$$.fragment),to=i(),po=d("p"),po.innerHTML=wo,an=i(),mo=d("p"),mo.innerHTML=Io,rn=i(),xt=d("div"),g(Ft.$$.fragment),ln=i(),uo=d("p"),uo.innerHTML=oo,no=i(),g(At.$$.fragment),fo=i(),g(so.$$.fragment),xo=i(),$t=d("p"),$t.textContent=ho,$o=i(),qe=d("div"),g(go.$$.fragment),qo=i(),St=d("p"),St.textContent=_o,Po=i(),Zt=d("p"),Zt.innerHTML=bn,ko=i(),Ee=d("p"),Ee.innerHTML=bo,Eo=i(),it=d("div"),g(To.$$.fragment),Ho=i(),Yt=d("p"),Yt.innerHTML=Tn,Ro=i(),g(Se.$$.fragment),ao=i(),g(Ot.$$.fragment),this.h()},l(h){e=c(h,"P",{"data-svelte-h":!0}),f(e)!=="svelte-1qdg10c"&&(e.textContent=u),n=l(h),o=c(h,"DIV",{class:!0});var $=L(o);_(m.$$.fragment,$),t=l($),v=c($,"P",{"data-svelte-h":!0}),f(v)!=="svelte-1qfr7uo"&&(v.innerHTML=Ct),Te=l($),H=c($,"P",{"data-svelte-h":!0}),f(H)!=="svelte-1ydu1el"&&(H.innerHTML=wt),Me=l($),F=c($,"DIV",{class:!0});var gt=L(F);_(Je.$$.fragment,gt),J=l(gt),B=c(gt,"P",{"data-svelte-h":!0}),f(B)!=="svelte-ek0g9d"&&(B.innerHTML=zt),ze=l(gt),_(ie.$$.fragment,gt),Qe=l(gt),_(Q.$$.fragment,gt),gt.forEach(a),st=l($),q=c($,"DIV",{class:!0});var Vt=L(q);_(dt.$$.fragment,Vt),R=l(Vt),pe=c(Vt,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-ek0g9d"&&(pe.innerHTML=ct),at=l(Vt),_(K.$$.fragment,Vt),pt=l(Vt),_(me.$$.fragment,Vt),Vt.forEach(a),ye=l($),X=c($,"DIV",{class:!0});var Lt=L(X);_(ee.$$.fragment,Lt),D=l(Lt),ue=c(Lt,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-ek0g9d"&&(ue.innerHTML=mt),De=l(Lt),_(le.$$.fragment,Lt),Et=l(Lt),_(de.$$.fragment,Lt),Lt.forEach(a),$.forEach(a),fe=l(h),A=c(h,"P",{"data-svelte-h":!0}),f(A)!=="svelte-81gui8"&&(A.textContent=rt),te=l(h),O=c(h,"DIV",{class:!0});var _t=L(O);_(ve.$$.fragment,_t),Ie=l(_t),Ue=c(_t,"P",{"data-svelte-h":!0}),f(Ue)!=="svelte-1nuguej"&&(Ue.innerHTML=ut),oe=l(_t),xe=c(_t,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-1ydu1el"&&(xe.innerHTML=$e),ft=l(_t),ne=c(_t,"DIV",{class:!0});var Bt=L(ne);_(We.$$.fragment,Bt),Ae=l(Bt),be=c(Bt,"P",{"data-svelte-h":!0}),f(be)!=="svelte-89sdyt"&&(be.innerHTML=ce),Pt=l(Bt),_(G.$$.fragment,Bt),Fe=l(Bt),_(Ze.$$.fragment,Bt),Bt.forEach(a),_t.forEach(a),Z=l(h),he=c(h,"P",{"data-svelte-h":!0}),f(he)!=="svelte-1tmqgzw"&&(he.textContent=Ut),N=l(h),S=c(h,"DIV",{class:!0});var vt=L(S);_(Ce.$$.fragment,vt),Ve=l(vt),Oe=c(vt,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-1gij27p"&&(Oe.textContent=Ht),ge=l(vt),we=c(vt,"P",{"data-svelte-h":!0}),f(we)!=="svelte-1qfr7uo"&&(we.innerHTML=se),Ke=l(vt),C=c(vt,"P",{"data-svelte-h":!0}),f(C)!=="svelte-1ydu1el"&&(C.innerHTML=k),Be=l(vt),V=c(vt,"DIV",{class:!0});var nt=L(V);_(Y.$$.fragment,nt),et=l(nt),U=c(nt,"P",{"data-svelte-h":!0}),f(U)!=="svelte-yy0sot"&&(U.innerHTML=Ge),ae=l(nt),_(Pe.$$.fragment,nt),w=l(nt),_(P.$$.fragment,nt),nt.forEach(a),vt.forEach(a),_e=l(h),ht=c(h,"P",{"data-svelte-h":!0}),f(ht)!=="svelte-n0zh0c"&&(ht.textContent=Wt),Re=l(h),E=c(h,"DIV",{class:!0});var Ye=L(E);_(ke.$$.fragment,Ye),tt=l(Ye),re=c(Ye,"P",{"data-svelte-h":!0}),f(re)!=="svelte-sjom46"&&(re.textContent=Ne),co=l(Ye),Rt=c(Ye,"P",{"data-svelte-h":!0}),f(Rt)!=="svelte-1qfr7uo"&&(Rt.innerHTML=gn),Fo=l(Ye),Xt=c(Ye,"P",{"data-svelte-h":!0}),f(Xt)!=="svelte-1ydu1el"&&(Xt.innerHTML=_n),Zo=l(Ye),Xe=c(Ye,"DIV",{class:!0});var jt=L(Xe);_(Dt.$$.fragment,jt),Kt=l(jt),vo=c(jt,"P",{"data-svelte-h":!0}),f(vo)!=="svelte-1ik31jp"&&(vo.innerHTML=Vo),Le=l(jt),_(It.$$.fragment,jt),Bo=l(jt),_(kt.$$.fragment,jt),jt.forEach(a),Ye.forEach(a),Go=l(h),eo=c(h,"P",{"data-svelte-h":!0}),f(eo)!=="svelte-f92v4"&&(eo.textContent=Co),No=l(h),yt=c(h,"DIV",{class:!0});var bt=L(yt);_(ot.$$.fragment,bt),to=l(bt),po=c(bt,"P",{"data-svelte-h":!0}),f(po)!=="svelte-1wdnxz2"&&(po.innerHTML=wo),an=l(bt),mo=c(bt,"P",{"data-svelte-h":!0}),f(mo)!=="svelte-1ydu1el"&&(mo.innerHTML=Io),rn=l(bt),xt=c(bt,"DIV",{class:!0});var Gt=L(xt);_(Ft.$$.fragment,Gt),ln=l(Gt),uo=c(Gt,"P",{"data-svelte-h":!0}),f(uo)!=="svelte-hodjcl"&&(uo.innerHTML=oo),no=l(Gt),_(At.$$.fragment,Gt),fo=l(Gt),_(so.$$.fragment,Gt),Gt.forEach(a),bt.forEach(a),xo=l(h),$t=c(h,"P",{"data-svelte-h":!0}),f($t)!=="svelte-o2ttwk"&&($t.textContent=ho),$o=l(h),qe=c(h,"DIV",{class:!0});var Tt=L(qe);_(go.$$.fragment,Tt),qo=l(Tt),St=c(Tt,"P",{"data-svelte-h":!0}),f(St)!=="svelte-fhevdc"&&(St.textContent=_o),Po=l(Tt),Zt=c(Tt,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-1qfr7uo"&&(Zt.innerHTML=bn),ko=l(Tt),Ee=c(Tt,"P",{"data-svelte-h":!0}),f(Ee)!=="svelte-1ydu1el"&&(Ee.innerHTML=bo),Eo=l(Tt),it=c(Tt,"DIV",{class:!0});var lt=L(it);_(To.$$.fragment,lt),Ho=l(lt),Yt=c(lt,"P",{"data-svelte-h":!0}),f(Yt)!=="svelte-ggefjl"&&(Yt.innerHTML=Tn),Ro=l(lt),_(Se.$$.fragment,lt),ao=l(lt),_(Ot.$$.fragment,lt),lt.forEach(a),Tt.forEach(a),this.h()},h(){j(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(h,$){p(h,e,$),p(h,n,$),p(h,o,$),b(m,o,null),r(o,t),r(o,v),r(o,Te),r(o,H),r(o,Me),r(o,F),b(Je,F,null),r(F,J),r(F,B),r(F,ze),b(ie,F,null),r(F,Qe),b(Q,F,null),r(o,st),r(o,q),b(dt,q,null),r(q,R),r(q,pe),r(q,at),b(K,q,null),r(q,pt),b(me,q,null),r(o,ye),r(o,X),b(ee,X,null),r(X,D),r(X,ue),r(X,De),b(le,X,null),r(X,Et),b(de,X,null),p(h,fe,$),p(h,A,$),p(h,te,$),p(h,O,$),b(ve,O,null),r(O,Ie),r(O,Ue),r(O,oe),r(O,xe),r(O,ft),r(O,ne),b(We,ne,null),r(ne,Ae),r(ne,be),r(ne,Pt),b(G,ne,null),r(ne,Fe),b(Ze,ne,null),p(h,Z,$),p(h,he,$),p(h,N,$),p(h,S,$),b(Ce,S,null),r(S,Ve),r(S,Oe),r(S,ge),r(S,we),r(S,Ke),r(S,C),r(S,Be),r(S,V),b(Y,V,null),r(V,et),r(V,U),r(V,ae),b(Pe,V,null),r(V,w),b(P,V,null),p(h,_e,$),p(h,ht,$),p(h,Re,$),p(h,E,$),b(ke,E,null),r(E,tt),r(E,re),r(E,co),r(E,Rt),r(E,Fo),r(E,Xt),r(E,Zo),r(E,Xe),b(Dt,Xe,null),r(Xe,Kt),r(Xe,vo),r(Xe,Le),b(It,Xe,null),r(Xe,Bo),b(kt,Xe,null),p(h,Go,$),p(h,eo,$),p(h,No,$),p(h,yt,$),b(ot,yt,null),r(yt,to),r(yt,po),r(yt,an),r(yt,mo),r(yt,rn),r(yt,xt),b(Ft,xt,null),r(xt,ln),r(xt,uo),r(xt,no),b(At,xt,null),r(xt,fo),b(so,xt,null),p(h,xo,$),p(h,$t,$),p(h,$o,$),p(h,qe,$),b(go,qe,null),r(qe,qo),r(qe,St),r(qe,Po),r(qe,Zt),r(qe,ko),r(qe,Ee),r(qe,Eo),r(qe,it),b(To,it,null),r(it,Ho),r(it,Yt),r(it,Ro),b(Se,it,null),r(it,ao),b(Ot,it,null),ro=!0},p(h,$){const gt={};$&2&&(gt.$$scope={dirty:$,ctx:h}),ie.$set(gt);const Vt={};$&2&&(Vt.$$scope={dirty:$,ctx:h}),Q.$set(Vt);const Lt={};$&2&&(Lt.$$scope={dirty:$,ctx:h}),K.$set(Lt);const _t={};$&2&&(_t.$$scope={dirty:$,ctx:h}),me.$set(_t);const Bt={};$&2&&(Bt.$$scope={dirty:$,ctx:h}),le.$set(Bt);const vt={};$&2&&(vt.$$scope={dirty:$,ctx:h}),de.$set(vt);const nt={};$&2&&(nt.$$scope={dirty:$,ctx:h}),G.$set(nt);const Ye={};$&2&&(Ye.$$scope={dirty:$,ctx:h}),Ze.$set(Ye);const jt={};$&2&&(jt.$$scope={dirty:$,ctx:h}),Pe.$set(jt);const bt={};$&2&&(bt.$$scope={dirty:$,ctx:h}),P.$set(bt);const Gt={};$&2&&(Gt.$$scope={dirty:$,ctx:h}),It.$set(Gt);const Tt={};$&2&&(Tt.$$scope={dirty:$,ctx:h}),kt.$set(Tt);const lt={};$&2&&(lt.$$scope={dirty:$,ctx:h}),At.$set(lt);const Mn={};$&2&&(Mn.$$scope={dirty:$,ctx:h}),so.$set(Mn);const Xo={};$&2&&(Xo.$$scope={dirty:$,ctx:h}),Se.$set(Xo);const Nt={};$&2&&(Nt.$$scope={dirty:$,ctx:h}),Ot.$set(Nt)},i(h){ro||(T(m.$$.fragment,h),T(Je.$$.fragment,h),T(ie.$$.fragment,h),T(Q.$$.fragment,h),T(dt.$$.fragment,h),T(K.$$.fragment,h),T(me.$$.fragment,h),T(ee.$$.fragment,h),T(le.$$.fragment,h),T(de.$$.fragment,h),T(ve.$$.fragment,h),T(We.$$.fragment,h),T(G.$$.fragment,h),T(Ze.$$.fragment,h),T(Ce.$$.fragment,h),T(Y.$$.fragment,h),T(Pe.$$.fragment,h),T(P.$$.fragment,h),T(ke.$$.fragment,h),T(Dt.$$.fragment,h),T(It.$$.fragment,h),T(kt.$$.fragment,h),T(ot.$$.fragment,h),T(Ft.$$.fragment,h),T(At.$$.fragment,h),T(so.$$.fragment,h),T(go.$$.fragment,h),T(To.$$.fragment,h),T(Se.$$.fragment,h),T(Ot.$$.fragment,h),ro=!0)},o(h){M(m.$$.fragment,h),M(Je.$$.fragment,h),M(ie.$$.fragment,h),M(Q.$$.fragment,h),M(dt.$$.fragment,h),M(K.$$.fragment,h),M(me.$$.fragment,h),M(ee.$$.fragment,h),M(le.$$.fragment,h),M(de.$$.fragment,h),M(ve.$$.fragment,h),M(We.$$.fragment,h),M(G.$$.fragment,h),M(Ze.$$.fragment,h),M(Ce.$$.fragment,h),M(Y.$$.fragment,h),M(Pe.$$.fragment,h),M(P.$$.fragment,h),M(ke.$$.fragment,h),M(Dt.$$.fragment,h),M(It.$$.fragment,h),M(kt.$$.fragment,h),M(ot.$$.fragment,h),M(Ft.$$.fragment,h),M(At.$$.fragment,h),M(so.$$.fragment,h),M(go.$$.fragment,h),M(To.$$.fragment,h),M(Se.$$.fragment,h),M(Ot.$$.fragment,h),ro=!1},d(h){h&&(a(e),a(n),a(o),a(fe),a(A),a(te),a(O),a(Z),a(he),a(N),a(S),a(_e),a(ht),a(Re),a(E),a(Go),a(eo),a(No),a(yt),a(xo),a($t),a($o),a(qe)),y(m),y(Je),y(ie),y(Q),y(dt),y(K),y(me),y(ee),y(le),y(de),y(ve),y(We),y(G),y(Ze),y(Ce),y(Y),y(Pe),y(P),y(ke),y(Dt),y(It),y(kt),y(ot),y(Ft),y(At),y(so),y(go),y(To),y(Se),y(Ot)}}}function Ls(x){let e,u;return e=new Rn({props:{$$slots:{default:[ks]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment)},l(n){_(e.$$.fragment,n)},m(n,o){b(e,n,o),u=!0},p(n,o){const m={};o&2&&(m.$$scope={dirty:o,ctx:n}),e.$set(m)},i(n){u||(T(e.$$.fragment,n),u=!0)},o(n){M(e.$$.fragment,n),u=!1},d(n){y(e,n)}}}function js(x){let e,u="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",n,o,m="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",t,v,Ct=`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 <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,Te,H,wt=`<li>a single Tensor with <code>input_ids</code> only and nothing else: <code>model(input_ids)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_ids, attention_mask])</code> or <code>model([input_ids, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_ids&quot;: input_ids, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,Me,F,Je=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){e=d("p"),e.innerHTML=u,n=i(),o=d("ul"),o.innerHTML=m,t=i(),v=d("p"),v.innerHTML=Ct,Te=i(),H=d("ul"),H.innerHTML=wt,Me=i(),F=d("p"),F.innerHTML=Je},l(J){e=c(J,"P",{"data-svelte-h":!0}),f(e)!=="svelte-1ajbfxg"&&(e.innerHTML=u),n=l(J),o=c(J,"UL",{"data-svelte-h":!0}),f(o)!=="svelte-qm1t26"&&(o.innerHTML=m),t=l(J),v=c(J,"P",{"data-svelte-h":!0}),f(v)!=="svelte-1v9qsc5"&&(v.innerHTML=Ct),Te=l(J),H=c(J,"UL",{"data-svelte-h":!0}),f(H)!=="svelte-15scerc"&&(H.innerHTML=wt),Me=l(J),F=c(J,"P",{"data-svelte-h":!0}),f(F)!=="svelte-1an3odd"&&(F.innerHTML=Je)},m(J,B){p(J,e,B),p(J,n,B),p(J,o,B),p(J,t,B),p(J,v,B),p(J,Te,B),p(J,H,B),p(J,Me,B),p(J,F,B)},p:W,d(J){J&&(a(e),a(n),a(o),a(t),a(v),a(Te),a(H),a(Me),a(F))}}}function Js(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function zs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwVEZDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFRGQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwdGYubm4uc29mdG1heChsb2dpdHNfcGVyX2ltYWdlJTJDJTIwYXhpcyUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Us(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Ws(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkNMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVEZDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEF0ZXh0X2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X3RleHRfZmVhdHVyZXMoKippbnB1dHMp",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Fs(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Zs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQ0xJUE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkNMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyk=",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Vs(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Bs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkNMSVBUZXh0TW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFRGQ0xJUFRleHRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwKEVPUyUyMHRva2VuKSUyMHN0YXRlcw==",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Gs(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Ns(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQ0xJUFZpc2lvbk1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkNMSVBWaXNpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMENMUyUyMHN0YXRlcw==",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function qs(x){let e,u="## TFCLIPModel[[transformers.TFCLIPModel]]",n,o,m,t,v,Ct=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Te,H,wt=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</a> subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`,Me,F,Je,J,B,zt,ze,ie='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.TFCLIPModel">TFCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',Qe,Q,st,q,dt,R,pe,ct,at,K='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.TFCLIPModel">TFCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',pt,me,ye,X,ee,D,ue,mt,De,le='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.TFCLIPModel">TFCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',Et,de,fe,A,rt,te,O="## TFCLIPTextModel[[transformers.TFCLIPTextModel]]",ve,Ie,Ue,ut,oe,xe,$e,ft,ne='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.TFCLIPTextModel">TFCLIPTextModel</a> forward method, overrides the <code>__call__</code> special method.',We,Ae,be,ce,Pt,G,Fe="## TFCLIPVisionModel[[transformers.TFCLIPVisionModel]]",Ze,Z,he,Ut,N,S,Ce,Ve,Oe='The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.TFCLIPVisionModel">TFCLIPVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Ht,ge,we,se,Ke;return m=new z({props:{name:"class transformers.TFCLIPModel",anchor:"transformers.TFCLIPModel",parameters:[{name:"config",val:": CLIPConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1300"}}),F=new Mt({props:{$$slots:{default:[js]},$$scope:{ctx:x}}}),B=new z({props:{name:"call",anchor:"transformers.TFCLIPModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"return_loss",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": 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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1391",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>tf.Tensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>tf.Tensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>tf.Tensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/pr_31208/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>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/pr_31208/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/pr_31208/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/pr_31208/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Q=new Mt({props:{$$slots:{default:[Js]},$$scope:{ctx:x}}}),q=new He({props:{anchor:"transformers.TFCLIPModel.call.example",$$slots:{default:[zs]},$$scope:{ctx:x}}}),pe=new z({props:{name:"get_text_features",anchor:"transformers.TFCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": 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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1309",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>text_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),me=new Mt({props:{$$slots:{default:[Us]},$$scope:{ctx:x}}}),X=new He({props:{anchor:"transformers.TFCLIPModel.get_text_features.example",$$slots:{default:[Ws]},$$scope:{ctx:x}}}),ue=new z({props:{name:"get_image_features",anchor:"transformers.TFCLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": 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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1349",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>image_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),de=new Mt({props:{$$slots:{default:[Fs]},$$scope:{ctx:x}}}),A=new He({props:{anchor:"transformers.TFCLIPModel.get_image_features.example",$$slots:{default:[Zs]},$$scope:{ctx:x}}}),Ue=new z({props:{name:"class transformers.TFCLIPTextModel",anchor:"transformers.TFCLIPTextModel",parameters:[{name:"config",val:": CLIPTextConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1178"}}),xe=new z({props:{name:"call",anchor:"transformers.TFCLIPTextModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = 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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1186",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you’re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ae=new Mt({props:{$$slots:{default:[Vs]},$$scope:{ctx:x}}}),ce=new He({props:{anchor:"transformers.TFCLIPTextModel.call.example",$$slots:{default:[Bs]},$$scope:{ctx:x}}}),he=new z({props:{name:"class transformers.TFCLIPVisionModel",anchor:"transformers.TFCLIPVisionModel",parameters:[{name:"config",val:": CLIPVisionConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1238"}}),S=new z({props:{name:"call",anchor:"transformers.TFCLIPVisionModel.call",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = 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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_tf_clip.py#L1247",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you’re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ge=new Mt({props:{$$slots:{default:[Gs]},$$scope:{ctx:x}}}),se=new He({props:{anchor:"transformers.TFCLIPVisionModel.call.example",$$slots:{default:[Ns]},$$scope:{ctx:x}}}),{c(){e=d("p"),e.textContent=u,n=i(),o=d("div"),g(m.$$.fragment),t=i(),v=d("p"),v.innerHTML=Ct,Te=i(),H=d("p"),H.innerHTML=wt,Me=i(),g(F.$$.fragment),Je=i(),J=d("div"),g(B.$$.fragment),zt=i(),ze=d("p"),ze.innerHTML=ie,Qe=i(),g(Q.$$.fragment),st=i(),g(q.$$.fragment),dt=i(),R=d("div"),g(pe.$$.fragment),ct=i(),at=d("p"),at.innerHTML=K,pt=i(),g(me.$$.fragment),ye=i(),g(X.$$.fragment),ee=i(),D=d("div"),g(ue.$$.fragment),mt=i(),De=d("p"),De.innerHTML=le,Et=i(),g(de.$$.fragment),fe=i(),g(A.$$.fragment),rt=i(),te=d("p"),te.textContent=O,ve=i(),Ie=d("div"),g(Ue.$$.fragment),ut=i(),oe=d("div"),g(xe.$$.fragment),$e=i(),ft=d("p"),ft.innerHTML=ne,We=i(),g(Ae.$$.fragment),be=i(),g(ce.$$.fragment),Pt=i(),G=d("p"),G.textContent=Fe,Ze=i(),Z=d("div"),g(he.$$.fragment),Ut=i(),N=d("div"),g(S.$$.fragment),Ce=i(),Ve=d("p"),Ve.innerHTML=Oe,Ht=i(),g(ge.$$.fragment),we=i(),g(se.$$.fragment),this.h()},l(C){e=c(C,"P",{"data-svelte-h":!0}),f(e)!=="svelte-qspq0k"&&(e.textContent=u),n=l(C),o=c(C,"DIV",{class:!0});var k=L(o);_(m.$$.fragment,k),t=l(k),v=c(k,"P",{"data-svelte-h":!0}),f(v)!=="svelte-vdkcio"&&(v.innerHTML=Ct),Te=l(k),H=c(k,"P",{"data-svelte-h":!0}),f(H)!=="svelte-1be7e3c"&&(H.innerHTML=wt),Me=l(k),_(F.$$.fragment,k),Je=l(k),J=c(k,"DIV",{class:!0});var Be=L(J);_(B.$$.fragment,Be),zt=l(Be),ze=c(Be,"P",{"data-svelte-h":!0}),f(ze)!=="svelte-nhcmn9"&&(ze.innerHTML=ie),Qe=l(Be),_(Q.$$.fragment,Be),st=l(Be),_(q.$$.fragment,Be),Be.forEach(a),dt=l(k),R=c(k,"DIV",{class:!0});var V=L(R);_(pe.$$.fragment,V),ct=l(V),at=c(V,"P",{"data-svelte-h":!0}),f(at)!=="svelte-nhcmn9"&&(at.innerHTML=K),pt=l(V),_(me.$$.fragment,V),ye=l(V),_(X.$$.fragment,V),V.forEach(a),ee=l(k),D=c(k,"DIV",{class:!0});var Y=L(D);_(ue.$$.fragment,Y),mt=l(Y),De=c(Y,"P",{"data-svelte-h":!0}),f(De)!=="svelte-nhcmn9"&&(De.innerHTML=le),Et=l(Y),_(de.$$.fragment,Y),fe=l(Y),_(A.$$.fragment,Y),Y.forEach(a),k.forEach(a),rt=l(C),te=c(C,"P",{"data-svelte-h":!0}),f(te)!=="svelte-hhjh7s"&&(te.textContent=O),ve=l(C),Ie=c(C,"DIV",{class:!0});var et=L(Ie);_(Ue.$$.fragment,et),ut=l(et),oe=c(et,"DIV",{class:!0});var U=L(oe);_(xe.$$.fragment,U),$e=l(U),ft=c(U,"P",{"data-svelte-h":!0}),f(ft)!=="svelte-116vpdt"&&(ft.innerHTML=ne),We=l(U),_(Ae.$$.fragment,U),be=l(U),_(ce.$$.fragment,U),U.forEach(a),et.forEach(a),Pt=l(C),G=c(C,"P",{"data-svelte-h":!0}),f(G)!=="svelte-1q55juw"&&(G.textContent=Fe),Ze=l(C),Z=c(C,"DIV",{class:!0});var Ge=L(Z);_(he.$$.fragment,Ge),Ut=l(Ge),N=c(Ge,"DIV",{class:!0});var ae=L(N);_(S.$$.fragment,ae),Ce=l(ae),Ve=c(ae,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-e3izex"&&(Ve.innerHTML=Oe),Ht=l(ae),_(ge.$$.fragment,ae),we=l(ae),_(se.$$.fragment,ae),ae.forEach(a),Ge.forEach(a),this.h()},h(){j(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(C,k){p(C,e,k),p(C,n,k),p(C,o,k),b(m,o,null),r(o,t),r(o,v),r(o,Te),r(o,H),r(o,Me),b(F,o,null),r(o,Je),r(o,J),b(B,J,null),r(J,zt),r(J,ze),r(J,Qe),b(Q,J,null),r(J,st),b(q,J,null),r(o,dt),r(o,R),b(pe,R,null),r(R,ct),r(R,at),r(R,pt),b(me,R,null),r(R,ye),b(X,R,null),r(o,ee),r(o,D),b(ue,D,null),r(D,mt),r(D,De),r(D,Et),b(de,D,null),r(D,fe),b(A,D,null),p(C,rt,k),p(C,te,k),p(C,ve,k),p(C,Ie,k),b(Ue,Ie,null),r(Ie,ut),r(Ie,oe),b(xe,oe,null),r(oe,$e),r(oe,ft),r(oe,We),b(Ae,oe,null),r(oe,be),b(ce,oe,null),p(C,Pt,k),p(C,G,k),p(C,Ze,k),p(C,Z,k),b(he,Z,null),r(Z,Ut),r(Z,N),b(S,N,null),r(N,Ce),r(N,Ve),r(N,Ht),b(ge,N,null),r(N,we),b(se,N,null),Ke=!0},p(C,k){const Be={};k&2&&(Be.$$scope={dirty:k,ctx:C}),F.$set(Be);const V={};k&2&&(V.$$scope={dirty:k,ctx:C}),Q.$set(V);const Y={};k&2&&(Y.$$scope={dirty:k,ctx:C}),q.$set(Y);const et={};k&2&&(et.$$scope={dirty:k,ctx:C}),me.$set(et);const U={};k&2&&(U.$$scope={dirty:k,ctx:C}),X.$set(U);const Ge={};k&2&&(Ge.$$scope={dirty:k,ctx:C}),de.$set(Ge);const ae={};k&2&&(ae.$$scope={dirty:k,ctx:C}),A.$set(ae);const Pe={};k&2&&(Pe.$$scope={dirty:k,ctx:C}),Ae.$set(Pe);const w={};k&2&&(w.$$scope={dirty:k,ctx:C}),ce.$set(w);const P={};k&2&&(P.$$scope={dirty:k,ctx:C}),ge.$set(P);const _e={};k&2&&(_e.$$scope={dirty:k,ctx:C}),se.$set(_e)},i(C){Ke||(T(m.$$.fragment,C),T(F.$$.fragment,C),T(B.$$.fragment,C),T(Q.$$.fragment,C),T(q.$$.fragment,C),T(pe.$$.fragment,C),T(me.$$.fragment,C),T(X.$$.fragment,C),T(ue.$$.fragment,C),T(de.$$.fragment,C),T(A.$$.fragment,C),T(Ue.$$.fragment,C),T(xe.$$.fragment,C),T(Ae.$$.fragment,C),T(ce.$$.fragment,C),T(he.$$.fragment,C),T(S.$$.fragment,C),T(ge.$$.fragment,C),T(se.$$.fragment,C),Ke=!0)},o(C){M(m.$$.fragment,C),M(F.$$.fragment,C),M(B.$$.fragment,C),M(Q.$$.fragment,C),M(q.$$.fragment,C),M(pe.$$.fragment,C),M(me.$$.fragment,C),M(X.$$.fragment,C),M(ue.$$.fragment,C),M(de.$$.fragment,C),M(A.$$.fragment,C),M(Ue.$$.fragment,C),M(xe.$$.fragment,C),M(Ae.$$.fragment,C),M(ce.$$.fragment,C),M(he.$$.fragment,C),M(S.$$.fragment,C),M(ge.$$.fragment,C),M(se.$$.fragment,C),Ke=!1},d(C){C&&(a(e),a(n),a(o),a(rt),a(te),a(ve),a(Ie),a(Pt),a(G),a(Ze),a(Z)),y(m),y(F),y(B),y(Q),y(q),y(pe),y(me),y(X),y(ue),y(de),y(A),y(Ue),y(xe),y(Ae),y(ce),y(he),y(S),y(ge),y(se)}}}function Es(x){let e,u;return e=new Rn({props:{$$slots:{default:[qs]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment)},l(n){_(e.$$.fragment,n)},m(n,o){b(e,n,o),u=!0},p(n,o){const m={};o&2&&(m.$$scope={dirty:o,ctx:n}),e.$set(m)},i(n){u||(T(e.$$.fragment,n),u=!0)},o(n){M(e.$$.fragment,n),u=!1},d(n){y(e,n)}}}function Hs(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Rs(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"aW1wb3J0JTIwamF4JTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMEElMjAlMjAlMjAlMjB0ZXh0JTNEJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBqYXgubm4uc29mdG1heChsb2dpdHNfcGVyX2ltYWdlJTJDJTIwYXhpcyUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Xs(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4Q0xJUE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4Q0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKQ==",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Ss(x){let e,u="Examples:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBJTBBaW1hZ2VfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfaW1hZ2VfZmVhdHVyZXMoKippbnB1dHMp",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)`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-kvfsh7"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Ys(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Qs(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4Q0xJUFRleHRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheENMSVBUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVyX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMChFT1MlMjB0b2tlbiklMjBzdGF0ZXM=",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Ds(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function As(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4Q0xJUFRleHRNb2RlbFdpdGhQcm9qZWN0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4Q0xJUFRleHRNb2RlbFdpdGhQcm9qZWN0aW9uLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXRleHRfZW1iZWRzJTIwJTNEJTIwb3V0cHV0cy50ZXh0X2VtYmVkcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxCLIPTextModelWithProjection

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPTextModelWithProjection.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>text_embeds = outputs.text_embeds`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function Os(x){let e,u=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){e=d("p"),e.innerHTML=u},l(n){e=c(n,"P",{"data-svelte-h":!0}),f(e)!=="svelte-fincs2"&&(e.innerHTML=u)},m(n,o){p(n,e,o)},p:W,d(n){n&&a(e)}}}function Ks(x){let e,u="Example:",n,o,m;return o=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhDTElQVmlzaW9uTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhDTElQVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlcl9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjBDTFMlMjBzdGF0ZXM=",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>`,wrap:!1}}),{c(){e=d("p"),e.textContent=u,n=i(),g(o.$$.fragment)},l(t){e=c(t,"P",{"data-svelte-h":!0}),f(e)!=="svelte-11lpom8"&&(e.textContent=u),n=l(t),_(o.$$.fragment,t)},m(t,v){p(t,e,v),p(t,n,v),b(o,t,v),m=!0},p:W,i(t){m||(T(o.$$.fragment,t),m=!0)},o(t){M(o.$$.fragment,t),m=!1},d(t){t&&(a(e),a(n)),y(o,t)}}}function ea(x){let e,u="## FlaxCLIPModel[[transformers.FlaxCLIPModel]]",n,o,m,t,v,Ct=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a>. 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)`,Te,H,wt=`This model is also a
<a href="https://flax.readthedocs.io/en/latest/api_reference/flax.linen/module.html" rel="nofollow">flax.linen.Module</a> subclass. Use it as
a regular Flax linen Module and refer to the Flax documentation for all matter related to general usage and
behavior.`,Me,F,Je="Finally, this model supports inherent JAX features such as:",J,B,zt='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',ze,ie,Qe,Q,st,q="The <code>FlaxCLIPPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",dt,R,pe,ct,at,K,pt,me,ye,X,ee,D,ue,mt,De,le,Et="## FlaxCLIPTextModel[[transformers.FlaxCLIPTextModel]]",de,fe,A,rt,te,O,ve,Ie,Ue="The <code>FlaxCLIPTextPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",ut,oe,xe,$e,ft,ne,We="## FlaxCLIPTextModelWithProjection[[transformers.FlaxCLIPTextModelWithProjection]]",Ae,be,ce,Pt,G,Fe,Ze,Z,he="The <code>FlaxCLIPTextPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Ut,N,S,Ce,Ve,Oe,Ht="## FlaxCLIPVisionModel[[transformers.FlaxCLIPVisionModel]]",ge,we,se,Ke,C,k,Be,V,Y="The <code>FlaxCLIPVisionPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",et,U,Ge,ae,Pe;return m=new z({props:{name:"class transformers.FlaxCLIPModel",anchor:"transformers.FlaxCLIPModel",parameters:[{name:"config",val:": CLIPConfig"},{name:"input_shape",val:": Optional = 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/pr_31208/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/pr_31208/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/pr_31208/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L1262"}}),Qe=new z({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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L820",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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>) — 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>) — 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>) — The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/pr_31208/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>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/pr_31208/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/pr_31208/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/pr_31208/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),R=new Mt({props:{$$slots:{default:[Hs]},$$scope:{ctx:x}}}),ct=new He({props:{anchor:"transformers.FlaxCLIPModel.__call__.example",$$slots:{default:[Rs]},$$scope:{ctx:x}}}),pt=new z({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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L865",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>text_features (<code>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),ye=new He({props:{anchor:"transformers.FlaxCLIPModel.get_text_features.example",$$slots:{default:[Xs]},$$scope:{ctx:x}}}),D=new z({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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L932",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>image_features (<code>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),mt=new He({props:{anchor:"transformers.FlaxCLIPModel.get_image_features.example",$$slots:{default:[Ss]},$$scope:{ctx:x}}}),A=new z({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/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L1012"}}),O=new z({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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L665",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new Mt({props:{$$slots:{default:[Ys]},$$scope:{ctx:x}}}),$e=new He({props:{anchor:"transformers.FlaxCLIPTextModel.__call__.example",$$slots:{default:[Qs]},$$scope:{ctx:x}}}),ce=new z({props:{name:"class transformers.FlaxCLIPTextModelWithProjection",anchor:"transformers.FlaxCLIPTextModelWithProjection",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/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L1083"}}),Fe=new z({props:{name:"__call__",anchor:"transformers.FlaxCLIPTextModelWithProjection.__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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.FlaxCLIPTextModelWithProjection.__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/pr_31208/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31208/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.FlaxCLIPTextModelWithProjection.__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.FlaxCLIPTextModelWithProjection.__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.FlaxCLIPTextModelWithProjection.__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.FlaxCLIPTextModelWithProjection.__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.FlaxCLIPTextModelWithProjection.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L665",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.clip.modeling_flax_clip.FlaxCLIPTextModelOutput</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>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.clip.modeling_flax_clip.FlaxCLIPTextModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),N=new Mt({props:{$$slots:{default:[Ds]},$$scope:{ctx:x}}}),Ce=new He({props:{anchor:"transformers.FlaxCLIPTextModelWithProjection.__call__.example",$$slots:{default:[As]},$$scope:{ctx:x}}}),se=new z({props:{name:"class transformers.FlaxCLIPVisionModel",anchor:"transformers.FlaxCLIPVisionModel",parameters:[{name:"config",val:": CLIPVisionConfig"},{name:"input_shape",val:": Optional = 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/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L1137"}}),k=new z({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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_31208/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_31208/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/modeling_flax_clip.py#L745",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),U=new Mt({props:{$$slots:{default:[Os]},$$scope:{ctx:x}}}),ae=new He({props:{anchor:"transformers.FlaxCLIPVisionModel.__call__.example",$$slots:{default:[Ks]},$$scope:{ctx:x}}}),{c(){e=d("p"),e.textContent=u,n=i(),o=d("div"),g(m.$$.fragment),t=i(),v=d("p"),v.innerHTML=Ct,Te=i(),H=d("p"),H.innerHTML=wt,Me=i(),F=d("p"),F.textContent=Je,J=i(),B=d("ul"),B.innerHTML=zt,ze=i(),ie=d("div"),g(Qe.$$.fragment),Q=i(),st=d("p"),st.innerHTML=q,dt=i(),g(R.$$.fragment),pe=i(),g(ct.$$.fragment),at=i(),K=d("div"),g(pt.$$.fragment),me=i(),g(ye.$$.fragment),X=i(),ee=d("div"),g(D.$$.fragment),ue=i(),g(mt.$$.fragment),De=i(),le=d("p"),le.textContent=Et,de=i(),fe=d("div"),g(A.$$.fragment),rt=i(),te=d("div"),g(O.$$.fragment),ve=i(),Ie=d("p"),Ie.innerHTML=Ue,ut=i(),g(oe.$$.fragment),xe=i(),g($e.$$.fragment),ft=i(),ne=d("p"),ne.textContent=We,Ae=i(),be=d("div"),g(ce.$$.fragment),Pt=i(),G=d("div"),g(Fe.$$.fragment),Ze=i(),Z=d("p"),Z.innerHTML=he,Ut=i(),g(N.$$.fragment),S=i(),g(Ce.$$.fragment),Ve=i(),Oe=d("p"),Oe.textContent=Ht,ge=i(),we=d("div"),g(se.$$.fragment),Ke=i(),C=d("div"),g(k.$$.fragment),Be=i(),V=d("p"),V.innerHTML=Y,et=i(),g(U.$$.fragment),Ge=i(),g(ae.$$.fragment),this.h()},l(w){e=c(w,"P",{"data-svelte-h":!0}),f(e)!=="svelte-1auycq4"&&(e.textContent=u),n=l(w),o=c(w,"DIV",{class:!0});var P=L(o);_(m.$$.fragment,P),t=l(P),v=c(P,"P",{"data-svelte-h":!0}),f(v)!=="svelte-13bzrw9"&&(v.innerHTML=Ct),Te=l(P),H=c(P,"P",{"data-svelte-h":!0}),f(H)!=="svelte-10nfsf3"&&(H.innerHTML=wt),Me=l(P),F=c(P,"P",{"data-svelte-h":!0}),f(F)!=="svelte-1pplc4a"&&(F.textContent=Je),J=l(P),B=c(P,"UL",{"data-svelte-h":!0}),f(B)!=="svelte-m6h3rq"&&(B.innerHTML=zt),ze=l(P),ie=c(P,"DIV",{class:!0});var _e=L(ie);_(Qe.$$.fragment,_e),Q=l(_e),st=c(_e,"P",{"data-svelte-h":!0}),f(st)!=="svelte-qhvesh"&&(st.innerHTML=q),dt=l(_e),_(R.$$.fragment,_e),pe=l(_e),_(ct.$$.fragment,_e),_e.forEach(a),at=l(P),K=c(P,"DIV",{class:!0});var ht=L(K);_(pt.$$.fragment,ht),me=l(ht),_(ye.$$.fragment,ht),ht.forEach(a),X=l(P),ee=c(P,"DIV",{class:!0});var Wt=L(ee);_(D.$$.fragment,Wt),ue=l(Wt),_(mt.$$.fragment,Wt),Wt.forEach(a),P.forEach(a),De=l(w),le=c(w,"P",{"data-svelte-h":!0}),f(le)!=="svelte-oehsdk"&&(le.textContent=Et),de=l(w),fe=c(w,"DIV",{class:!0});var Re=L(fe);_(A.$$.fragment,Re),rt=l(Re),te=c(Re,"DIV",{class:!0});var E=L(te);_(O.$$.fragment,E),ve=l(E),Ie=c(E,"P",{"data-svelte-h":!0}),f(Ie)!=="svelte-1v5d1sw"&&(Ie.innerHTML=Ue),ut=l(E),_(oe.$$.fragment,E),xe=l(E),_($e.$$.fragment,E),E.forEach(a),Re.forEach(a),ft=l(w),ne=c(w,"P",{"data-svelte-h":!0}),f(ne)!=="svelte-50kleg"&&(ne.textContent=We),Ae=l(w),be=c(w,"DIV",{class:!0});var ke=L(be);_(ce.$$.fragment,ke),Pt=l(ke),G=c(ke,"DIV",{class:!0});var tt=L(G);_(Fe.$$.fragment,tt),Ze=l(tt),Z=c(tt,"P",{"data-svelte-h":!0}),f(Z)!=="svelte-1v5d1sw"&&(Z.innerHTML=he),Ut=l(tt),_(N.$$.fragment,tt),S=l(tt),_(Ce.$$.fragment,tt),tt.forEach(a),ke.forEach(a),Ve=l(w),Oe=c(w,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-1pto1l0"&&(Oe.textContent=Ht),ge=l(w),we=c(w,"DIV",{class:!0});var re=L(we);_(se.$$.fragment,re),Ke=l(re),C=c(re,"DIV",{class:!0});var Ne=L(C);_(k.$$.fragment,Ne),Be=l(Ne),V=c(Ne,"P",{"data-svelte-h":!0}),f(V)!=="svelte-tkfbrd"&&(V.innerHTML=Y),et=l(Ne),_(U.$$.fragment,Ne),Ge=l(Ne),_(ae.$$.fragment,Ne),Ne.forEach(a),re.forEach(a),this.h()},h(){j(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(w,P){p(w,e,P),p(w,n,P),p(w,o,P),b(m,o,null),r(o,t),r(o,v),r(o,Te),r(o,H),r(o,Me),r(o,F),r(o,J),r(o,B),r(o,ze),r(o,ie),b(Qe,ie,null),r(ie,Q),r(ie,st),r(ie,dt),b(R,ie,null),r(ie,pe),b(ct,ie,null),r(o,at),r(o,K),b(pt,K,null),r(K,me),b(ye,K,null),r(o,X),r(o,ee),b(D,ee,null),r(ee,ue),b(mt,ee,null),p(w,De,P),p(w,le,P),p(w,de,P),p(w,fe,P),b(A,fe,null),r(fe,rt),r(fe,te),b(O,te,null),r(te,ve),r(te,Ie),r(te,ut),b(oe,te,null),r(te,xe),b($e,te,null),p(w,ft,P),p(w,ne,P),p(w,Ae,P),p(w,be,P),b(ce,be,null),r(be,Pt),r(be,G),b(Fe,G,null),r(G,Ze),r(G,Z),r(G,Ut),b(N,G,null),r(G,S),b(Ce,G,null),p(w,Ve,P),p(w,Oe,P),p(w,ge,P),p(w,we,P),b(se,we,null),r(we,Ke),r(we,C),b(k,C,null),r(C,Be),r(C,V),r(C,et),b(U,C,null),r(C,Ge),b(ae,C,null),Pe=!0},p(w,P){const _e={};P&2&&(_e.$$scope={dirty:P,ctx:w}),R.$set(_e);const ht={};P&2&&(ht.$$scope={dirty:P,ctx:w}),ct.$set(ht);const Wt={};P&2&&(Wt.$$scope={dirty:P,ctx:w}),ye.$set(Wt);const Re={};P&2&&(Re.$$scope={dirty:P,ctx:w}),mt.$set(Re);const E={};P&2&&(E.$$scope={dirty:P,ctx:w}),oe.$set(E);const ke={};P&2&&(ke.$$scope={dirty:P,ctx:w}),$e.$set(ke);const tt={};P&2&&(tt.$$scope={dirty:P,ctx:w}),N.$set(tt);const re={};P&2&&(re.$$scope={dirty:P,ctx:w}),Ce.$set(re);const Ne={};P&2&&(Ne.$$scope={dirty:P,ctx:w}),U.$set(Ne);const co={};P&2&&(co.$$scope={dirty:P,ctx:w}),ae.$set(co)},i(w){Pe||(T(m.$$.fragment,w),T(Qe.$$.fragment,w),T(R.$$.fragment,w),T(ct.$$.fragment,w),T(pt.$$.fragment,w),T(ye.$$.fragment,w),T(D.$$.fragment,w),T(mt.$$.fragment,w),T(A.$$.fragment,w),T(O.$$.fragment,w),T(oe.$$.fragment,w),T($e.$$.fragment,w),T(ce.$$.fragment,w),T(Fe.$$.fragment,w),T(N.$$.fragment,w),T(Ce.$$.fragment,w),T(se.$$.fragment,w),T(k.$$.fragment,w),T(U.$$.fragment,w),T(ae.$$.fragment,w),Pe=!0)},o(w){M(m.$$.fragment,w),M(Qe.$$.fragment,w),M(R.$$.fragment,w),M(ct.$$.fragment,w),M(pt.$$.fragment,w),M(ye.$$.fragment,w),M(D.$$.fragment,w),M(mt.$$.fragment,w),M(A.$$.fragment,w),M(O.$$.fragment,w),M(oe.$$.fragment,w),M($e.$$.fragment,w),M(ce.$$.fragment,w),M(Fe.$$.fragment,w),M(N.$$.fragment,w),M(Ce.$$.fragment,w),M(se.$$.fragment,w),M(k.$$.fragment,w),M(U.$$.fragment,w),M(ae.$$.fragment,w),Pe=!1},d(w){w&&(a(e),a(n),a(o),a(De),a(le),a(de),a(fe),a(ft),a(ne),a(Ae),a(be),a(Ve),a(Oe),a(ge),a(we)),y(m),y(Qe),y(R),y(ct),y(pt),y(ye),y(D),y(mt),y(A),y(O),y(oe),y($e),y(ce),y(Fe),y(N),y(Ce),y(se),y(k),y(U),y(ae)}}}function ta(x){let e,u;return e=new Rn({props:{$$slots:{default:[ea]},$$scope:{ctx:x}}}),{c(){g(e.$$.fragment)},l(n){_(e.$$.fragment,n)},m(n,o){b(e,n,o),u=!0},p(n,o){const m={};o&2&&(m.$$scope={dirty:o,ctx:n}),e.$set(m)},i(n){u||(T(e.$$.fragment,n),u=!0)},o(n){M(e.$$.fragment,n),u=!1},d(n){y(e,n)}}}function oa(x){let e,u,n,o,m,t,v,Ct,Te,H=`The CLIP model was proposed in <a href="https://arxiv.org/abs/2103.00020" rel="nofollow">Learning Transferable Visual Models From Natural Language Supervision</a> 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.`,wt,Me,F="The abstract from the paper is the following:",Je,J,B=`<em>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.</em>`,zt,ze,ie='This model was contributed by <a href="https://huggingface.co/valhalla" rel="nofollow">valhalla</a>. The original code can be found <a href="https://github.com/openai/CLIP" rel="nofollow">here</a>.',Qe,Q,st,q,dt=`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.`,R,pe,ct=`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 <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> can be used to resize (or rescale) and normalize images for the model.`,at,K,pt=`The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a> is used to encode the text. The <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPProcessor">CLIPProcessor</a> wraps
<a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a> 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
<a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPProcessor">CLIPProcessor</a> and <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a>.`,me,ye,X,ee,D,ue,mt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with CLIP.",De,le,Et='<li><a href="https://huggingface.co/blog/fine-tune-clip-rsicd" rel="nofollow">Fine tuning CLIP with Remote Sensing (Satellite) images and captions</a>, a blog post about how to fine-tune CLIP with <a href="https://github.com/201528014227051/RSICD_optimal" rel="nofollow">RSICD dataset</a> and comparison of performance changes due to data augmentation.</li> <li>This <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text" rel="nofollow">example script</a> shows how to train a CLIP-like vision-text dual encoder model using a pre-trained vision and text encoder using <a href="https://cocodataset.org/#home" rel="nofollow">COCO dataset</a>.</li>',de,fe,A,rt,te='<li>A <a href="https://colab.research.google.com/drive/1tuoAC5F4sC7qid56Z0ap-stR3rwdk0ZV?usp=sharing" rel="nofollow">notebook</a> on how to use a pretrained CLIP for inference with beam search for image captioning. 🌎</li>',O,ve,Ie="<strong>Image retrieval</strong>",Ue,ut,oe='<li>A <a href="https://colab.research.google.com/drive/1bLVwVKpAndpEDHqjzxVPr_9nGrSbuOQd?usp=sharing" rel="nofollow">notebook</a> on image retrieval using pretrained CLIP and computing MRR(Mean Reciprocal Rank) score. 🌎</li> <li>A <a href="https://colab.research.google.com/github/deep-diver/image_search_with_natural_language/blob/main/notebooks/Image_Search_CLIP.ipynb" rel="nofollow">notebook</a> on image retrieval and showing the similarity score. 🌎</li> <li>A <a href="https://colab.research.google.com/drive/1xO-wC_m_GNzgjIBQ4a4znvQkvDoZJvH4?usp=sharing" rel="nofollow">notebook</a> on how to map images and texts to the same vector space using Multilingual CLIP. 🌎</li> <li>A <a href="https://colab.research.google.com/github/vivien000/clip-demo/blob/master/clip.ipynb#scrollTo=uzdFhRGqiWkR" rel="nofollow">notebook</a> on how to run CLIP on semantic image search using <a href="https://unsplash.com" rel="nofollow">Unsplash</a> and <a href="https://www.themoviedb.org/" rel="nofollow">TMDB</a> datasets. 🌎</li>',xe,$e,ft="<strong>Explainability</strong>",ne,We,Ae='<li>A <a href="https://colab.research.google.com/github/hila-chefer/Transformer-MM-Explainability/blob/main/CLIP_explainability.ipynb" rel="nofollow">notebook</a> on how to visualize similarity between input token and image segment. 🌎</li>',be,ce,Pt=`If you’re 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.`,G,Fe,Ze,Z,he,Ut,N,S=`<a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a>. 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
<a href="https://huggingface.co/openai/clip-vit-base-patch32" rel="nofollow">openai/clip-vit-base-patch32</a> architecture.`,Ce,Ve,Oe=`Configuration objects inherit from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ht,ge,we,se,Ke,C,k,Be=`Instantiate a <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a> (or a derived class) from clip text model configuration and clip vision model
configuration.`,V,Y,et,U,Ge,ae,Pe,w=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTextModel">CLIPTextModel</a>. 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
<a href="https://huggingface.co/openai/clip-vit-base-patch32" rel="nofollow">openai/clip-vit-base-patch32</a> architecture.`,P,_e,ht=`Configuration objects inherit from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Wt,Re,E,ke,tt,re,Ne,co,Rt,gn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPVisionModel">CLIPVisionModel</a>. 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
<a href="https://huggingface.co/openai/clip-vit-base-patch32" rel="nofollow">openai/clip-vit-base-patch32</a> architecture.`,Fo,Xt,_n=`Configuration objects inherit from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Zo,Xe,Dt,Kt,vo="## CLIPTokenizer[[transformers.CLIPTokenizer]]",Vo,Le,It,Bo,kt,Go="Construct a CLIP tokenizer. Based on byte-level Byte-Pair-Encoding.",eo,Co,No=`This tokenizer inherits from <a href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,yt,ot,to,po,wo,an=`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:`,mo,Io,rn="<li>single sequence: <code>&lt;|startoftext|&gt; X &lt;|endoftext|&gt;</code></li>",xt,Ft,ln="Pairs of sequences are not the expected use case, but they will be handled without a separator.",uo,oo,no,At,fo,so=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> method.`,xo,$t,ho,$o,qe,go=`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`,qo,St,_o,Po,Zt,bn="## CLIPTokenizerFast[[transformers.CLIPTokenizerFast]]",ko,Ee,bo,Eo,it,To=`Construct a “fast” CLIP tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level
Byte-Pair-Encoding.`,Ho,Yt,Tn=`This tokenizer inherits from <a href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Ro,Se,ao,Ot,ro,h=`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:`,$,gt,Vt="<li>single sequence: <code>&lt;|startoftext|&gt; X &lt;|endoftext|&gt;</code></li>",Lt,_t,Bt="Pairs of sequences are not the expected use case, but they will be handled without a separator.",vt,nt,Ye,jt,bt,Gt=`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`,Tt,lt,Mn="## CLIPImageProcessor[[transformers.CLIPImageProcessor]]",Xo,Nt,So,Fn,dn,Xn="Constructs a CLIP image processor.",Zn,Lo,Yo,Vn,cn,Sn="Preprocess an image or batch of images.",vn,Qo,Yn="## CLIPFeatureExtractor[[transformers.CLIPFeatureExtractor]]",Cn,Do,Ao,wn,Oo,Qn="## CLIPProcessor[[transformers.CLIPProcessor]]",In,Jt,Ko,Bn,pn,Dn="Constructs a CLIP processor which wraps a CLIP image processor and a CLIP tokenizer into a single processor.",Gn,mn,An=`<a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPProcessor">CLIPProcessor</a> offers all the functionalities of <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPProcessor.decode">decode()</a> for more information.`,Nn,jo,en,qn,un,On=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,En,Jo,tn,Hn,fn,Kn=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,xn,zo,$n,on,Pn,yn,kn;return m=new sn({props:{title:"CLIP",local:"clip",headingTag:"h1"}}),v=new sn({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Q=new sn({props:{title:"Usage tips and example",local:"usage-tips-and-example",headingTag:"h2"}}),ye=new je({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQ0xJUFByb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQ0xJUFByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwbG9naXRzX3Blcl9pbWFnZS5zb2Z0bWF4KGRpbSUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",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>`,wrap:!1}}),ee=new sn({props:{title:"Resources",local:"resources",headingTag:"h2"}}),fe=new ls({props:{pipeline:"image-to-text"}}),Fe=new sn({props:{title:"CLIPConfig",local:"transformers.CLIPConfig",headingTag:"h2"}}),he=new z({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/pr_31208/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/pr_31208/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/vr_31208/src/transformers/models/clip/configuration_clip.py#L261"}}),ge=new He({props:{anchor:"transformers.CLIPConfig.example",$$slots:{default:[cs]},$$scope:{ctx:x}}}),Ke=new z({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/vr_31208/src/transformers/models/clip/configuration_clip.py#L397",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><a
  href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPConfig"
>CLIPConfig</a></p>
`}}),Y=new sn({props:{title:"CLIPTextConfig",local:"transformers.CLIPTextConfig",headingTag:"h2"}}),Ge=new z({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:" = 49406"},{name:"eos_token_id",val:" = 49407"},{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/pr_31208/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.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.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-05) &#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.0) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.CLIPTextConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.CLIPTextConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 49406) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.CLIPTextConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 49407) &#x2014;
End of stream token id.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/configuration_clip.py#L34"}}),Re=new He({props:{anchor:"transformers.CLIPTextConfig.example",$$slots:{default:[ps]},$$scope:{ctx:x}}}),ke=new sn({props:{title:"CLIPVisionConfig",local:"transformers.CLIPVisionConfig",headingTag:"h2"}}),Ne=new z({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.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.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.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{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-05) &#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.0) &#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/vr_31208/src/transformers/models/clip/configuration_clip.py#L152"}}),Xe=new He({props:{anchor:"transformers.CLIPVisionConfig.example",$$slots:{default:[ms]},$$scope:{ctx:x}}}),It=new z({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>&quot;&lt;|endoftext|&gt;&quot;</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>&quot;&lt;|startoftext|&gt;&quot;</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>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.CLIPTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/tokenization_clip.py#L254"}}),to=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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/vr_31208/src/transformers/models/clip/tokenization_clip.py#L339",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),no=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.CLIPTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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/vr_31208/src/transformers/models/clip/tokenization_clip.py#L366",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),ho=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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/vr_31208/src/transformers/models/clip/tokenization_clip.py#L394",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of zeros.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),_o=new z({props:{name:"save_vocabulary",anchor:"transformers.CLIPTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/tokenization_clip.py#L489"}}),bo=new z({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>, <em>optional</em>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CLIPTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CLIPTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to a tokenizer file to use instead of the vocab file.`,name:"tokenizer_file"},{anchor:"transformers.CLIPTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</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>&quot;&lt;|startoftext|&gt;&quot;</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>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.CLIPTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/tokenization_clip_fast.py#L31"}}),ao=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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/vr_31208/src/transformers/models/clip/tokenization_clip_fast.py#L109",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),Ye=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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/vr_31208/src/transformers/models/clip/tokenization_clip_fast.py#L136",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of zeros.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),So=new z({props:{name:"class transformers.CLIPImageProcessor",anchor:"transformers.CLIPImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.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>Resampling.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.`,name:"rescale_factor"},{anchor:"transformers.CLIPImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{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;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.CLIPImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/image_processing_clip.py#L52"}}),Yo=new z({props:{name:"preprocess",anchor:"transformers.CLIPImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": bool = None"},{name:"size",val:": Dict = 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:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Optional = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.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>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.CLIPImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/image_processing_clip.py#L200"}}),Ao=new z({props:{name:"class transformers.CLIPFeatureExtractor",anchor:"transformers.CLIPFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/feature_extraction_clip.py#L26"}}),Ko=new z({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/pr_31208/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.CLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/pr_31208/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/processing_clip.py#L25"}}),en=new z({props:{name:"batch_decode",anchor:"transformers.CLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/processing_clip.py#L119"}}),tn=new z({props:{name:"decode",anchor:"transformers.CLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/clip/processing_clip.py#L126"}}),zo=new is({props:{pytorch:!0,tensorflow:!0,jax:!0,$$slots:{jax:[ta],tensorflow:[Es],pytorch:[Ls]},$$scope:{ctx:x}}}),on=new ds({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/clip.md"}}),{c(){e=d("meta"),u=i(),n=d("p"),o=i(),g(m.$$.fragment),t=i(),g(v.$$.fragment),Ct=i(),Te=d("p"),Te.innerHTML=H,wt=i(),Me=d("p"),Me.textContent=F,Je=i(),J=d("p"),J.innerHTML=B,zt=i(),ze=d("p"),ze.innerHTML=ie,Qe=i(),g(Q.$$.fragment),st=i(),q=d("p"),q.textContent=dt,R=i(),pe=d("p"),pe.innerHTML=ct,at=i(),K=d("p"),K.innerHTML=pt,me=i(),g(ye.$$.fragment),X=i(),g(ee.$$.fragment),D=i(),ue=d("p"),ue.textContent=mt,De=i(),le=d("ul"),le.innerHTML=Et,de=i(),g(fe.$$.fragment),A=i(),rt=d("ul"),rt.innerHTML=te,O=i(),ve=d("p"),ve.innerHTML=Ie,Ue=i(),ut=d("ul"),ut.innerHTML=oe,xe=i(),$e=d("p"),$e.innerHTML=ft,ne=i(),We=d("ul"),We.innerHTML=Ae,be=i(),ce=d("p"),ce.textContent=Pt,G=i(),g(Fe.$$.fragment),Ze=i(),Z=d("div"),g(he.$$.fragment),Ut=i(),N=d("p"),N.innerHTML=S,Ce=i(),Ve=d("p"),Ve.innerHTML=Oe,Ht=i(),g(ge.$$.fragment),we=i(),se=d("div"),g(Ke.$$.fragment),C=i(),k=d("p"),k.innerHTML=Be,V=i(),g(Y.$$.fragment),et=i(),U=d("div"),g(Ge.$$.fragment),ae=i(),Pe=d("p"),Pe.innerHTML=w,P=i(),_e=d("p"),_e.innerHTML=ht,Wt=i(),g(Re.$$.fragment),E=i(),g(ke.$$.fragment),tt=i(),re=d("div"),g(Ne.$$.fragment),co=i(),Rt=d("p"),Rt.innerHTML=gn,Fo=i(),Xt=d("p"),Xt.innerHTML=_n,Zo=i(),g(Xe.$$.fragment),Dt=i(),Kt=d("p"),Kt.textContent=vo,Vo=i(),Le=d("div"),g(It.$$.fragment),Bo=i(),kt=d("p"),kt.textContent=Go,eo=i(),Co=d("p"),Co.innerHTML=No,yt=i(),ot=d("div"),g(to.$$.fragment),po=i(),wo=d("p"),wo.textContent=an,mo=i(),Io=d("ul"),Io.innerHTML=rn,xt=i(),Ft=d("p"),Ft.textContent=ln,uo=i(),oo=d("div"),g(no.$$.fragment),At=i(),fo=d("p"),fo.innerHTML=so,xo=i(),$t=d("div"),g(ho.$$.fragment),$o=i(),qe=d("p"),qe.textContent=go,qo=i(),St=d("div"),g(_o.$$.fragment),Po=i(),Zt=d("p"),Zt.textContent=bn,ko=i(),Ee=d("div"),g(bo.$$.fragment),Eo=i(),it=d("p"),it.innerHTML=To,Ho=i(),Yt=d("p"),Yt.innerHTML=Tn,Ro=i(),Se=d("div"),g(ao.$$.fragment),Ot=i(),ro=d("p"),ro.textContent=h,$=i(),gt=d("ul"),gt.innerHTML=Vt,Lt=i(),_t=d("p"),_t.textContent=Bt,vt=i(),nt=d("div"),g(Ye.$$.fragment),jt=i(),bt=d("p"),bt.textContent=Gt,Tt=i(),lt=d("p"),lt.textContent=Mn,Xo=i(),Nt=d("div"),g(So.$$.fragment),Fn=i(),dn=d("p"),dn.textContent=Xn,Zn=i(),Lo=d("div"),g(Yo.$$.fragment),Vn=i(),cn=d("p"),cn.textContent=Sn,vn=i(),Qo=d("p"),Qo.textContent=Yn,Cn=i(),Do=d("div"),g(Ao.$$.fragment),wn=i(),Oo=d("p"),Oo.textContent=Qn,In=i(),Jt=d("div"),g(Ko.$$.fragment),Bn=i(),pn=d("p"),pn.textContent=Dn,Gn=i(),mn=d("p"),mn.innerHTML=An,Nn=i(),jo=d("div"),g(en.$$.fragment),qn=i(),un=d("p"),un.innerHTML=On,En=i(),Jo=d("div"),g(tn.$$.fragment),Hn=i(),fn=d("p"),fn.innerHTML=Kn,xn=i(),g(zo.$$.fragment),$n=i(),g(on.$$.fragment),Pn=i(),yn=d("p"),this.h()},l(s){const I=rs("svelte-u9bgzb",document.head);e=c(I,"META",{name:!0,content:!0}),I.forEach(a),u=l(s),n=c(s,"P",{}),L(n).forEach(a),o=l(s),_(m.$$.fragment,s),t=l(s),_(v.$$.fragment,s),Ct=l(s),Te=c(s,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-1dawxo2"&&(Te.innerHTML=H),wt=l(s),Me=c(s,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-vfdo9a"&&(Me.textContent=F),Je=l(s),J=c(s,"P",{"data-svelte-h":!0}),f(J)!=="svelte-92368o"&&(J.innerHTML=B),zt=l(s),ze=c(s,"P",{"data-svelte-h":!0}),f(ze)!=="svelte-1mhh8m9"&&(ze.innerHTML=ie),Qe=l(s),_(Q.$$.fragment,s),st=l(s),q=c(s,"P",{"data-svelte-h":!0}),f(q)!=="svelte-1isb9vh"&&(q.textContent=dt),R=l(s),pe=c(s,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-627qs4"&&(pe.innerHTML=ct),at=l(s),K=c(s,"P",{"data-svelte-h":!0}),f(K)!=="svelte-1viko9z"&&(K.innerHTML=pt),me=l(s),_(ye.$$.fragment,s),X=l(s),_(ee.$$.fragment,s),D=l(s),ue=c(s,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-dj9ohl"&&(ue.textContent=mt),De=l(s),le=c(s,"UL",{"data-svelte-h":!0}),f(le)!=="svelte-lh1ahn"&&(le.innerHTML=Et),de=l(s),_(fe.$$.fragment,s),A=l(s),rt=c(s,"UL",{"data-svelte-h":!0}),f(rt)!=="svelte-133vw9m"&&(rt.innerHTML=te),O=l(s),ve=c(s,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-cl8ob8"&&(ve.innerHTML=Ie),Ue=l(s),ut=c(s,"UL",{"data-svelte-h":!0}),f(ut)!=="svelte-ccx455"&&(ut.innerHTML=oe),xe=l(s),$e=c(s,"P",{"data-svelte-h":!0}),f($e)!=="svelte-1k7b44k"&&($e.innerHTML=ft),ne=l(s),We=c(s,"UL",{"data-svelte-h":!0}),f(We)!=="svelte-1v0wgrx"&&(We.innerHTML=Ae),be=l(s),ce=c(s,"P",{"data-svelte-h":!0}),f(ce)!=="svelte-1rggs50"&&(ce.textContent=Pt),G=l(s),_(Fe.$$.fragment,s),Ze=l(s),Z=c(s,"DIV",{class:!0});var Qt=L(Z);_(he.$$.fragment,Qt),Ut=l(Qt),N=c(Qt,"P",{"data-svelte-h":!0}),f(N)!=="svelte-130823b"&&(N.innerHTML=S),Ce=l(Qt),Ve=c(Qt,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-1jogkw7"&&(Ve.innerHTML=Oe),Ht=l(Qt),_(ge.$$.fragment,Qt),we=l(Qt),se=c(Qt,"DIV",{class:!0});var nn=L(se);_(Ke.$$.fragment,nn),C=l(nn),k=c(nn,"P",{"data-svelte-h":!0}),f(k)!=="svelte-xtkhh4"&&(k.innerHTML=Be),nn.forEach(a),Qt.forEach(a),V=l(s),_(Y.$$.fragment,s),et=l(s),U=c(s,"DIV",{class:!0});var io=L(U);_(Ge.$$.fragment,io),ae=l(io),Pe=c(io,"P",{"data-svelte-h":!0}),f(Pe)!=="svelte-1mwhndc"&&(Pe.innerHTML=w),P=l(io),_e=c(io,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-1jogkw7"&&(_e.innerHTML=ht),Wt=l(io),_(Re.$$.fragment,io),io.forEach(a),E=l(s),_(ke.$$.fragment,s),tt=l(s),re=c(s,"DIV",{class:!0});var lo=L(re);_(Ne.$$.fragment,lo),co=l(lo),Rt=c(lo,"P",{"data-svelte-h":!0}),f(Rt)!=="svelte-1k7auvu"&&(Rt.innerHTML=gn),Fo=l(lo),Xt=c(lo,"P",{"data-svelte-h":!0}),f(Xt)!=="svelte-ux0v9v"&&(Xt.innerHTML=_n),Zo=l(lo),_(Xe.$$.fragment,lo),lo.forEach(a),Dt=l(s),Kt=c(s,"P",{"data-svelte-h":!0}),f(Kt)!=="svelte-1xudtq4"&&(Kt.textContent=vo),Vo=l(s),Le=c(s,"DIV",{class:!0});var qt=L(Le);_(It.$$.fragment,qt),Bo=l(qt),kt=c(qt,"P",{"data-svelte-h":!0}),f(kt)!=="svelte-vz3r3l"&&(kt.textContent=Go),eo=l(qt),Co=c(qt,"P",{"data-svelte-h":!0}),f(Co)!=="svelte-1jrfhni"&&(Co.innerHTML=No),yt=l(qt),ot=c(qt,"DIV",{class:!0});var Uo=L(ot);_(to.$$.fragment,Uo),po=l(Uo),wo=c(Uo,"P",{"data-svelte-h":!0}),f(wo)!=="svelte-js0y4v"&&(wo.textContent=an),mo=l(Uo),Io=c(Uo,"UL",{"data-svelte-h":!0}),f(Io)!=="svelte-uzwo54"&&(Io.innerHTML=rn),xt=l(Uo),Ft=c(Uo,"P",{"data-svelte-h":!0}),f(Ft)!=="svelte-1bzh7dh"&&(Ft.textContent=ln),Uo.forEach(a),uo=l(qt),oo=c(qt,"DIV",{class:!0});var Ln=L(oo);_(no.$$.fragment,Ln),At=l(Ln),fo=c(Ln,"P",{"data-svelte-h":!0}),f(fo)!=="svelte-1f4f5kp"&&(fo.innerHTML=so),Ln.forEach(a),xo=l(qt),$t=c(qt,"DIV",{class:!0});var jn=L($t);_(ho.$$.fragment,jn),$o=l(jn),qe=c(jn,"P",{"data-svelte-h":!0}),f(qe)!=="svelte-1ctpnmt"&&(qe.textContent=go),jn.forEach(a),qo=l(qt),St=c(qt,"DIV",{class:!0});var es=L(St);_(_o.$$.fragment,es),es.forEach(a),qt.forEach(a),Po=l(s),Zt=c(s,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-y53fuo"&&(Zt.textContent=bn),ko=l(s),Ee=c(s,"DIV",{class:!0});var Mo=L(Ee);_(bo.$$.fragment,Mo),Eo=l(Mo),it=c(Mo,"P",{"data-svelte-h":!0}),f(it)!=="svelte-g8hwlw"&&(it.innerHTML=To),Ho=l(Mo),Yt=c(Mo,"P",{"data-svelte-h":!0}),f(Yt)!=="svelte-19w2g9e"&&(Yt.innerHTML=Tn),Ro=l(Mo),Se=c(Mo,"DIV",{class:!0});var Wo=L(Se);_(ao.$$.fragment,Wo),Ot=l(Wo),ro=c(Wo,"P",{"data-svelte-h":!0}),f(ro)!=="svelte-js0y4v"&&(ro.textContent=h),$=l(Wo),gt=c(Wo,"UL",{"data-svelte-h":!0}),f(gt)!=="svelte-uzwo54"&&(gt.innerHTML=Vt),Lt=l(Wo),_t=c(Wo,"P",{"data-svelte-h":!0}),f(_t)!=="svelte-1bzh7dh"&&(_t.textContent=Bt),Wo.forEach(a),vt=l(Mo),nt=c(Mo,"DIV",{class:!0});var Jn=L(nt);_(Ye.$$.fragment,Jn),jt=l(Jn),bt=c(Jn,"P",{"data-svelte-h":!0}),f(bt)!=="svelte-1ctpnmt"&&(bt.textContent=Gt),Jn.forEach(a),Mo.forEach(a),Tt=l(s),lt=c(s,"P",{"data-svelte-h":!0}),f(lt)!=="svelte-q5ywxu"&&(lt.textContent=Mn),Xo=l(s),Nt=c(s,"DIV",{class:!0});var hn=L(Nt);_(So.$$.fragment,hn),Fn=l(hn),dn=c(hn,"P",{"data-svelte-h":!0}),f(dn)!=="svelte-x48p92"&&(dn.textContent=Xn),Zn=l(hn),Lo=c(hn,"DIV",{class:!0});var zn=L(Lo);_(Yo.$$.fragment,zn),Vn=l(zn),cn=c(zn,"P",{"data-svelte-h":!0}),f(cn)!=="svelte-1x3yxsa"&&(cn.textContent=Sn),zn.forEach(a),hn.forEach(a),vn=l(s),Qo=c(s,"P",{"data-svelte-h":!0}),f(Qo)!=="svelte-130235s"&&(Qo.textContent=Yn),Cn=l(s),Do=c(s,"DIV",{class:!0});var ts=L(Do);_(Ao.$$.fragment,ts),ts.forEach(a),wn=l(s),Oo=c(s,"P",{"data-svelte-h":!0}),f(Oo)!=="svelte-1d4g6hc"&&(Oo.textContent=Qn),In=l(s),Jt=c(s,"DIV",{class:!0});var yo=L(Jt);_(Ko.$$.fragment,yo),Bn=l(yo),pn=c(yo,"P",{"data-svelte-h":!0}),f(pn)!=="svelte-ofpncz"&&(pn.textContent=Dn),Gn=l(yo),mn=c(yo,"P",{"data-svelte-h":!0}),f(mn)!=="svelte-s4rhse"&&(mn.innerHTML=An),Nn=l(yo),jo=c(yo,"DIV",{class:!0});var Un=L(jo);_(en.$$.fragment,Un),qn=l(Un),un=c(Un,"P",{"data-svelte-h":!0}),f(un)!=="svelte-1m293r1"&&(un.innerHTML=On),Un.forEach(a),En=l(yo),Jo=c(yo,"DIV",{class:!0});var Wn=L(Jo);_(tn.$$.fragment,Wn),Hn=l(Wn),fn=c(Wn,"P",{"data-svelte-h":!0}),f(fn)!=="svelte-ee4683"&&(fn.innerHTML=Kn),Wn.forEach(a),yo.forEach(a),xn=l(s),_(zo.$$.fragment,s),$n=l(s),_(on.$$.fragment,s),Pn=l(s),yn=c(s,"P",{}),L(yn).forEach(a),this.h()},h(){j(e,"name","hf:doc:metadata"),j(e,"content",na),j(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Do,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,I){r(document.head,e),p(s,u,I),p(s,n,I),p(s,o,I),b(m,s,I),p(s,t,I),b(v,s,I),p(s,Ct,I),p(s,Te,I),p(s,wt,I),p(s,Me,I),p(s,Je,I),p(s,J,I),p(s,zt,I),p(s,ze,I),p(s,Qe,I),b(Q,s,I),p(s,st,I),p(s,q,I),p(s,R,I),p(s,pe,I),p(s,at,I),p(s,K,I),p(s,me,I),b(ye,s,I),p(s,X,I),b(ee,s,I),p(s,D,I),p(s,ue,I),p(s,De,I),p(s,le,I),p(s,de,I),b(fe,s,I),p(s,A,I),p(s,rt,I),p(s,O,I),p(s,ve,I),p(s,Ue,I),p(s,ut,I),p(s,xe,I),p(s,$e,I),p(s,ne,I),p(s,We,I),p(s,be,I),p(s,ce,I),p(s,G,I),b(Fe,s,I),p(s,Ze,I),p(s,Z,I),b(he,Z,null),r(Z,Ut),r(Z,N),r(Z,Ce),r(Z,Ve),r(Z,Ht),b(ge,Z,null),r(Z,we),r(Z,se),b(Ke,se,null),r(se,C),r(se,k),p(s,V,I),b(Y,s,I),p(s,et,I),p(s,U,I),b(Ge,U,null),r(U,ae),r(U,Pe),r(U,P),r(U,_e),r(U,Wt),b(Re,U,null),p(s,E,I),b(ke,s,I),p(s,tt,I),p(s,re,I),b(Ne,re,null),r(re,co),r(re,Rt),r(re,Fo),r(re,Xt),r(re,Zo),b(Xe,re,null),p(s,Dt,I),p(s,Kt,I),p(s,Vo,I),p(s,Le,I),b(It,Le,null),r(Le,Bo),r(Le,kt),r(Le,eo),r(Le,Co),r(Le,yt),r(Le,ot),b(to,ot,null),r(ot,po),r(ot,wo),r(ot,mo),r(ot,Io),r(ot,xt),r(ot,Ft),r(Le,uo),r(Le,oo),b(no,oo,null),r(oo,At),r(oo,fo),r(Le,xo),r(Le,$t),b(ho,$t,null),r($t,$o),r($t,qe),r(Le,qo),r(Le,St),b(_o,St,null),p(s,Po,I),p(s,Zt,I),p(s,ko,I),p(s,Ee,I),b(bo,Ee,null),r(Ee,Eo),r(Ee,it),r(Ee,Ho),r(Ee,Yt),r(Ee,Ro),r(Ee,Se),b(ao,Se,null),r(Se,Ot),r(Se,ro),r(Se,$),r(Se,gt),r(Se,Lt),r(Se,_t),r(Ee,vt),r(Ee,nt),b(Ye,nt,null),r(nt,jt),r(nt,bt),p(s,Tt,I),p(s,lt,I),p(s,Xo,I),p(s,Nt,I),b(So,Nt,null),r(Nt,Fn),r(Nt,dn),r(Nt,Zn),r(Nt,Lo),b(Yo,Lo,null),r(Lo,Vn),r(Lo,cn),p(s,vn,I),p(s,Qo,I),p(s,Cn,I),p(s,Do,I),b(Ao,Do,null),p(s,wn,I),p(s,Oo,I),p(s,In,I),p(s,Jt,I),b(Ko,Jt,null),r(Jt,Bn),r(Jt,pn),r(Jt,Gn),r(Jt,mn),r(Jt,Nn),r(Jt,jo),b(en,jo,null),r(jo,qn),r(jo,un),r(Jt,En),r(Jt,Jo),b(tn,Jo,null),r(Jo,Hn),r(Jo,fn),p(s,xn,I),b(zo,s,I),p(s,$n,I),b(on,s,I),p(s,Pn,I),p(s,yn,I),kn=!0},p(s,[I]){const Qt={};I&2&&(Qt.$$scope={dirty:I,ctx:s}),ge.$set(Qt);const nn={};I&2&&(nn.$$scope={dirty:I,ctx:s}),Re.$set(nn);const io={};I&2&&(io.$$scope={dirty:I,ctx:s}),Xe.$set(io);const lo={};I&2&&(lo.$$scope={dirty:I,ctx:s}),zo.$set(lo)},i(s){kn||(T(m.$$.fragment,s),T(v.$$.fragment,s),T(Q.$$.fragment,s),T(ye.$$.fragment,s),T(ee.$$.fragment,s),T(fe.$$.fragment,s),T(Fe.$$.fragment,s),T(he.$$.fragment,s),T(ge.$$.fragment,s),T(Ke.$$.fragment,s),T(Y.$$.fragment,s),T(Ge.$$.fragment,s),T(Re.$$.fragment,s),T(ke.$$.fragment,s),T(Ne.$$.fragment,s),T(Xe.$$.fragment,s),T(It.$$.fragment,s),T(to.$$.fragment,s),T(no.$$.fragment,s),T(ho.$$.fragment,s),T(_o.$$.fragment,s),T(bo.$$.fragment,s),T(ao.$$.fragment,s),T(Ye.$$.fragment,s),T(So.$$.fragment,s),T(Yo.$$.fragment,s),T(Ao.$$.fragment,s),T(Ko.$$.fragment,s),T(en.$$.fragment,s),T(tn.$$.fragment,s),T(zo.$$.fragment,s),T(on.$$.fragment,s),kn=!0)},o(s){M(m.$$.fragment,s),M(v.$$.fragment,s),M(Q.$$.fragment,s),M(ye.$$.fragment,s),M(ee.$$.fragment,s),M(fe.$$.fragment,s),M(Fe.$$.fragment,s),M(he.$$.fragment,s),M(ge.$$.fragment,s),M(Ke.$$.fragment,s),M(Y.$$.fragment,s),M(Ge.$$.fragment,s),M(Re.$$.fragment,s),M(ke.$$.fragment,s),M(Ne.$$.fragment,s),M(Xe.$$.fragment,s),M(It.$$.fragment,s),M(to.$$.fragment,s),M(no.$$.fragment,s),M(ho.$$.fragment,s),M(_o.$$.fragment,s),M(bo.$$.fragment,s),M(ao.$$.fragment,s),M(Ye.$$.fragment,s),M(So.$$.fragment,s),M(Yo.$$.fragment,s),M(Ao.$$.fragment,s),M(Ko.$$.fragment,s),M(en.$$.fragment,s),M(tn.$$.fragment,s),M(zo.$$.fragment,s),M(on.$$.fragment,s),kn=!1},d(s){s&&(a(u),a(n),a(o),a(t),a(Ct),a(Te),a(wt),a(Me),a(Je),a(J),a(zt),a(ze),a(Qe),a(st),a(q),a(R),a(pe),a(at),a(K),a(me),a(X),a(D),a(ue),a(De),a(le),a(de),a(A),a(rt),a(O),a(ve),a(Ue),a(ut),a(xe),a($e),a(ne),a(We),a(be),a(ce),a(G),a(Ze),a(Z),a(V),a(et),a(U),a(E),a(tt),a(re),a(Dt),a(Kt),a(Vo),a(Le),a(Po),a(Zt),a(ko),a(Ee),a(Tt),a(lt),a(Xo),a(Nt),a(vn),a(Qo),a(Cn),a(Do),a(wn),a(Oo),a(In),a(Jt),a(xn),a($n),a(Pn),a(yn)),a(e),y(m,s),y(v,s),y(Q,s),y(ye,s),y(ee,s),y(fe,s),y(Fe,s),y(he),y(ge),y(Ke),y(Y,s),y(Ge),y(Re),y(ke,s),y(Ne),y(Xe),y(It),y(to),y(no),y(ho),y(_o),y(bo),y(ao),y(Ye),y(So),y(Yo),y(Ao),y(Ko),y(en),y(tn),y(zo,s),y(on,s)}}}const na='{"title":"CLIP","local":"clip","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips and example","local":"usage-tips-and-example","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"CLIPConfig","local":"transformers.CLIPConfig","sections":[],"depth":2},{"title":"CLIPTextConfig","local":"transformers.CLIPTextConfig","sections":[],"depth":2},{"title":"CLIPVisionConfig","local":"transformers.CLIPVisionConfig","sections":[],"depth":2}],"depth":1}';function sa(x){return ns(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fa extends ss{constructor(e){super(),as(this,e,sa,oa,os,{})}}export{fa as component};
