import{s as it,o as lt,n as D}from"../chunks/scheduler.01eeda35.js";import{S as dt,i as pt,g,s as a,r as h,A as ct,h as f,f as r,c as i,j as K,u as _,x,k as A,y as m,a as p,v as T,d as y,t as b,w as M}from"../chunks/index.6dd51b66.js";import{T as Ke}from"../chunks/Tip.de9bae2b.js";import{D as de}from"../chunks/Docstring.76e6b3cf.js";import{C as Xe}from"../chunks/CodeBlock.864da1b0.js";import{F as mt,M as at}from"../chunks/Markdown.3138439e.js";import{E as Pe}from"../chunks/ExampleCodeBlock.6a36fb6b.js";import{H as Ze,E as ut}from"../chunks/EditOnGithub.7faefd25.js";function gt(V){let e,c="Example:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdyb3VwVmlUVGV4dENvbmZpZyUyQyUyMEdyb3VwVmlUVGV4dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdyb3VwVmlUVGV4dE1vZGVsJTIwd2l0aCUyMG52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEdyb3VwVmlUVGV4dENvbmZpZygpJTBBJTBBbW9kZWwlMjAlM0QlMjBHcm91cFZpVFRleHRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GroupViTTextConfig, GroupViTTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GroupViTTextModel with nvidia/groupvit-gcc-yfcc style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GroupViTTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTTextModel(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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-11lpom8"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function ft(V){let e,c="Example:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdyb3VwVmlUVmlzaW9uQ29uZmlnJTJDJTIwR3JvdXBWaVRWaXNpb25Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBHcm91cFZpVFZpc2lvbk1vZGVsJTIwd2l0aCUyMG52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEdyb3VwVmlUVmlzaW9uQ29uZmlnKCklMEElMEFtb2RlbCUyMCUzRCUyMEdyb3VwVmlUVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GroupViTVisionConfig, GroupViTVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GroupViTVisionModel with nvidia/groupvit-gcc-yfcc style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GroupViTVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTVisionModel(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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-11lpom8"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function ht(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function _t(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEdyb3VwVmlUTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEdyb3VwVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwbG9naXRzX3Blcl9pbWFnZS5zb2Z0bWF4KGRpbSUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",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, GroupViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function Tt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function yt(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUb2tlbml6ZXIlMkMlMjBHcm91cFZpVE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBHcm91cFZpVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBDTElQVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfdGV4dF9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, GroupViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = CLIPTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function bt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Mt(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEdyb3VwVmlUTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEdyb3VwVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",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, GroupViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function vt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function $t(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUb2tlbml6ZXIlMkMlMjBHcm91cFZpVFRleHRNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMENMSVBUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQW1vZGVsJTIwJTNEJTIwR3JvdXBWaVRUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlZF9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjAoRU9TJTIwdG9rZW4pJTIwc3RhdGVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, GroupViTTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = CLIPTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTTextModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function wt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Vt(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEdyb3VwVmlUVmlzaW9uTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEFtb2RlbCUyMCUzRCUyMEdyb3VwVmlUVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",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, GroupViTVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GroupViTVisionModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function xt(V){let e,c,o,n,u,t,v=`This model is 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.`,Fe,k,I,Ge,J,$e='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTModel">GroupViTModel</a> forward method, overrides the <code>__call__</code> special method.',B,j,re,ae,We,pe,ee,je,_e,Se='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTModel">GroupViTModel</a> forward method, overrides the <code>__call__</code> special method.',R,te,ke,Te,Ye,H,oe,Je,ye,Qe='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTModel">GroupViTModel</a> forward method, overrides the <code>__call__</code> special method.',E,ce,Be,P,Re,F,ne,we,X,Ae,q,me,xe,be,Ue='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTTextModel">GroupViTTextModel</a> forward method, overrides the <code>__call__</code> special method.',N,ie,Ie,Me,He,ue,ve,U,L,Ee,C,Ce,Ve,se,et='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTVisionModel">GroupViTVisionModel</a> forward method, overrides the <code>__call__</code> special method.',le,Z,qe,S,Ne;return e=new Ze({props:{title:"GroupViTModel",local:"transformers.GroupViTModel",headingTag:"h2"}}),n=new de({props:{name:"class transformers.GroupViTModel",anchor:"transformers.GroupViTModel",parameters:[{name:"config",val:": GroupViTConfig"}],parametersDescription:[{anchor:"transformers.GroupViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTConfig">GroupViTConfig</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/main/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/main/src/transformers/models/groupvit/modeling_groupvit.py#L1309"}}),I=new de({props:{name:"forward",anchor:"transformers.GroupViTModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_segmentation",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GroupViTModel.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/main/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1452",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.groupvit.modeling_groupvit.GroupViTModelOutput</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.groupvit.configuration_groupvit.GroupViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</p>
</li>
<li>
<p><strong>logits_per_image</strong> (<code>torch.FloatTensor</code> 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.</p>
</li>
<li>
<p><strong>logits_per_text</strong> (<code>torch.FloatTensor</code> 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.</p>
</li>
<li>
<p><strong>segmentation_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) — Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>text_embeds</strong> (<code>torch.FloatTensor</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/main/en/model_doc/groupvit#transformers.GroupViTTextModel"
>GroupViTTextModel</a>.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>torch.FloatTensor</code> 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/main/en/model_doc/groupvit#transformers.GroupViTVisionModel"
>GroupViTVisionModel</a>.</p>
</li>
<li>
<p><strong>text_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTTextModel"
>GroupViTTextModel</a>.</p>
</li>
<li>
<p><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTVisionModel"
>GroupViTVisionModel</a>.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.groupvit.modeling_groupvit.GroupViTModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),j=new Ke({props:{$$slots:{default:[ht]},$$scope:{ctx:V}}}),ae=new Pe({props:{anchor:"transformers.GroupViTModel.forward.example",$$slots:{default:[_t]},$$scope:{ctx:V}}}),ee=new de({props:{name:"get_text_features",anchor:"transformers.GroupViTModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GroupViTModel.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/main/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1356",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/main/en/model_doc/groupvit#transformers.GroupViTTextModel"
>GroupViTTextModel</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>
`}}),te=new Ke({props:{$$slots:{default:[Tt]},$$scope:{ctx:V}}}),Te=new Pe({props:{anchor:"transformers.GroupViTModel.get_text_features.example",$$slots:{default:[yt]},$$scope:{ctx:V}}}),oe=new de({props:{name:"get_image_features",anchor:"transformers.GroupViTModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GroupViTModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GroupViTModel.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.GroupViTModel.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.GroupViTModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1403",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/main/en/model_doc/groupvit#transformers.GroupViTVisionModel"
>GroupViTVisionModel</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>
`}}),ce=new Ke({props:{$$slots:{default:[bt]},$$scope:{ctx:V}}}),P=new Pe({props:{anchor:"transformers.GroupViTModel.get_image_features.example",$$slots:{default:[Mt]},$$scope:{ctx:V}}}),F=new Ze({props:{title:"GroupViTTextModel",local:"transformers.GroupViTTextModel",headingTag:"h2"}}),X=new de({props:{name:"class transformers.GroupViTTextModel",anchor:"transformers.GroupViTTextModel",parameters:[{name:"config",val:": GroupViTTextConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1146"}}),me=new de({props:{name:"forward",anchor:"transformers.GroupViTTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GroupViTTextModel.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/main/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.GroupViTTextModel.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.GroupViTTextModel.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.GroupViTTextModel.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.GroupViTTextModel.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.GroupViTTextModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1161",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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.groupvit.configuration_groupvit.GroupViTTextConfig'&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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ie=new Ke({props:{$$slots:{default:[vt]},$$scope:{ctx:V}}}),Me=new Pe({props:{anchor:"transformers.GroupViTTextModel.forward.example",$$slots:{default:[$t]},$$scope:{ctx:V}}}),ue=new Ze({props:{title:"GroupViTVisionModel",local:"transformers.GroupViTVisionModel",headingTag:"h2"}}),L=new de({props:{name:"class transformers.GroupViTVisionModel",anchor:"transformers.GroupViTVisionModel",parameters:[{name:"config",val:": GroupViTVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1257"}}),Ce=new de({props:{name:"forward",anchor:"transformers.GroupViTVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GroupViTVisionModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GroupViTVisionModel.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.GroupViTVisionModel.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.GroupViTVisionModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_groupvit.py#L1270",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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.groupvit.configuration_groupvit.GroupViTVisionConfig'&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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Z=new Ke({props:{$$slots:{default:[wt]},$$scope:{ctx:V}}}),S=new Pe({props:{anchor:"transformers.GroupViTVisionModel.forward.example",$$slots:{default:[Vt]},$$scope:{ctx:V}}}),{c(){h(e.$$.fragment),c=a(),o=g("div"),h(n.$$.fragment),u=a(),t=g("p"),t.innerHTML=v,Fe=a(),k=g("div"),h(I.$$.fragment),Ge=a(),J=g("p"),J.innerHTML=$e,B=a(),h(j.$$.fragment),re=a(),h(ae.$$.fragment),We=a(),pe=g("div"),h(ee.$$.fragment),je=a(),_e=g("p"),_e.innerHTML=Se,R=a(),h(te.$$.fragment),ke=a(),h(Te.$$.fragment),Ye=a(),H=g("div"),h(oe.$$.fragment),Je=a(),ye=g("p"),ye.innerHTML=Qe,E=a(),h(ce.$$.fragment),Be=a(),h(P.$$.fragment),Re=a(),h(F.$$.fragment),ne=a(),we=g("div"),h(X.$$.fragment),Ae=a(),q=g("div"),h(me.$$.fragment),xe=a(),be=g("p"),be.innerHTML=Ue,N=a(),h(ie.$$.fragment),Ie=a(),h(Me.$$.fragment),He=a(),h(ue.$$.fragment),ve=a(),U=g("div"),h(L.$$.fragment),Ee=a(),C=g("div"),h(Ce.$$.fragment),Ve=a(),se=g("p"),se.innerHTML=et,le=a(),h(Z.$$.fragment),qe=a(),h(S.$$.fragment),this.h()},l(l){_(e.$$.fragment,l),c=i(l),o=f(l,"DIV",{class:!0});var w=K(o);_(n.$$.fragment,w),u=i(w),t=f(w,"P",{"data-svelte-h":!0}),x(t)!=="svelte-1gjh92c"&&(t.innerHTML=v),Fe=i(w),k=f(w,"DIV",{class:!0});var ge=K(k);_(I.$$.fragment,ge),Ge=i(ge),J=f(ge,"P",{"data-svelte-h":!0}),x(J)!=="svelte-fvh1ot"&&(J.innerHTML=$e),B=i(ge),_(j.$$.fragment,ge),re=i(ge),_(ae.$$.fragment,ge),ge.forEach(r),We=i(w),pe=f(w,"DIV",{class:!0});var z=K(pe);_(ee.$$.fragment,z),je=i(z),_e=f(z,"P",{"data-svelte-h":!0}),x(_e)!=="svelte-fvh1ot"&&(_e.innerHTML=Se),R=i(z),_(te.$$.fragment,z),ke=i(z),_(Te.$$.fragment,z),z.forEach(r),Ye=i(w),H=f(w,"DIV",{class:!0});var fe=K(H);_(oe.$$.fragment,fe),Je=i(fe),ye=f(fe,"P",{"data-svelte-h":!0}),x(ye)!=="svelte-fvh1ot"&&(ye.innerHTML=Qe),E=i(fe),_(ce.$$.fragment,fe),Be=i(fe),_(P.$$.fragment,fe),fe.forEach(r),w.forEach(r),Re=i(l),_(F.$$.fragment,l),ne=i(l),we=f(l,"DIV",{class:!0});var d=K(we);_(X.$$.fragment,d),Ae=i(d),q=f(d,"DIV",{class:!0});var $=K(q);_(me.$$.fragment,$),xe=i($),be=f($,"P",{"data-svelte-h":!0}),x(be)!=="svelte-1w1bf1l"&&(be.innerHTML=Ue),N=i($),_(ie.$$.fragment,$),Ie=i($),_(Me.$$.fragment,$),$.forEach(r),d.forEach(r),He=i(l),_(ue.$$.fragment,l),ve=i(l),U=f(l,"DIV",{class:!0});var O=K(U);_(L.$$.fragment,O),Ee=i(O),C=f(O,"DIV",{class:!0});var W=K(C);_(Ce.$$.fragment,W),Ve=i(W),se=f(W,"P",{"data-svelte-h":!0}),x(se)!=="svelte-10uy4fd"&&(se.innerHTML=et),le=i(W),_(Z.$$.fragment,W),qe=i(W),_(S.$$.fragment,W),W.forEach(r),O.forEach(r),this.h()},h(){A(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(l,w){T(e,l,w),p(l,c,w),p(l,o,w),T(n,o,null),m(o,u),m(o,t),m(o,Fe),m(o,k),T(I,k,null),m(k,Ge),m(k,J),m(k,B),T(j,k,null),m(k,re),T(ae,k,null),m(o,We),m(o,pe),T(ee,pe,null),m(pe,je),m(pe,_e),m(pe,R),T(te,pe,null),m(pe,ke),T(Te,pe,null),m(o,Ye),m(o,H),T(oe,H,null),m(H,Je),m(H,ye),m(H,E),T(ce,H,null),m(H,Be),T(P,H,null),p(l,Re,w),T(F,l,w),p(l,ne,w),p(l,we,w),T(X,we,null),m(we,Ae),m(we,q),T(me,q,null),m(q,xe),m(q,be),m(q,N),T(ie,q,null),m(q,Ie),T(Me,q,null),p(l,He,w),T(ue,l,w),p(l,ve,w),p(l,U,w),T(L,U,null),m(U,Ee),m(U,C),T(Ce,C,null),m(C,Ve),m(C,se),m(C,le),T(Z,C,null),m(C,qe),T(S,C,null),Ne=!0},p(l,w){const ge={};w&2&&(ge.$$scope={dirty:w,ctx:l}),j.$set(ge);const z={};w&2&&(z.$$scope={dirty:w,ctx:l}),ae.$set(z);const fe={};w&2&&(fe.$$scope={dirty:w,ctx:l}),te.$set(fe);const d={};w&2&&(d.$$scope={dirty:w,ctx:l}),Te.$set(d);const $={};w&2&&($.$$scope={dirty:w,ctx:l}),ce.$set($);const O={};w&2&&(O.$$scope={dirty:w,ctx:l}),P.$set(O);const W={};w&2&&(W.$$scope={dirty:w,ctx:l}),ie.$set(W);const Y={};w&2&&(Y.$$scope={dirty:w,ctx:l}),Me.$set(Y);const ze={};w&2&&(ze.$$scope={dirty:w,ctx:l}),Z.$set(ze);const Q={};w&2&&(Q.$$scope={dirty:w,ctx:l}),S.$set(Q)},i(l){Ne||(y(e.$$.fragment,l),y(n.$$.fragment,l),y(I.$$.fragment,l),y(j.$$.fragment,l),y(ae.$$.fragment,l),y(ee.$$.fragment,l),y(te.$$.fragment,l),y(Te.$$.fragment,l),y(oe.$$.fragment,l),y(ce.$$.fragment,l),y(P.$$.fragment,l),y(F.$$.fragment,l),y(X.$$.fragment,l),y(me.$$.fragment,l),y(ie.$$.fragment,l),y(Me.$$.fragment,l),y(ue.$$.fragment,l),y(L.$$.fragment,l),y(Ce.$$.fragment,l),y(Z.$$.fragment,l),y(S.$$.fragment,l),Ne=!0)},o(l){b(e.$$.fragment,l),b(n.$$.fragment,l),b(I.$$.fragment,l),b(j.$$.fragment,l),b(ae.$$.fragment,l),b(ee.$$.fragment,l),b(te.$$.fragment,l),b(Te.$$.fragment,l),b(oe.$$.fragment,l),b(ce.$$.fragment,l),b(P.$$.fragment,l),b(F.$$.fragment,l),b(X.$$.fragment,l),b(me.$$.fragment,l),b(ie.$$.fragment,l),b(Me.$$.fragment,l),b(ue.$$.fragment,l),b(L.$$.fragment,l),b(Ce.$$.fragment,l),b(Z.$$.fragment,l),b(S.$$.fragment,l),Ne=!1},d(l){l&&(r(c),r(o),r(Re),r(ne),r(we),r(He),r(ve),r(U)),M(e,l),M(n),M(I),M(j),M(ae),M(ee),M(te),M(Te),M(oe),M(ce),M(P),M(F,l),M(X),M(me),M(ie),M(Me),M(ue,l),M(L),M(Ce),M(Z),M(S)}}}function Gt(V){let e,c;return e=new at({props:{$$slots:{default:[xt]},$$scope:{ctx:V}}}),{c(){h(e.$$.fragment)},l(o){_(e.$$.fragment,o)},m(o,n){T(e,o,n),c=!0},p(o,n){const u={};n&2&&(u.$$scope={dirty:n,ctx:o}),e.$set(u)},i(o){c||(y(e.$$.fragment,o),c=!0)},o(o){b(e.$$.fragment,o),c=!1},d(o){M(e,o)}}}function jt(V){let e,c="TF 2.0 models accepts two formats as inputs:",o,n,u="<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 arguments.</li>",t,v,Fe=`This second option is useful when using <code>keras.Model.fit</code> method which currently requires having all the
tensors in the first argument of the model call function: <code>model(inputs)</code>.`,k,I,Ge=`If you choose this second option, there are three possibilities you can use to gather all the input Tensors in the
first positional argument :`,J,$e,B=`<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>`;return{c(){e=g("p"),e.textContent=c,o=a(),n=g("ul"),n.innerHTML=u,t=a(),v=g("p"),v.innerHTML=Fe,k=a(),I=g("p"),I.textContent=Ge,J=a(),$e=g("ul"),$e.innerHTML=B},l(j){e=f(j,"P",{"data-svelte-h":!0}),x(e)!=="svelte-ha0dwg"&&(e.textContent=c),o=i(j),n=f(j,"UL",{"data-svelte-h":!0}),x(n)!=="svelte-1ar3osv"&&(n.innerHTML=u),t=i(j),v=f(j,"P",{"data-svelte-h":!0}),x(v)!=="svelte-14kkttf"&&(v.innerHTML=Fe),k=i(j),I=f(j,"P",{"data-svelte-h":!0}),x(I)!=="svelte-11o7mts"&&(I.textContent=Ge),J=i(j),$e=f(j,"UL",{"data-svelte-h":!0}),x($e)!=="svelte-15scerc"&&($e.innerHTML=B)},m(j,re){p(j,e,re),p(j,o,re),p(j,n,re),p(j,t,re),p(j,v,re),p(j,k,re),p(j,I,re),p(j,J,re),p(j,$e,re)},p:D,d(j){j&&(r(e),r(o),r(n),r(t),r(v),r(k),r(I),r(J),r($e))}}}function kt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Jt(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGR3JvdXBWaVRNb2RlbCUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBJTBBbW9kZWwlMjAlM0QlMjBURkdyb3VwVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwdGYubWF0aC5zb2Z0bWF4KGxvZ2l0c19wZXJfaW1hZ2UlMkMlMjBheGlzJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",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, TFGroupViTModel
<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>model = TFGroupViTModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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.math.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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function Ut(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Ct(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUb2tlbml6ZXIlMkMlMjBURkdyb3VwVmlUTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFRGR3JvdXBWaVRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGZ3JvdXB2aXQtZ2NjLXlmY2MlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQ0xJUFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGZ3JvdXB2aXQtZ2NjLXlmY2MlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEF0ZXh0X2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X3RleHRfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, TFGroupViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFGroupViTModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = CLIPTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function zt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Wt(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGR3JvdXBWaVRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVEZHcm91cFZpVE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyk=",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, TFGroupViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFGroupViTModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function It(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Ft(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUb2tlbml6ZXIlMkMlMjBURkdyb3VwVmlUVGV4dE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQ0xJUFRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybnZpZGlhJTJGZ3JvdXB2aXQtZ2NjLXlmY2MlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkdyb3VwVmlUVGV4dE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwKEVPUyUyMHRva2VuKSUyMHN0YXRlcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, TFGroupViTTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = CLIPTokenizer.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFGroupViTTextModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function Zt(V){let e,c=`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=g("p"),e.innerHTML=c},l(o){e=f(o,"P",{"data-svelte-h":!0}),x(e)!=="svelte-fincs2"&&(e.innerHTML=c)},m(o,n){p(o,e,n)},p:D,d(o){o&&r(e)}}}function Bt(V){let e,c="Examples:",o,n,u;return n=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGR3JvdXBWaVRWaXNpb25Nb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRmdyb3Vwdml0LWdjYy15ZmNjJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZHcm91cFZpVFZpc2lvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJudmlkaWElMkZncm91cHZpdC1nY2MteWZjYyUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMENMUyUyMHN0YXRlcw==",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, TFGroupViTVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFGroupViTVisionModel.from_pretrained(<span class="hljs-string">&quot;nvidia/groupvit-gcc-yfcc&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=g("p"),e.textContent=c,o=a(),h(n.$$.fragment)},l(t){e=f(t,"P",{"data-svelte-h":!0}),x(e)!=="svelte-kvfsh7"&&(e.textContent=c),o=i(t),_(n.$$.fragment,t)},m(t,v){p(t,e,v),p(t,o,v),T(n,t,v),u=!0},p:D,i(t){u||(y(n.$$.fragment,t),u=!0)},o(t){b(n.$$.fragment,t),u=!1},d(t){t&&(r(e),r(o)),M(n,t)}}}function Rt(V){let e,c,o,n,u,t,v=`This model inherits from <a href="/docs/transformers/main/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.)`,Fe,k,I=`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.`,Ge,J,$e,B,j,re,ae,We='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTModel">TFGroupViTModel</a> forward method, overrides the <code>__call__</code> special method.',pe,ee,je,_e,Se,R,te,ke,Te,Ye='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTModel">TFGroupViTModel</a> forward method, overrides the <code>__call__</code> special method.',H,oe,Je,ye,Qe,E,ce,Be,P,Re='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTModel">TFGroupViTModel</a> forward method, overrides the <code>__call__</code> special method.',F,ne,we,X,Ae,q,me,xe,be,Ue,N,ie,Ie,Me,He='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTTextModel">TFGroupViTTextModel</a> forward method, overrides the <code>__call__</code> special method.',ue,ve,U,L,Ee,C,Ce,Ve,se,et,le,Z,qe,S,Ne='The <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTVisionModel">TFGroupViTVisionModel</a> forward method, overrides the <code>__call__</code> special method.',l,w,ge,z,fe;return e=new Ze({props:{title:"TFGroupViTModel",local:"transformers.TFGroupViTModel",headingTag:"h2"}}),n=new de({props:{name:"class transformers.TFGroupViTModel",anchor:"transformers.TFGroupViTModel",parameters:[{name:"config",val:": GroupViTConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFGroupViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTConfig">GroupViTConfig</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/main/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/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L1976"}}),J=new Ke({props:{$$slots:{default:[jt]},$$scope:{ctx:V}}}),j=new de({props:{name:"call",anchor:"transformers.TFGroupViTModel.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:"output_segmentation",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFGroupViTModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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.TFGroupViTModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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/main/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.TFGroupViTModel.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/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L2069",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.groupvit.modeling_tf_groupvit.TFGroupViTModelOutput</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.groupvit.configuration_groupvit.GroupViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</p>
</li>
<li>
<p><strong>logits_per_image</strong> (<code>tf.Tensor</code> 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.</p>
</li>
<li>
<p><strong>logits_per_text</strong> (<code>tf.Tensor</code> 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.</p>
</li>
<li>
<p><strong>segmentation_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) — Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>text_embeds</strong> (<code>tf.Tensor</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/main/en/model_doc/groupvit#transformers.TFGroupViTTextModel"
>TFGroupViTTextModel</a>.</p>
</li>
<li>
<p><strong>image_embeds</strong> (<code>tf.Tensor</code> 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/main/en/model_doc/groupvit#transformers.TFGroupViTVisionModel"
>TFGroupViTVisionModel</a>.</p>
</li>
<li>
<p><strong>text_model_output</strong> (<code>TFBaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTTextModel"
>TFGroupViTTextModel</a>.</p>
</li>
<li>
<p><strong>vision_model_output</strong> (<code>TFBaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/groupvit#transformers.TFGroupViTVisionModel"
>TFGroupViTVisionModel</a>.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.groupvit.modeling_tf_groupvit.TFGroupViTModelOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),ee=new Ke({props:{$$slots:{default:[kt]},$$scope:{ctx:V}}}),_e=new Pe({props:{anchor:"transformers.TFGroupViTModel.call.example",$$slots:{default:[Jt]},$$scope:{ctx:V}}}),te=new de({props:{name:"get_text_features",anchor:"transformers.TFGroupViTModel.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.TFGroupViTModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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.TFGroupViTModel.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/main/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.TFGroupViTModel.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/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L1985",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/main/en/model_doc/groupvit#transformers.TFGroupViTTextModel"
>TFGroupViTTextModel</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>
`}}),oe=new Ke({props:{$$slots:{default:[Ut]},$$scope:{ctx:V}}}),ye=new Pe({props:{anchor:"transformers.TFGroupViTModel.get_text_features.example",$$slots:{default:[Ct]},$$scope:{ctx:V}}}),ce=new de({props:{name:"get_image_features",anchor:"transformers.TFGroupViTModel.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.TFGroupViTModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFGroupViTModel.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. 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.TFGroupViTModel.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.TFGroupViTModel.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/main/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.TFGroupViTModel.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/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L2026",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/main/en/model_doc/groupvit#transformers.TFGroupViTVisionModel"
>TFGroupViTVisionModel</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>
`}}),ne=new Ke({props:{$$slots:{default:[zt]},$$scope:{ctx:V}}}),X=new Pe({props:{anchor:"transformers.TFGroupViTModel.get_image_features.example",$$slots:{default:[Wt]},$$scope:{ctx:V}}}),q=new Ze({props:{title:"TFGroupViTTextModel",local:"transformers.TFGroupViTTextModel",headingTag:"h2"}}),be=new de({props:{name:"class transformers.TFGroupViTTextModel",anchor:"transformers.TFGroupViTTextModel",parameters:[{name:"config",val:": GroupViTTextConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L1853"}}),ie=new de({props:{name:"call",anchor:"transformers.TFGroupViTTextModel.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:": bool = False"}],parametersDescription:[{anchor:"transformers.TFGroupViTTextModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/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.TFGroupViTTextModel.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.TFGroupViTTextModel.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.TFGroupViTTextModel.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.TFGroupViTTextModel.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.TFGroupViTTextModel.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/main/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.TFGroupViTTextModel.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/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L1862",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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.groupvit.configuration_groupvit.GroupViTTextConfig'&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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ve=new Ke({props:{$$slots:{default:[It]},$$scope:{ctx:V}}}),L=new Pe({props:{anchor:"transformers.TFGroupViTTextModel.call.example",$$slots:{default:[Ft]},$$scope:{ctx:V}}}),C=new Ze({props:{title:"TFGroupViTVisionModel",local:"transformers.TFGroupViTVisionModel",headingTag:"h2"}}),se=new de({props:{name:"class transformers.TFGroupViTVisionModel",anchor:"transformers.TFGroupViTVisionModel",parameters:[{name:"config",val:": GroupViTVisionConfig"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L1914"}}),Z=new de({props:{name:"call",anchor:"transformers.TFGroupViTVisionModel.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:": bool = False"}],parametersDescription:[{anchor:"transformers.TFGroupViTVisionModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFGroupViTVisionModel.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.TFGroupViTVisionModel.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.TFGroupViTVisionModel.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/main/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.TFGroupViTVisionModel.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/main/src/transformers/models/groupvit/modeling_tf_groupvit.py#L1923",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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.groupvit.configuration_groupvit.GroupViTVisionConfig'&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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),w=new Ke({props:{$$slots:{default:[Zt]},$$scope:{ctx:V}}}),z=new Pe({props:{anchor:"transformers.TFGroupViTVisionModel.call.example",$$slots:{default:[Bt]},$$scope:{ctx:V}}}),{c(){h(e.$$.fragment),c=a(),o=g("div"),h(n.$$.fragment),u=a(),t=g("p"),t.innerHTML=v,Fe=a(),k=g("p"),k.innerHTML=I,Ge=a(),h(J.$$.fragment),$e=a(),B=g("div"),h(j.$$.fragment),re=a(),ae=g("p"),ae.innerHTML=We,pe=a(),h(ee.$$.fragment),je=a(),h(_e.$$.fragment),Se=a(),R=g("div"),h(te.$$.fragment),ke=a(),Te=g("p"),Te.innerHTML=Ye,H=a(),h(oe.$$.fragment),Je=a(),h(ye.$$.fragment),Qe=a(),E=g("div"),h(ce.$$.fragment),Be=a(),P=g("p"),P.innerHTML=Re,F=a(),h(ne.$$.fragment),we=a(),h(X.$$.fragment),Ae=a(),h(q.$$.fragment),me=a(),xe=g("div"),h(be.$$.fragment),Ue=a(),N=g("div"),h(ie.$$.fragment),Ie=a(),Me=g("p"),Me.innerHTML=He,ue=a(),h(ve.$$.fragment),U=a(),h(L.$$.fragment),Ee=a(),h(C.$$.fragment),Ce=a(),Ve=g("div"),h(se.$$.fragment),et=a(),le=g("div"),h(Z.$$.fragment),qe=a(),S=g("p"),S.innerHTML=Ne,l=a(),h(w.$$.fragment),ge=a(),h(z.$$.fragment),this.h()},l(d){_(e.$$.fragment,d),c=i(d),o=f(d,"DIV",{class:!0});var $=K(o);_(n.$$.fragment,$),u=i($),t=f($,"P",{"data-svelte-h":!0}),x(t)!=="svelte-1qaxm70"&&(t.innerHTML=v),Fe=i($),k=f($,"P",{"data-svelte-h":!0}),x(k)!=="svelte-1be7e3c"&&(k.innerHTML=I),Ge=i($),_(J.$$.fragment,$),$e=i($),B=f($,"DIV",{class:!0});var O=K(B);_(j.$$.fragment,O),re=i(O),ae=f(O,"P",{"data-svelte-h":!0}),x(ae)!=="svelte-n1zo85"&&(ae.innerHTML=We),pe=i(O),_(ee.$$.fragment,O),je=i(O),_(_e.$$.fragment,O),O.forEach(r),Se=i($),R=f($,"DIV",{class:!0});var W=K(R);_(te.$$.fragment,W),ke=i(W),Te=f(W,"P",{"data-svelte-h":!0}),x(Te)!=="svelte-n1zo85"&&(Te.innerHTML=Ye),H=i(W),_(oe.$$.fragment,W),Je=i(W),_(ye.$$.fragment,W),W.forEach(r),Qe=i($),E=f($,"DIV",{class:!0});var Y=K(E);_(ce.$$.fragment,Y),Be=i(Y),P=f(Y,"P",{"data-svelte-h":!0}),x(P)!=="svelte-n1zo85"&&(P.innerHTML=Re),F=i(Y),_(ne.$$.fragment,Y),we=i(Y),_(X.$$.fragment,Y),Y.forEach(r),$.forEach(r),Ae=i(d),_(q.$$.fragment,d),me=i(d),xe=f(d,"DIV",{class:!0});var ze=K(xe);_(be.$$.fragment,ze),Ue=i(ze),N=f(ze,"DIV",{class:!0});var Q=K(N);_(ie.$$.fragment,Q),Ie=i(Q),Me=f(Q,"P",{"data-svelte-h":!0}),x(Me)!=="svelte-vk8mt5"&&(Me.innerHTML=He),ue=i(Q),_(ve.$$.fragment,Q),U=i(Q),_(L.$$.fragment,Q),Q.forEach(r),ze.forEach(r),Ee=i(d),_(C.$$.fragment,d),Ce=i(d),Ve=f(d,"DIV",{class:!0});var Le=K(Ve);_(se.$$.fragment,Le),et=i(Le),le=f(Le,"DIV",{class:!0});var he=K(le);_(Z.$$.fragment,he),qe=i(he),S=f(he,"P",{"data-svelte-h":!0}),x(S)!=="svelte-18uq85d"&&(S.innerHTML=Ne),l=i(he),_(w.$$.fragment,he),ge=i(he),_(z.$$.fragment,he),he.forEach(r),Le.forEach(r),this.h()},h(){A(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(d,$){T(e,d,$),p(d,c,$),p(d,o,$),T(n,o,null),m(o,u),m(o,t),m(o,Fe),m(o,k),m(o,Ge),T(J,o,null),m(o,$e),m(o,B),T(j,B,null),m(B,re),m(B,ae),m(B,pe),T(ee,B,null),m(B,je),T(_e,B,null),m(o,Se),m(o,R),T(te,R,null),m(R,ke),m(R,Te),m(R,H),T(oe,R,null),m(R,Je),T(ye,R,null),m(o,Qe),m(o,E),T(ce,E,null),m(E,Be),m(E,P),m(E,F),T(ne,E,null),m(E,we),T(X,E,null),p(d,Ae,$),T(q,d,$),p(d,me,$),p(d,xe,$),T(be,xe,null),m(xe,Ue),m(xe,N),T(ie,N,null),m(N,Ie),m(N,Me),m(N,ue),T(ve,N,null),m(N,U),T(L,N,null),p(d,Ee,$),T(C,d,$),p(d,Ce,$),p(d,Ve,$),T(se,Ve,null),m(Ve,et),m(Ve,le),T(Z,le,null),m(le,qe),m(le,S),m(le,l),T(w,le,null),m(le,ge),T(z,le,null),fe=!0},p(d,$){const O={};$&2&&(O.$$scope={dirty:$,ctx:d}),J.$set(O);const W={};$&2&&(W.$$scope={dirty:$,ctx:d}),ee.$set(W);const Y={};$&2&&(Y.$$scope={dirty:$,ctx:d}),_e.$set(Y);const ze={};$&2&&(ze.$$scope={dirty:$,ctx:d}),oe.$set(ze);const Q={};$&2&&(Q.$$scope={dirty:$,ctx:d}),ye.$set(Q);const Le={};$&2&&(Le.$$scope={dirty:$,ctx:d}),ne.$set(Le);const he={};$&2&&(he.$$scope={dirty:$,ctx:d}),X.$set(he);const nt={};$&2&&(nt.$$scope={dirty:$,ctx:d}),ve.$set(nt);const tt={};$&2&&(tt.$$scope={dirty:$,ctx:d}),L.$set(tt);const st={};$&2&&(st.$$scope={dirty:$,ctx:d}),w.$set(st);const s={};$&2&&(s.$$scope={dirty:$,ctx:d}),z.$set(s)},i(d){fe||(y(e.$$.fragment,d),y(n.$$.fragment,d),y(J.$$.fragment,d),y(j.$$.fragment,d),y(ee.$$.fragment,d),y(_e.$$.fragment,d),y(te.$$.fragment,d),y(oe.$$.fragment,d),y(ye.$$.fragment,d),y(ce.$$.fragment,d),y(ne.$$.fragment,d),y(X.$$.fragment,d),y(q.$$.fragment,d),y(be.$$.fragment,d),y(ie.$$.fragment,d),y(ve.$$.fragment,d),y(L.$$.fragment,d),y(C.$$.fragment,d),y(se.$$.fragment,d),y(Z.$$.fragment,d),y(w.$$.fragment,d),y(z.$$.fragment,d),fe=!0)},o(d){b(e.$$.fragment,d),b(n.$$.fragment,d),b(J.$$.fragment,d),b(j.$$.fragment,d),b(ee.$$.fragment,d),b(_e.$$.fragment,d),b(te.$$.fragment,d),b(oe.$$.fragment,d),b(ye.$$.fragment,d),b(ce.$$.fragment,d),b(ne.$$.fragment,d),b(X.$$.fragment,d),b(q.$$.fragment,d),b(be.$$.fragment,d),b(ie.$$.fragment,d),b(ve.$$.fragment,d),b(L.$$.fragment,d),b(C.$$.fragment,d),b(se.$$.fragment,d),b(Z.$$.fragment,d),b(w.$$.fragment,d),b(z.$$.fragment,d),fe=!1},d(d){d&&(r(c),r(o),r(Ae),r(me),r(xe),r(Ee),r(Ce),r(Ve)),M(e,d),M(n),M(J),M(j),M(ee),M(_e),M(te),M(oe),M(ye),M(ce),M(ne),M(X),M(q,d),M(be),M(ie),M(ve),M(L),M(C,d),M(se),M(Z),M(w),M(z)}}}function Ht(V){let e,c;return e=new at({props:{$$slots:{default:[Rt]},$$scope:{ctx:V}}}),{c(){h(e.$$.fragment)},l(o){_(e.$$.fragment,o)},m(o,n){T(e,o,n),c=!0},p(o,n){const u={};n&2&&(u.$$scope={dirty:n,ctx:o}),e.$set(u)},i(o){c||(y(e.$$.fragment,o),c=!0)},o(o){b(e.$$.fragment,o),c=!1},d(o){M(e,o)}}}function Et(V){let e,c,o,n,u,t,v,Fe='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="TensorFlow" src="https://img.shields.io/badge/TensorFlow-FF6F00?style=flat&amp;logo=tensorflow&amp;logoColor=white"/>',k,I,Ge,J,$e=`The GroupViT model was proposed in <a href="https://arxiv.org/abs/2202.11094" rel="nofollow">GroupViT: Semantic Segmentation Emerges from Text Supervision</a> by Jiarui Xu, Shalini De Mello, Sifei Liu, Wonmin Byeon, Thomas Breuel, Jan Kautz, Xiaolong Wang.
Inspired by <a href="clip">CLIP</a>, GroupViT is a vision-language model that can perform zero-shot semantic segmentation on any given vocabulary categories.`,B,j,re="The abstract from the paper is the following:",ae,We,pe="<em>Grouping and recognition are important components of visual scene understanding, e.g., for object detection and semantic segmentation. With end-to-end deep learning systems, grouping of image regions usually happens implicitly via top-down supervision from pixel-level recognition labels. Instead, in this paper, we propose to bring back the grouping mechanism into deep networks, which allows semantic segments to emerge automatically with only text supervision. We propose a hierarchical Grouping Vision Transformer (GroupViT), which goes beyond the regular grid structure representation and learns to group image regions into progressively larger arbitrary-shaped segments. We train GroupViT jointly with a text encoder on a large-scale image-text dataset via contrastive losses. With only text supervision and without any pixel-level annotations, GroupViT learns to group together semantic regions and successfully transfers to the task of semantic segmentation in a zero-shot manner, i.e., without any further fine-tuning. It achieves a zero-shot accuracy of 52.3% mIoU on the PASCAL VOC 2012 and 22.4% mIoU on PASCAL Context datasets, and performs competitively to state-of-the-art transfer-learning methods requiring greater levels of supervision.</em>",ee,je,_e=`This model was contributed by <a href="https://huggingface.co/xvjiarui" rel="nofollow">xvjiarui</a>. The TensorFlow version was contributed by <a href="https://huggingface.co/ariG23498" rel="nofollow">ariG23498</a> with the help of <a href="https://huggingface.co/ydshieh" rel="nofollow">Yih-Dar SHIEH</a>, <a href="https://huggingface.co/amyeroberts" rel="nofollow">Amy Roberts</a>, and <a href="https://huggingface.co/joaogante" rel="nofollow">Joao Gante</a>.
The original code can be found <a href="https://github.com/NVlabs/GroupViT" rel="nofollow">here</a>.`,Se,R,te,ke,Te="<li>You may specify <code>output_segmentation=True</code> in the forward of <code>GroupViTModel</code> to get the segmentation logits of input texts.</li>",Ye,H,oe,Je,ye="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with GroupViT.",Qe,E,ce='<li>The quickest way to get started with GroupViT is by checking the <a href="https://github.com/xvjiarui/GroupViT/blob/main/demo/GroupViT_hf_inference_notebook.ipynb" rel="nofollow">example notebooks</a> (which showcase zero-shot segmentation inference).</li> <li>One can also check out the <a href="https://huggingface.co/spaces/xvjiarui/GroupViT" rel="nofollow">HuggingFace Spaces demo</a> to play with GroupViT.</li>',Be,P,Re,F,ne,we,X,Ae=`<a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTConfig">GroupViTConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTModel">GroupViTModel</a>. It is used to
instantiate a GroupViT 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 GroupViT
<a href="https://huggingface.co/nvidia/groupvit-gcc-yfcc" rel="nofollow">nvidia/groupvit-gcc-yfcc</a> architecture.`,q,me,xe=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,be,Ue,N,ie,Ie,Me=`Instantiate a <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTConfig">GroupViTConfig</a> (or a derived class) from groupvit text model configuration and groupvit
vision model configuration.`,He,ue,ve,U,L,Ee,C,Ce=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTTextModel">GroupViTTextModel</a>. It is used to instantiate an
GroupViT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the GroupViT
<a href="https://huggingface.co/nvidia/groupvit-gcc-yfcc" rel="nofollow">nvidia/groupvit-gcc-yfcc</a> architecture.`,Ve,se,et=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,le,Z,qe,S,Ne,l,w,ge,z,fe=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/groupvit#transformers.GroupViTVisionModel">GroupViTVisionModel</a>. It is used to instantiate
an GroupViT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the GroupViT
<a href="https://huggingface.co/nvidia/groupvit-gcc-yfcc" rel="nofollow">nvidia/groupvit-gcc-yfcc</a> architecture.`,d,$,O=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,W,Y,ze,Q,Le,he,nt,tt,st;return u=new Ze({props:{title:"GroupViT",local:"groupvit",headingTag:"h1"}}),I=new Ze({props:{title:"Overview",local:"overview",headingTag:"h2"}}),R=new Ze({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),H=new Ze({props:{title:"Resources",local:"resources",headingTag:"h2"}}),P=new Ze({props:{title:"GroupViTConfig",local:"transformers.GroupViTConfig",headingTag:"h2"}}),ne=new de({props:{name:"class transformers.GroupViTConfig",anchor:"transformers.GroupViTConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 256"},{name:"projection_intermediate_dim",val:" = 4096"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GroupViTConfig.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/main/en/model_doc/groupvit#transformers.GroupViTTextConfig">GroupViTTextConfig</a>.`,name:"text_config"},{anchor:"transformers.GroupViTConfig.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/main/en/model_doc/groupvit#transformers.GroupViTVisionConfig">GroupViTVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.GroupViTConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.GroupViTConfig.projection_intermediate_dim",description:`<strong>projection_intermediate_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of intermediate layer of text and vision projection layers.`,name:"projection_intermediate_dim"},{anchor:"transformers.GroupViTConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The initial value of the <em>logit_scale</em> parameter. Default is used as per the original GroupViT
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.GroupViTConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/configuration_groupvit.py#L233"}}),N=new de({props:{name:"from_text_vision_configs",anchor:"transformers.GroupViTConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": GroupViTTextConfig"},{name:"vision_config",val:": GroupViTVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/groupvit/configuration_groupvit.py#L359",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/main/en/model_doc/groupvit#transformers.GroupViTConfig"
>GroupViTConfig</a></p>
`}}),ue=new Ze({props:{title:"GroupViTTextConfig",local:"transformers.GroupViTTextConfig",headingTag:"h2"}}),L=new de({props:{name:"class transformers.GroupViTTextConfig",anchor:"transformers.GroupViTTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 256"},{name:"intermediate_size",val:" = 1024"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 4"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"dropout",val:" = 0.0"},{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.GroupViTTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the GroupViT 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/main/en/model_doc/groupvit#transformers.GroupViTModel">GroupViTModel</a>.`,name:"vocab_size"},{anchor:"transformers.GroupViTTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GroupViTTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GroupViTTextConfig.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.GroupViTTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GroupViTTextConfig.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.GroupViTTextConfig.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.GroupViTTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GroupViTTextConfig.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.GroupViTTextConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.GroupViTTextConfig.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.GroupViTTextConfig.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/main/src/transformers/models/groupvit/configuration_groupvit.py#L33"}}),Z=new Pe({props:{anchor:"transformers.GroupViTTextConfig.example",$$slots:{default:[gt]},$$scope:{ctx:V}}}),S=new Ze({props:{title:"GroupViTVisionConfig",local:"transformers.GroupViTVisionConfig",headingTag:"h2"}}),w=new de({props:{name:"class transformers.GroupViTVisionConfig",anchor:"transformers.GroupViTVisionConfig",parameters:[{name:"hidden_size",val:" = 384"},{name:"intermediate_size",val:" = 1536"},{name:"depths",val:" = [6, 3, 3]"},{name:"num_hidden_layers",val:" = 12"},{name:"num_group_tokens",val:" = [64, 8, 0]"},{name:"num_output_groups",val:" = [64, 8, 8]"},{name:"num_attention_heads",val:" = 6"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"hidden_act",val:" = 'gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"dropout",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"assign_eps",val:" = 1.0"},{name:"assign_mlp_ratio",val:" = [0.5, 4]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GroupViTVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 384) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GroupViTVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1536) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GroupViTVisionConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to [6, 3, 3]) &#x2014;
The number of layers in each encoder block.`,name:"depths"},{anchor:"transformers.GroupViTVisionConfig.num_group_tokens",description:`<strong>num_group_tokens</strong> (<code>List[int]</code>, <em>optional</em>, defaults to [64, 8, 0]) &#x2014;
The number of group tokens for each stage.`,name:"num_group_tokens"},{anchor:"transformers.GroupViTVisionConfig.num_output_groups",description:`<strong>num_output_groups</strong> (<code>List[int]</code>, <em>optional</em>, defaults to [64, 8, 8]) &#x2014;
The number of output groups for each stage, 0 means no group.`,name:"num_output_groups"},{anchor:"transformers.GroupViTVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GroupViTVisionConfig.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.GroupViTVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.GroupViTVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.GroupViTVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GroupViTVisionConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.GroupViTVisionConfig.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.GroupViTVisionConfig.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.GroupViTVisionConfig.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/main/src/transformers/models/groupvit/configuration_groupvit.py#L125"}}),Y=new Pe({props:{anchor:"transformers.GroupViTVisionConfig.example",$$slots:{default:[ft]},$$scope:{ctx:V}}}),Q=new mt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ht],pytorch:[Gt]},$$scope:{ctx:V}}}),he=new ut({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/groupvit.md"}}),{c(){e=g("meta"),c=a(),o=g("p"),n=a(),h(u.$$.fragment),t=a(),v=g("div"),v.innerHTML=Fe,k=a(),h(I.$$.fragment),Ge=a(),J=g("p"),J.innerHTML=$e,B=a(),j=g("p"),j.textContent=re,ae=a(),We=g("p"),We.innerHTML=pe,ee=a(),je=g("p"),je.innerHTML=_e,Se=a(),h(R.$$.fragment),te=a(),ke=g("ul"),ke.innerHTML=Te,Ye=a(),h(H.$$.fragment),oe=a(),Je=g("p"),Je.textContent=ye,Qe=a(),E=g("ul"),E.innerHTML=ce,Be=a(),h(P.$$.fragment),Re=a(),F=g("div"),h(ne.$$.fragment),we=a(),X=g("p"),X.innerHTML=Ae,q=a(),me=g("p"),me.innerHTML=xe,be=a(),Ue=g("div"),h(N.$$.fragment),ie=a(),Ie=g("p"),Ie.innerHTML=Me,He=a(),h(ue.$$.fragment),ve=a(),U=g("div"),h(L.$$.fragment),Ee=a(),C=g("p"),C.innerHTML=Ce,Ve=a(),se=g("p"),se.innerHTML=et,le=a(),h(Z.$$.fragment),qe=a(),h(S.$$.fragment),Ne=a(),l=g("div"),h(w.$$.fragment),ge=a(),z=g("p"),z.innerHTML=fe,d=a(),$=g("p"),$.innerHTML=O,W=a(),h(Y.$$.fragment),ze=a(),h(Q.$$.fragment),Le=a(),h(he.$$.fragment),nt=a(),tt=g("p"),this.h()},l(s){const G=ct("svelte-u9bgzb",document.head);e=f(G,"META",{name:!0,content:!0}),G.forEach(r),c=i(s),o=f(s,"P",{}),K(o).forEach(r),n=i(s),_(u.$$.fragment,s),t=i(s),v=f(s,"DIV",{class:!0,"data-svelte-h":!0}),x(v)!=="svelte-ltwe0m"&&(v.innerHTML=Fe),k=i(s),_(I.$$.fragment,s),Ge=i(s),J=f(s,"P",{"data-svelte-h":!0}),x(J)!=="svelte-9ila0d"&&(J.innerHTML=$e),B=i(s),j=f(s,"P",{"data-svelte-h":!0}),x(j)!=="svelte-vfdo9a"&&(j.textContent=re),ae=i(s),We=f(s,"P",{"data-svelte-h":!0}),x(We)!=="svelte-15lxkm3"&&(We.innerHTML=pe),ee=i(s),je=f(s,"P",{"data-svelte-h":!0}),x(je)!=="svelte-1d5dihc"&&(je.innerHTML=_e),Se=i(s),_(R.$$.fragment,s),te=i(s),ke=f(s,"UL",{"data-svelte-h":!0}),x(ke)!=="svelte-1u8mcsj"&&(ke.innerHTML=Te),Ye=i(s),_(H.$$.fragment,s),oe=i(s),Je=f(s,"P",{"data-svelte-h":!0}),x(Je)!=="svelte-3razzh"&&(Je.textContent=ye),Qe=i(s),E=f(s,"UL",{"data-svelte-h":!0}),x(E)!=="svelte-gxpanf"&&(E.innerHTML=ce),Be=i(s),_(P.$$.fragment,s),Re=i(s),F=f(s,"DIV",{class:!0});var De=K(F);_(ne.$$.fragment,De),we=i(De),X=f(De,"P",{"data-svelte-h":!0}),x(X)!=="svelte-1gp86uz"&&(X.innerHTML=Ae),q=i(De),me=f(De,"P",{"data-svelte-h":!0}),x(me)!=="svelte-o55m63"&&(me.innerHTML=xe),be=i(De),Ue=f(De,"DIV",{class:!0});var rt=K(Ue);_(N.$$.fragment,rt),ie=i(rt),Ie=f(rt,"P",{"data-svelte-h":!0}),x(Ie)!=="svelte-irw5fy"&&(Ie.innerHTML=Me),rt.forEach(r),De.forEach(r),He=i(s),_(ue.$$.fragment,s),ve=i(s),U=f(s,"DIV",{class:!0});var Oe=K(U);_(L.$$.fragment,Oe),Ee=i(Oe),C=f(Oe,"P",{"data-svelte-h":!0}),x(C)!=="svelte-1nr7m9l"&&(C.innerHTML=Ce),Ve=i(Oe),se=f(Oe,"P",{"data-svelte-h":!0}),x(se)!=="svelte-o55m63"&&(se.innerHTML=et),le=i(Oe),_(Z.$$.fragment,Oe),Oe.forEach(r),qe=i(s),_(S.$$.fragment,s),Ne=i(s),l=f(s,"DIV",{class:!0});var ot=K(l);_(w.$$.fragment,ot),ge=i(ot),z=f(ot,"P",{"data-svelte-h":!0}),x(z)!=="svelte-1ctwt05"&&(z.innerHTML=fe),d=i(ot),$=f(ot,"P",{"data-svelte-h":!0}),x($)!=="svelte-o55m63"&&($.innerHTML=O),W=i(ot),_(Y.$$.fragment,ot),ot.forEach(r),ze=i(s),_(Q.$$.fragment,s),Le=i(s),_(he.$$.fragment,s),nt=i(s),tt=f(s,"P",{}),K(tt).forEach(r),this.h()},h(){A(e,"name","hf:doc:metadata"),A(e,"content",qt),A(v,"class","flex flex-wrap space-x-1"),A(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,G){m(document.head,e),p(s,c,G),p(s,o,G),p(s,n,G),T(u,s,G),p(s,t,G),p(s,v,G),p(s,k,G),T(I,s,G),p(s,Ge,G),p(s,J,G),p(s,B,G),p(s,j,G),p(s,ae,G),p(s,We,G),p(s,ee,G),p(s,je,G),p(s,Se,G),T(R,s,G),p(s,te,G),p(s,ke,G),p(s,Ye,G),T(H,s,G),p(s,oe,G),p(s,Je,G),p(s,Qe,G),p(s,E,G),p(s,Be,G),T(P,s,G),p(s,Re,G),p(s,F,G),T(ne,F,null),m(F,we),m(F,X),m(F,q),m(F,me),m(F,be),m(F,Ue),T(N,Ue,null),m(Ue,ie),m(Ue,Ie),p(s,He,G),T(ue,s,G),p(s,ve,G),p(s,U,G),T(L,U,null),m(U,Ee),m(U,C),m(U,Ve),m(U,se),m(U,le),T(Z,U,null),p(s,qe,G),T(S,s,G),p(s,Ne,G),p(s,l,G),T(w,l,null),m(l,ge),m(l,z),m(l,d),m(l,$),m(l,W),T(Y,l,null),p(s,ze,G),T(Q,s,G),p(s,Le,G),T(he,s,G),p(s,nt,G),p(s,tt,G),st=!0},p(s,[G]){const De={};G&2&&(De.$$scope={dirty:G,ctx:s}),Z.$set(De);const rt={};G&2&&(rt.$$scope={dirty:G,ctx:s}),Y.$set(rt);const Oe={};G&2&&(Oe.$$scope={dirty:G,ctx:s}),Q.$set(Oe)},i(s){st||(y(u.$$.fragment,s),y(I.$$.fragment,s),y(R.$$.fragment,s),y(H.$$.fragment,s),y(P.$$.fragment,s),y(ne.$$.fragment,s),y(N.$$.fragment,s),y(ue.$$.fragment,s),y(L.$$.fragment,s),y(Z.$$.fragment,s),y(S.$$.fragment,s),y(w.$$.fragment,s),y(Y.$$.fragment,s),y(Q.$$.fragment,s),y(he.$$.fragment,s),st=!0)},o(s){b(u.$$.fragment,s),b(I.$$.fragment,s),b(R.$$.fragment,s),b(H.$$.fragment,s),b(P.$$.fragment,s),b(ne.$$.fragment,s),b(N.$$.fragment,s),b(ue.$$.fragment,s),b(L.$$.fragment,s),b(Z.$$.fragment,s),b(S.$$.fragment,s),b(w.$$.fragment,s),b(Y.$$.fragment,s),b(Q.$$.fragment,s),b(he.$$.fragment,s),st=!1},d(s){s&&(r(c),r(o),r(n),r(t),r(v),r(k),r(Ge),r(J),r(B),r(j),r(ae),r(We),r(ee),r(je),r(Se),r(te),r(ke),r(Ye),r(oe),r(Je),r(Qe),r(E),r(Be),r(Re),r(F),r(He),r(ve),r(U),r(qe),r(Ne),r(l),r(ze),r(Le),r(nt),r(tt)),r(e),M(u,s),M(I,s),M(R,s),M(H,s),M(P,s),M(ne),M(N),M(ue,s),M(L),M(Z),M(S,s),M(w),M(Y),M(Q,s),M(he,s)}}}const qt='{"title":"GroupViT","local":"groupvit","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"GroupViTConfig","local":"transformers.GroupViTConfig","sections":[],"depth":2},{"title":"GroupViTTextConfig","local":"transformers.GroupViTTextConfig","sections":[],"depth":2},{"title":"GroupViTVisionConfig","local":"transformers.GroupViTVisionConfig","sections":[],"depth":2},{"title":"GroupViTModel","local":"transformers.GroupViTModel","sections":[],"depth":2},{"title":"GroupViTTextModel","local":"transformers.GroupViTTextModel","sections":[],"depth":2},{"title":"GroupViTVisionModel","local":"transformers.GroupViTVisionModel","sections":[],"depth":2},{"title":"TFGroupViTModel","local":"transformers.TFGroupViTModel","sections":[],"depth":2},{"title":"TFGroupViTTextModel","local":"transformers.TFGroupViTTextModel","sections":[],"depth":2},{"title":"TFGroupViTVisionModel","local":"transformers.TFGroupViTVisionModel","sections":[],"depth":2}],"depth":1}';function Nt(V){return lt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ot extends dt{constructor(e){super(),pt(this,e,Nt,Et,it,{})}}export{Ot as component};
