import{s as En,f as Ln,o as qn,n as H}from"../chunks/scheduler.25b97de1.js";import{S as Pn,i as Hn,g as p,s as a,r as f,A as Yn,h as m,f as o,c as r,j as F,u as g,x as u,k as I,y as d,a as l,v as _,d as M,t as y,w as b}from"../chunks/index.d9030fc9.js";import{T as pn}from"../chunks/Tip.baa67368.js";import{D as q}from"../chunks/Docstring.ffac8efa.js";import{C as Be}from"../chunks/CodeBlock.e6cd0d95.js";import{E as We}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as P,E as Qn}from"../chunks/EditOnGithub.91d95064.js";function An(v){let n,w="Example:",c,i,h;return i=new Be({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdpdFZpc2lvbkNvbmZpZyUyQyUyMEdpdFZpc2lvbk1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdpdFZpc2lvbkNvbmZpZyUyMHdpdGglMjBtaWNyb3NvZnQlMkZnaXQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBHaXRWaXNpb25Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBHaXRWaXNpb25Nb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEdpdFZpc2lvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GitVisionConfig, GitVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GitVisionConfig with microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GitVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GitVisionModel (with random weights) from the microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitVisionModel(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(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-11lpom8"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function Sn(v){let n,w=`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(){n=p("p"),n.innerHTML=w},l(c){n=m(c,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(c,i){l(c,n,i)},p:H,d(c){c&&o(n)}}}function Dn(v){let n,w="Examples:",c,i,h;return i=new Be({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEdpdFZpc2lvbk1vZGVsJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBHaXRWaXNpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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, GitVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitVisionModel.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state`,wrap:!1}}),{c(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-kvfsh7"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function Kn(v){let n,w="Examples:",c,i,h;return i=new Be({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdpdENvbmZpZyUyQyUyMEdpdE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdJVCUyMG1pY3Jvc29mdCUyRmdpdC1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEdpdENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBtaWNyb3NvZnQlMkZnaXQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwR2l0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GitConfig, GitModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GIT microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GitConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitModel(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(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-kvfsh7"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function On(v){let n,w=`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(){n=p("p"),n.innerHTML=w},l(c){n=m(c,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(c,i){l(c,n,i)},p:H,d(c){c&&o(n)}}}function es(v){let n,w="Examples:",c,i,h;return i=new Be({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWwlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmdpdC1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZnaXQtYmFzZSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMnRoaXMlMjBpcyUyMGFuJTIwaW1hZ2UlMjBvZiUyMHR3byUyMGNhdHMlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjB0ZXh0JTNEdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModel
<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> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;this is an image of two cats&quot;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state`,wrap:!1}}),{c(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-kvfsh7"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function ts(v){let n,w=`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(){n=p("p"),n.innerHTML=w},l(c){n=m(c,"P",{"data-svelte-h":!0}),u(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(c,i){l(c,n,i)},p:H,d(c){c&&o(n)}}}function ns(v){let n,w="Image captioning example:",c,i,h;return i=new Be({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UtY29jbyUyMiklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZnaXQtYmFzZS1jb2NvJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUocGl4ZWxfdmFsdWVzJTNEcGl4ZWxfdmFsdWVzJTJDJTIwbWF4X2xlbmd0aCUzRDUwKSUwQWdlbmVyYXRlZF9jYXB0aW9uJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCUwQXByaW50KGdlbmVyYXRlZF9jYXB0aW9uKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM
<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> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-coco&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-coco&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_caption)
two cats sleeping on a pink blanket <span class="hljs-built_in">next</span> to remotes.`,wrap:!1}}),{c(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-jwd2q3"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function ss(v){let n,w="Visual question answering (VQA) example:",c,i,h;return i=new Be({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBoZl9odWJfZG93bmxvYWQlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZnaXQtYmFzZS10ZXh0dnFhJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmdpdC1iYXNlLXRleHR2cWElMjIpJTBBJTBBZmlsZV9wYXRoJTIwJTNEJTIwaGZfaHViX2Rvd25sb2FkKHJlcG9faWQlM0QlMjJuaWVsc3IlMkZ0ZXh0dnFhLXNhbXBsZSUyMiUyQyUyMGZpbGVuYW1lJTNEJTIyYnVzLnBuZyUyMiUyQyUyMHJlcG9fdHlwZSUzRCUyMmRhdGFzZXQlMjIpJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKGZpbGVfcGF0aCkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBcGl4ZWxfdmFsdWVzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikucGl4ZWxfdmFsdWVzJTBBJTBBcXVlc3Rpb24lMjAlM0QlMjAlMjJ3aGF0JTIwZG9lcyUyMHRoZSUyMGZyb250JTIwb2YlMjB0aGUlMjBidXMlMjBzYXklMjBhdCUyMHRoZSUyMHRvcCUzRiUyMiUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEcXVlc3Rpb24lMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSkuaW5wdXRfaWRzJTBBaW5wdXRfaWRzJTIwJTNEJTIwJTVCcHJvY2Vzc29yLnRva2VuaXplci5jbHNfdG9rZW5faWQlNUQlMjAlMkIlMjBpbnB1dF9pZHMlMEFpbnB1dF9pZHMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoaW5wdXRfaWRzKS51bnNxdWVlemUoMCklMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUocGl4ZWxfdmFsdWVzJTNEcGl4ZWxfdmFsdWVzJTJDJTIwaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDUwKSUwQXByaW50KHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<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>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-textvqa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-textvqa&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(repo_id=<span class="hljs-string">&quot;nielsr/textvqa-sample&quot;</span>, filename=<span class="hljs-string">&quot;bus.png&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(file_path).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>question = <span class="hljs-string">&quot;what does the front of the bus say at the top?&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = processor(text=question, add_special_tokens=<span class="hljs-literal">False</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = [processor.tokenizer.cls_token_id] + input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(input_ids).unsqueeze(<span class="hljs-number">0</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, input_ids=input_ids, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>))
[<span class="hljs-string">&#x27;what does the front of the bus say at the top? special&#x27;</span>]`,wrap:!1}}),{c(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1yp8bv1"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function os(v){let n,w="Video captioning example:",c,i,h;return i=new Be({props:{code:" ",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> av
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<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">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-vatex&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-vatex&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># set seed for reproducability</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">45</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">read_video_pyav</span>(<span class="hljs-params">container, indices</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Decode the video with PyAV decoder.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        container (\`av.container.input.InputContainer\`): PyAV container.
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of frame indices to decode.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    frames = []
<span class="hljs-meta">... </span>    container.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>    start_index = indices[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    end_index = indices[-<span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, frame <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(container.decode(video=<span class="hljs-number">0</span>)):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt; end_index:
<span class="hljs-meta">... </span>            <span class="hljs-keyword">break</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt;= start_index <span class="hljs-keyword">and</span> i <span class="hljs-keyword">in</span> indices:
<span class="hljs-meta">... </span>            frames.append(frame)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> np.stack([x.to_ndarray(<span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;rgb24&quot;</span>) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> frames])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Sample a given number of frame indices from the video.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        clip_len (\`int\`): Total number of frames to sample.
<span class="hljs-meta">... </span>        frame_sample_rate (\`int\`): Sample every n-th frame.
<span class="hljs-meta">... </span>        seg_len (\`int\`): Maximum allowed index of sample&#x27;s last frame.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of sampled frame indices
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load video</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>container = av.<span class="hljs-built_in">open</span>(file_path)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_frames = model.config.num_image_with_embedding
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(
<span class="hljs-meta">... </span>    clip_len=num_frames, frame_sample_rate=<span class="hljs-number">4</span>, seg_len=container.streams.video[<span class="hljs-number">0</span>].frames
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>frames = read_video_pyav(container, indices)

<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = processor(images=<span class="hljs-built_in">list</span>(frames), return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Generated caption:&quot;</span>, processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>))
Generated caption: [<span class="hljs-string">&#x27;a woman is sitting at a table and she is talking about the food she is holding.&#x27;</span>]`,wrap:!1}}),{c(){n=p("p"),n.textContent=w,c=a(),f(i.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),u(n)!=="svelte-sx5and"&&(n.textContent=w),c=r(t),g(i.$$.fragment,t)},m(t,T){l(t,n,T),l(t,c,T),_(i,t,T),h=!0},p:H,i(t){h||(M(i.$$.fragment,t),h=!0)},o(t){y(i.$$.fragment,t),h=!1},d(t){t&&(o(n),o(c)),b(i,t)}}}function as(v){let n,w,c,i,h,t,T,st,ae,mn=`The GIT model was proposed in <a href="https://arxiv.org/abs/2205.14100" rel="nofollow">GIT: A Generative Image-to-text Transformer for Vision and Language</a> by
Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer
that leverages <a href="clip">CLIP</a>’s vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on
image captioning and visual question answering benchmarks.`,ot,re,hn="The abstract from the paper is the following:",at,ie,un="<em>In this paper, we design and train a Generative Image-to-text Transformer, GIT, to unify vision-language tasks such as image/video captioning and question answering. While generative models provide a consistent network architecture between pre-training and fine-tuning, existing work typically contains complex structures (uni/multi-modal encoder/decoder) and depends on external modules such as object detectors/taggers and optical character recognition (OCR). In GIT, we simplify the architecture as one image encoder and one text decoder under a single language modeling task. We also scale up the pre-training data and the model size to boost the model performance. Without bells and whistles, our GIT establishes new state of the arts on 12 challenging benchmarks with a large margin. For instance, our model surpasses the human performance for the first time on TextCaps (138.2 vs. 125.5 in CIDEr). Furthermore, we present a new scheme of generation-based image classification and scene text recognition, achieving decent performance on standard benchmarks.</em>",rt,Y,fn,it,le,gn='GIT architecture. Taken from the <a href="https://arxiv.org/abs/2205.14100" target="_blank">original paper</a>.',lt,de,_n=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>.
The original code can be found <a href="https://github.com/microsoft/GenerativeImage2Text" rel="nofollow">here</a>.`,dt,ce,ct,pe,Mn="<li>GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on <code>pixel_values</code>.</li>",pt,me,mt,he,yn="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with GIT.",ht,ue,bn='<li>Demo notebooks regarding inference + fine-tuning GIT on custom data can be found <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/GIT" rel="nofollow">here</a>.</li> <li>See also: <a href="../tasks/language_modeling">Causal language modeling task guide</a></li>',ut,fe,Tn=`If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`,ft,ge,gt,$,_e,$t,ze,wn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/git#transformers.GitVisionModel">GitVisionModel</a>. It is used to instantiate a GIT
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the GIT
<a href="https://huggingface.co/microsoft/git-base" rel="nofollow">microsoft/git-base</a> architecture.`,Zt,Ve,vn=`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.`,kt,Q,_t,Me,Mt,G,ye,xt,Fe,Jn="The vision model from CLIP, used in GIT, without any head or projection on top.",Wt,Ne,jn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Bt,Re,Gn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,zt,z,be,Vt,Xe,Cn='The <a href="/docs/transformers/main/en/model_doc/git#transformers.GitVisionModel">GitVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Ft,A,Nt,S,yt,Te,bt,Z,we,Rt,Ee,Un=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/git#transformers.GitModel">GitModel</a>. It is used to instantiate a GIT 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 GIT
<a href="https://huggingface.co/microsoft/git-base" rel="nofollow">microsoft/git-base</a> architecture.`,Xt,Le,In=`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.`,Et,D,Tt,ve,wt,k,Je,Lt,qe,$n="Constructs a GIT processor which wraps a CLIP image processor and a BERT tokenizer into a single processor.",qt,Pe,Zn=`<a href="/docs/transformers/main/en/model_doc/git#transformers.GitProcessor">GitProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>. See the
<a href="/docs/transformers/main/en/model_doc/git#transformers.GitProcessor.__call__"><strong>call</strong>()</a> and <code>decode()</code> for more information.`,Pt,K,je,Ht,He,kn=`Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the <code>text</code>
and <code>kwargs</code> arguments to BertTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a> if <code>text</code> is not <code>None</code> to encode
the text. To prepare the image(s), this method forwards the <code>images</code> and <code>kwrags</code> arguments to
CLIPImageProcessor’s <a href="/docs/transformers/main/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__"><strong>call</strong>()</a> if <code>images</code> is not <code>None</code>. Please refer to the doctsring
of the above two methods for more information.`,vt,Ge,Jt,C,Ce,Yt,Ye,xn="The bare GIT Model transformer consisting of a CLIP image encoder and text decoder outputting raw hidden-states without any specific head on top.",Qt,Qe,Wn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,At,Ae,Bn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,St,V,Ue,Dt,Se,zn='The <a href="/docs/transformers/main/en/model_doc/git#transformers.GitModel">GitModel</a> forward method, overrides the <code>__call__</code> special method.',Kt,O,Ot,ee,jt,Ie,Gt,U,$e,en,De,Vn="GIT Model with a <code>language modeling</code> head on top for autoregressive language modeling.",tn,Ke,Fn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,nn,Oe,Nn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,sn,J,Ze,on,et,Rn='The <a href="/docs/transformers/main/en/model_doc/git#transformers.GitForCausalLM">GitForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',an,te,rn,tt,Xn="Examples:",ln,ne,dn,se,cn,oe,Ct,ke,Ut,nt,It;return h=new P({props:{title:"GIT",local:"git",headingTag:"h1"}}),T=new P({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ce=new P({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),me=new P({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ge=new P({props:{title:"GitVisionConfig",local:"transformers.GitVisionConfig",headingTag:"h2"}}),_e=new q({props:{name:"class transformers.GitVisionConfig",anchor:"transformers.GitVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GitVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/configuration_git.py#L26"}}),Q=new We({props:{anchor:"transformers.GitVisionConfig.example",$$slots:{default:[An]},$$scope:{ctx:v}}}),Me=new P({props:{title:"GitVisionModel",local:"transformers.GitVisionModel",headingTag:"h2"}}),ye=new q({props:{name:"class transformers.GitVisionModel",anchor:"transformers.GitVisionModel",parameters:[{name:"config",val:": GitVisionConfig"}],parametersDescription:[{anchor:"transformers.GitVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/git#transformers.GitConfig">GitConfig</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/git/modeling_git.py#L1049"}}),be=new q({props:{name:"forward",anchor:"transformers.GitVisionModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": bool = False"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GitVisionModel.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/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitVisionModel.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.GitVisionModel.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.GitVisionModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.GitVisionModel.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/git/modeling_git.py#L1067",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</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.git.configuration_git.GitVisionConfig'&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>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.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),A=new pn({props:{$$slots:{default:[Sn]},$$scope:{ctx:v}}}),S=new We({props:{anchor:"transformers.GitVisionModel.forward.example",$$slots:{default:[Dn]},$$scope:{ctx:v}}}),Te=new P({props:{title:"GitConfig",local:"transformers.GitConfig",headingTag:"h2"}}),we=new q({props:{name:"class transformers.GitConfig",anchor:"transformers.GitConfig",parameters:[{name:"vision_config",val:" = None"},{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 6"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 1024"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"tie_word_embeddings",val:" = False"},{name:"bos_token_id",val:" = 101"},{name:"eos_token_id",val:" = 102"},{name:"num_image_with_embedding",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitConfig.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/git#transformers.GitVisionConfig">GitVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.GitConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the GIT 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/git#transformers.GitModel">GitModel</a>.`,name:"vocab_size"},{anchor:"transformers.GitConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GitConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.GitConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GitConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.GitConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.GitConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.GitConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.GitConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#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.GitConfig.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.GitConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GitConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.GitConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.GitConfig.num_image_with_embedding",description:`<strong>num_image_with_embedding</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of temporal embeddings to add, in case the model is used for video captioning/VQA.`,name:"num_image_with_embedding"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/configuration_git.py#L124"}}),D=new We({props:{anchor:"transformers.GitConfig.example",$$slots:{default:[Kn]},$$scope:{ctx:v}}}),ve=new P({props:{title:"GitProcessor",local:"transformers.GitProcessor",headingTag:"h2"}}),Je=new q({props:{name:"class transformers.GitProcessor",anchor:"transformers.GitProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.GitProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.GitProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/processing_git.py#L31"}}),je=new q({props:{name:"__call__",anchor:"transformers.GitProcessor.__call__",parameters:[{name:"images",val:": Union = None"},{name:"text",val:": Union = None"},{name:"audio",val:" = None"},{name:"videos",val:" = None"},{name:"**kwargs",val:": Unpack"}],parametersDescription:[{anchor:"transformers.GitProcessor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. Both channels-first and channels-last formats are supported.`,name:"images"},{anchor:"transformers.GitProcessor.__call__.text",description:`<strong>text</strong> (<code>TextInput</code>, <code>PreTokenizedInput</code>, <code>List[TextInput]</code>, <code>List[PreTokenizedInput]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.GitProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/processing_git.py#L53",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>input_ids</strong> — List of token ids to be fed to a model. Returned when <code>text</code> is not <code>None</code>.</li>
<li><strong>attention_mask</strong> — List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>“attention_mask”</em> is in <code>self.model_input_names</code> and if <code>text</code> is not
<code>None</code>).</li>
<li><strong>pixel_values</strong> — Pixel values to be fed to a model. Returned when <code>images</code> is not <code>None</code>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),Ge=new P({props:{title:"GitModel",local:"transformers.GitModel",headingTag:"h2"}}),Ce=new q({props:{name:"class transformers.GitModel",anchor:"transformers.GitModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/git#transformers.GitConfig">GitConfig</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/git/modeling_git.py#L1122"}}),Ue=new q({props:{name:"forward",anchor:"transformers.GitModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"pixel_values",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": bool = False"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GitModel.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.</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.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.GitModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.GitModel.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.GitModel.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/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GitModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GitModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our
<a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GitModel.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.GitModel.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.GitModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.GitModel.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"},{anchor:"transformers.GitModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/modeling_git.py#L1217",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 (<a
  href="/docs/transformers/main/en/model_doc/git#transformers.GitConfig"
>GitConfig</a>) 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>
`}}),O=new pn({props:{$$slots:{default:[On]},$$scope:{ctx:v}}}),ee=new We({props:{anchor:"transformers.GitModel.forward.example",$$slots:{default:[es]},$$scope:{ctx:v}}}),Ie=new P({props:{title:"GitForCausalLM",local:"transformers.GitForCausalLM",headingTag:"h2"}}),$e=new q({props:{name:"class transformers.GitForCausalLM",anchor:"transformers.GitForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GitForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/git#transformers.GitConfig">GitConfig</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/git/modeling_git.py#L1391"}}),Ze=new q({props:{name:"forward",anchor:"transformers.GitForCausalLM.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"pixel_values",val:": Optional = None"},{name:"head_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"interpolate_pos_encoding",val:": bool = False"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GitForCausalLM.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.</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.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.GitForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.GitForCausalLM.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.GitForCausalLM.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/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GitForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GitForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our
<a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GitForCausalLM.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.GitForCausalLM.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.GitForCausalLM.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.GitForCausalLM.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"},{anchor:"transformers.GitForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.GitForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/modeling_git.py#L1412",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/git#transformers.GitConfig"
>GitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</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.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new pn({props:{$$slots:{default:[ts]},$$scope:{ctx:v}}}),ne=new We({props:{anchor:"transformers.GitForCausalLM.forward.example",$$slots:{default:[ns]},$$scope:{ctx:v}}}),se=new We({props:{anchor:"transformers.GitForCausalLM.forward.example-2",$$slots:{default:[ss]},$$scope:{ctx:v}}}),oe=new We({props:{anchor:"transformers.GitForCausalLM.forward.example-3",$$slots:{default:[os]},$$scope:{ctx:v}}}),ke=new Qn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/git.md"}}),{c(){n=p("meta"),w=a(),c=p("p"),i=a(),f(h.$$.fragment),t=a(),f(T.$$.fragment),st=a(),ae=p("p"),ae.innerHTML=mn,ot=a(),re=p("p"),re.textContent=hn,at=a(),ie=p("p"),ie.innerHTML=un,rt=a(),Y=p("img"),it=a(),le=p("small"),le.innerHTML=gn,lt=a(),de=p("p"),de.innerHTML=_n,dt=a(),f(ce.$$.fragment),ct=a(),pe=p("ul"),pe.innerHTML=Mn,pt=a(),f(me.$$.fragment),mt=a(),he=p("p"),he.textContent=yn,ht=a(),ue=p("ul"),ue.innerHTML=bn,ut=a(),fe=p("p"),fe.textContent=Tn,ft=a(),f(ge.$$.fragment),gt=a(),$=p("div"),f(_e.$$.fragment),$t=a(),ze=p("p"),ze.innerHTML=wn,Zt=a(),Ve=p("p"),Ve.innerHTML=vn,kt=a(),f(Q.$$.fragment),_t=a(),f(Me.$$.fragment),Mt=a(),G=p("div"),f(ye.$$.fragment),xt=a(),Fe=p("p"),Fe.textContent=Jn,Wt=a(),Ne=p("p"),Ne.innerHTML=jn,Bt=a(),Re=p("p"),Re.innerHTML=Gn,zt=a(),z=p("div"),f(be.$$.fragment),Vt=a(),Xe=p("p"),Xe.innerHTML=Cn,Ft=a(),f(A.$$.fragment),Nt=a(),f(S.$$.fragment),yt=a(),f(Te.$$.fragment),bt=a(),Z=p("div"),f(we.$$.fragment),Rt=a(),Ee=p("p"),Ee.innerHTML=Un,Xt=a(),Le=p("p"),Le.innerHTML=In,Et=a(),f(D.$$.fragment),Tt=a(),f(ve.$$.fragment),wt=a(),k=p("div"),f(Je.$$.fragment),Lt=a(),qe=p("p"),qe.textContent=$n,qt=a(),Pe=p("p"),Pe.innerHTML=Zn,Pt=a(),K=p("div"),f(je.$$.fragment),Ht=a(),He=p("p"),He.innerHTML=kn,vt=a(),f(Ge.$$.fragment),Jt=a(),C=p("div"),f(Ce.$$.fragment),Yt=a(),Ye=p("p"),Ye.textContent=xn,Qt=a(),Qe=p("p"),Qe.innerHTML=Wn,At=a(),Ae=p("p"),Ae.innerHTML=Bn,St=a(),V=p("div"),f(Ue.$$.fragment),Dt=a(),Se=p("p"),Se.innerHTML=zn,Kt=a(),f(O.$$.fragment),Ot=a(),f(ee.$$.fragment),jt=a(),f(Ie.$$.fragment),Gt=a(),U=p("div"),f($e.$$.fragment),en=a(),De=p("p"),De.innerHTML=Vn,tn=a(),Ke=p("p"),Ke.innerHTML=Fn,nn=a(),Oe=p("p"),Oe.innerHTML=Nn,sn=a(),J=p("div"),f(Ze.$$.fragment),on=a(),et=p("p"),et.innerHTML=Rn,an=a(),f(te.$$.fragment),rn=a(),tt=p("p"),tt.textContent=Xn,ln=a(),f(ne.$$.fragment),dn=a(),f(se.$$.fragment),cn=a(),f(oe.$$.fragment),Ct=a(),f(ke.$$.fragment),Ut=a(),nt=p("p"),this.h()},l(e){const s=Yn("svelte-u9bgzb",document.head);n=m(s,"META",{name:!0,content:!0}),s.forEach(o),w=r(e),c=m(e,"P",{}),F(c).forEach(o),i=r(e),g(h.$$.fragment,e),t=r(e),g(T.$$.fragment,e),st=r(e),ae=m(e,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-2ujlop"&&(ae.innerHTML=mn),ot=r(e),re=m(e,"P",{"data-svelte-h":!0}),u(re)!=="svelte-vfdo9a"&&(re.textContent=hn),at=r(e),ie=m(e,"P",{"data-svelte-h":!0}),u(ie)!=="svelte-1vsq93p"&&(ie.innerHTML=un),rt=r(e),Y=m(e,"IMG",{src:!0,alt:!0,width:!0}),it=r(e),le=m(e,"SMALL",{"data-svelte-h":!0}),u(le)!=="svelte-1ebqlq"&&(le.innerHTML=gn),lt=r(e),de=m(e,"P",{"data-svelte-h":!0}),u(de)!=="svelte-euav7t"&&(de.innerHTML=_n),dt=r(e),g(ce.$$.fragment,e),ct=r(e),pe=m(e,"UL",{"data-svelte-h":!0}),u(pe)!=="svelte-d8zlsq"&&(pe.innerHTML=Mn),pt=r(e),g(me.$$.fragment,e),mt=r(e),he=m(e,"P",{"data-svelte-h":!0}),u(he)!=="svelte-15k8xp3"&&(he.textContent=yn),ht=r(e),ue=m(e,"UL",{"data-svelte-h":!0}),u(ue)!=="svelte-tex1qj"&&(ue.innerHTML=bn),ut=r(e),fe=m(e,"P",{"data-svelte-h":!0}),u(fe)!=="svelte-1rggs50"&&(fe.textContent=Tn),ft=r(e),g(ge.$$.fragment,e),gt=r(e),$=m(e,"DIV",{class:!0});var N=F($);g(_e.$$.fragment,N),$t=r(N),ze=m(N,"P",{"data-svelte-h":!0}),u(ze)!=="svelte-1vm6zyw"&&(ze.innerHTML=wn),Zt=r(N),Ve=m(N,"P",{"data-svelte-h":!0}),u(Ve)!=="svelte-o55m63"&&(Ve.innerHTML=vn),kt=r(N),g(Q.$$.fragment,N),N.forEach(o),_t=r(e),g(Me.$$.fragment,e),Mt=r(e),G=m(e,"DIV",{class:!0});var x=F(G);g(ye.$$.fragment,x),xt=r(x),Fe=m(x,"P",{"data-svelte-h":!0}),u(Fe)!=="svelte-183x34s"&&(Fe.textContent=Jn),Wt=r(x),Ne=m(x,"P",{"data-svelte-h":!0}),u(Ne)!=="svelte-6pahdo"&&(Ne.innerHTML=jn),Bt=r(x),Re=m(x,"P",{"data-svelte-h":!0}),u(Re)!=="svelte-hswkmf"&&(Re.innerHTML=Gn),zt=r(x),z=m(x,"DIV",{class:!0});var R=F(z);g(be.$$.fragment,R),Vt=r(R),Xe=m(R,"P",{"data-svelte-h":!0}),u(Xe)!=="svelte-zyu9nd"&&(Xe.innerHTML=Cn),Ft=r(R),g(A.$$.fragment,R),Nt=r(R),g(S.$$.fragment,R),R.forEach(o),x.forEach(o),yt=r(e),g(Te.$$.fragment,e),bt=r(e),Z=m(e,"DIV",{class:!0});var X=F(Z);g(we.$$.fragment,X),Rt=r(X),Ee=m(X,"P",{"data-svelte-h":!0}),u(Ee)!=="svelte-268s0t"&&(Ee.innerHTML=Un),Xt=r(X),Le=m(X,"P",{"data-svelte-h":!0}),u(Le)!=="svelte-o55m63"&&(Le.innerHTML=In),Et=r(X),g(D.$$.fragment,X),X.forEach(o),Tt=r(e),g(ve.$$.fragment,e),wt=r(e),k=m(e,"DIV",{class:!0});var E=F(k);g(Je.$$.fragment,E),Lt=r(E),qe=m(E,"P",{"data-svelte-h":!0}),u(qe)!=="svelte-ihjj5e"&&(qe.textContent=$n),qt=r(E),Pe=m(E,"P",{"data-svelte-h":!0}),u(Pe)!=="svelte-1pr6x7q"&&(Pe.innerHTML=Zn),Pt=r(E),K=m(E,"DIV",{class:!0});var xe=F(K);g(je.$$.fragment,xe),Ht=r(xe),He=m(xe,"P",{"data-svelte-h":!0}),u(He)!=="svelte-1vksjo"&&(He.innerHTML=kn),xe.forEach(o),E.forEach(o),vt=r(e),g(Ge.$$.fragment,e),Jt=r(e),C=m(e,"DIV",{class:!0});var W=F(C);g(Ce.$$.fragment,W),Yt=r(W),Ye=m(W,"P",{"data-svelte-h":!0}),u(Ye)!=="svelte-1rw2l1f"&&(Ye.textContent=xn),Qt=r(W),Qe=m(W,"P",{"data-svelte-h":!0}),u(Qe)!=="svelte-6pahdo"&&(Qe.innerHTML=Wn),At=r(W),Ae=m(W,"P",{"data-svelte-h":!0}),u(Ae)!=="svelte-hswkmf"&&(Ae.innerHTML=Bn),St=r(W),V=m(W,"DIV",{class:!0});var L=F(V);g(Ue.$$.fragment,L),Dt=r(L),Se=m(L,"P",{"data-svelte-h":!0}),u(Se)!=="svelte-dz132d"&&(Se.innerHTML=zn),Kt=r(L),g(O.$$.fragment,L),Ot=r(L),g(ee.$$.fragment,L),L.forEach(o),W.forEach(o),jt=r(e),g(Ie.$$.fragment,e),Gt=r(e),U=m(e,"DIV",{class:!0});var B=F(U);g($e.$$.fragment,B),en=r(B),De=m(B,"P",{"data-svelte-h":!0}),u(De)!=="svelte-n4hc9w"&&(De.innerHTML=Vn),tn=r(B),Ke=m(B,"P",{"data-svelte-h":!0}),u(Ke)!=="svelte-6pahdo"&&(Ke.innerHTML=Fn),nn=r(B),Oe=m(B,"P",{"data-svelte-h":!0}),u(Oe)!=="svelte-hswkmf"&&(Oe.innerHTML=Nn),sn=r(B),J=m(B,"DIV",{class:!0});var j=F(J);g(Ze.$$.fragment,j),on=r(j),et=m(j,"P",{"data-svelte-h":!0}),u(et)!=="svelte-d6d735"&&(et.innerHTML=Rn),an=r(j),g(te.$$.fragment,j),rn=r(j),tt=m(j,"P",{"data-svelte-h":!0}),u(tt)!=="svelte-kvfsh7"&&(tt.textContent=Xn),ln=r(j),g(ne.$$.fragment,j),dn=r(j),g(se.$$.fragment,j),cn=r(j),g(oe.$$.fragment,j),j.forEach(o),B.forEach(o),Ct=r(e),g(ke.$$.fragment,e),Ut=r(e),nt=m(e,"P",{}),F(nt).forEach(o),this.h()},h(){I(n,"name","hf:doc:metadata"),I(n,"content",rs),Ln(Y.src,fn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg")||I(Y,"src",fn),I(Y,"alt","drawing"),I(Y,"width","600"),I($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(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(e,s){d(document.head,n),l(e,w,s),l(e,c,s),l(e,i,s),_(h,e,s),l(e,t,s),_(T,e,s),l(e,st,s),l(e,ae,s),l(e,ot,s),l(e,re,s),l(e,at,s),l(e,ie,s),l(e,rt,s),l(e,Y,s),l(e,it,s),l(e,le,s),l(e,lt,s),l(e,de,s),l(e,dt,s),_(ce,e,s),l(e,ct,s),l(e,pe,s),l(e,pt,s),_(me,e,s),l(e,mt,s),l(e,he,s),l(e,ht,s),l(e,ue,s),l(e,ut,s),l(e,fe,s),l(e,ft,s),_(ge,e,s),l(e,gt,s),l(e,$,s),_(_e,$,null),d($,$t),d($,ze),d($,Zt),d($,Ve),d($,kt),_(Q,$,null),l(e,_t,s),_(Me,e,s),l(e,Mt,s),l(e,G,s),_(ye,G,null),d(G,xt),d(G,Fe),d(G,Wt),d(G,Ne),d(G,Bt),d(G,Re),d(G,zt),d(G,z),_(be,z,null),d(z,Vt),d(z,Xe),d(z,Ft),_(A,z,null),d(z,Nt),_(S,z,null),l(e,yt,s),_(Te,e,s),l(e,bt,s),l(e,Z,s),_(we,Z,null),d(Z,Rt),d(Z,Ee),d(Z,Xt),d(Z,Le),d(Z,Et),_(D,Z,null),l(e,Tt,s),_(ve,e,s),l(e,wt,s),l(e,k,s),_(Je,k,null),d(k,Lt),d(k,qe),d(k,qt),d(k,Pe),d(k,Pt),d(k,K),_(je,K,null),d(K,Ht),d(K,He),l(e,vt,s),_(Ge,e,s),l(e,Jt,s),l(e,C,s),_(Ce,C,null),d(C,Yt),d(C,Ye),d(C,Qt),d(C,Qe),d(C,At),d(C,Ae),d(C,St),d(C,V),_(Ue,V,null),d(V,Dt),d(V,Se),d(V,Kt),_(O,V,null),d(V,Ot),_(ee,V,null),l(e,jt,s),_(Ie,e,s),l(e,Gt,s),l(e,U,s),_($e,U,null),d(U,en),d(U,De),d(U,tn),d(U,Ke),d(U,nn),d(U,Oe),d(U,sn),d(U,J),_(Ze,J,null),d(J,on),d(J,et),d(J,an),_(te,J,null),d(J,rn),d(J,tt),d(J,ln),_(ne,J,null),d(J,dn),_(se,J,null),d(J,cn),_(oe,J,null),l(e,Ct,s),_(ke,e,s),l(e,Ut,s),l(e,nt,s),It=!0},p(e,[s]){const N={};s&2&&(N.$$scope={dirty:s,ctx:e}),Q.$set(N);const x={};s&2&&(x.$$scope={dirty:s,ctx:e}),A.$set(x);const R={};s&2&&(R.$$scope={dirty:s,ctx:e}),S.$set(R);const X={};s&2&&(X.$$scope={dirty:s,ctx:e}),D.$set(X);const E={};s&2&&(E.$$scope={dirty:s,ctx:e}),O.$set(E);const xe={};s&2&&(xe.$$scope={dirty:s,ctx:e}),ee.$set(xe);const W={};s&2&&(W.$$scope={dirty:s,ctx:e}),te.$set(W);const L={};s&2&&(L.$$scope={dirty:s,ctx:e}),ne.$set(L);const B={};s&2&&(B.$$scope={dirty:s,ctx:e}),se.$set(B);const j={};s&2&&(j.$$scope={dirty:s,ctx:e}),oe.$set(j)},i(e){It||(M(h.$$.fragment,e),M(T.$$.fragment,e),M(ce.$$.fragment,e),M(me.$$.fragment,e),M(ge.$$.fragment,e),M(_e.$$.fragment,e),M(Q.$$.fragment,e),M(Me.$$.fragment,e),M(ye.$$.fragment,e),M(be.$$.fragment,e),M(A.$$.fragment,e),M(S.$$.fragment,e),M(Te.$$.fragment,e),M(we.$$.fragment,e),M(D.$$.fragment,e),M(ve.$$.fragment,e),M(Je.$$.fragment,e),M(je.$$.fragment,e),M(Ge.$$.fragment,e),M(Ce.$$.fragment,e),M(Ue.$$.fragment,e),M(O.$$.fragment,e),M(ee.$$.fragment,e),M(Ie.$$.fragment,e),M($e.$$.fragment,e),M(Ze.$$.fragment,e),M(te.$$.fragment,e),M(ne.$$.fragment,e),M(se.$$.fragment,e),M(oe.$$.fragment,e),M(ke.$$.fragment,e),It=!0)},o(e){y(h.$$.fragment,e),y(T.$$.fragment,e),y(ce.$$.fragment,e),y(me.$$.fragment,e),y(ge.$$.fragment,e),y(_e.$$.fragment,e),y(Q.$$.fragment,e),y(Me.$$.fragment,e),y(ye.$$.fragment,e),y(be.$$.fragment,e),y(A.$$.fragment,e),y(S.$$.fragment,e),y(Te.$$.fragment,e),y(we.$$.fragment,e),y(D.$$.fragment,e),y(ve.$$.fragment,e),y(Je.$$.fragment,e),y(je.$$.fragment,e),y(Ge.$$.fragment,e),y(Ce.$$.fragment,e),y(Ue.$$.fragment,e),y(O.$$.fragment,e),y(ee.$$.fragment,e),y(Ie.$$.fragment,e),y($e.$$.fragment,e),y(Ze.$$.fragment,e),y(te.$$.fragment,e),y(ne.$$.fragment,e),y(se.$$.fragment,e),y(oe.$$.fragment,e),y(ke.$$.fragment,e),It=!1},d(e){e&&(o(w),o(c),o(i),o(t),o(st),o(ae),o(ot),o(re),o(at),o(ie),o(rt),o(Y),o(it),o(le),o(lt),o(de),o(dt),o(ct),o(pe),o(pt),o(mt),o(he),o(ht),o(ue),o(ut),o(fe),o(ft),o(gt),o($),o(_t),o(Mt),o(G),o(yt),o(bt),o(Z),o(Tt),o(wt),o(k),o(vt),o(Jt),o(C),o(jt),o(Gt),o(U),o(Ct),o(Ut),o(nt)),o(n),b(h,e),b(T,e),b(ce,e),b(me,e),b(ge,e),b(_e),b(Q),b(Me,e),b(ye),b(be),b(A),b(S),b(Te,e),b(we),b(D),b(ve,e),b(Je),b(je),b(Ge,e),b(Ce),b(Ue),b(O),b(ee),b(Ie,e),b($e),b(Ze),b(te),b(ne),b(se),b(oe),b(ke,e)}}}const rs='{"title":"GIT","local":"git","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":"GitVisionConfig","local":"transformers.GitVisionConfig","sections":[],"depth":2},{"title":"GitVisionModel","local":"transformers.GitVisionModel","sections":[],"depth":2},{"title":"GitConfig","local":"transformers.GitConfig","sections":[],"depth":2},{"title":"GitProcessor","local":"transformers.GitProcessor","sections":[],"depth":2},{"title":"GitModel","local":"transformers.GitModel","sections":[],"depth":2},{"title":"GitForCausalLM","local":"transformers.GitForCausalLM","sections":[],"depth":2}],"depth":1}';function is(v){return qn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fs extends Pn{constructor(n){super(),Hn(this,n,is,as,En,{})}}export{fs as component};
