import{S as AM,i as OM,s as HM,e as s,k as c,w as g,t as a,M as QM,c as n,d as r,m as l,a as o,x as f,h as i,b as d,G as t,g as m,y as u,q as _,o as b,B as y,v as YM,L as wt}from"../../chunks/vendor-hf-doc-builder.js";import{T as jl}from"../../chunks/Tip-hf-doc-builder.js";import{D as T}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ye}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as be}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Tt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function KM(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsZ3B0MiUyMiklMEFtb2RlbC5jb25maWcucGFkX3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmVvc190b2tlbl9pZCUwQW1vZGVsLmdlbmVyYXRpb25fY29uZmlnLnBhZF90b2tlbl9pZCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5lb3NfdG9rZW5faWQlMEFpbnB1dF9jb250ZXh0JTIwJTNEJTIwJTIySHVnZ2luZyUyMEZhY2UlMjBDb21wYW55JTIwaXMlMjIlMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIuZW5jb2RlKGlucHV0X2NvbnRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMFdpdGhvdXQlMjAlNjBlb3NfdG9rZW5faWQlNjAlMkMlMjBpdCUyMHdpbGwlMjBnZW5lcmF0ZSUyMHRoZSUyMGRlZmF1bHQlMjBsZW5ndGglMkMlMjAyMCUyQyUyMGlnbm9yaW5nJTIwJTYwbWluX25ld190b2tlbnMlNjAlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWluX25ld190b2tlbnMlM0QzMCklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyMElmJTIwJTYwZW9zX3Rva2VuX2lkJTYwJTIwaXMlMjBzZXQlMjB0byUyMCU2MCUyMGNvbXBhbnklNjAlMjBpdCUyMHdpbGwlMjB0YWtlJTIwaW50byUyMGFjY291bnQlMjBob3clMjBtYW55JTIwJTYwbWluX25ld190b2tlbnMlNjAlMjBoYXZlJTIwYmVlbiUyMGdlbmVyYXRlZCUwQSUyMyUyMGJlZm9yZSUyMHN0b3BwaW5nLiUyME5vdGUlMjB0aGF0JTIwJTYwJTIwQ29tcGFueSU2MCUyMCg1ODM0KSUyMGFuZCUyMCU2MCUyMGNvbXBhbnklNjAlMjAoMTY2NCklMjBhcmUlMjBub3QlMjBhY3R1YWxseSUyMHRoZSUyMHNhbWUlMjB0b2tlbiUyQyUyMGFuZCUyMGV2ZW4lMEElMjMlMjBpZiUyMHRoZXklMjB3ZXJlJTIwJTYwJTIwQ29tcGFueSU2MCUyMHdvdWxkJTIwYmUlMjBpZ25vcmVkJTIwYnklMjAlNjBtaW5fbmV3X3Rva2VucyU2MCUyMGFzJTIwaXQlMjBleGNsdWRlcyUyMHRoZSUyMHByb21wdC4lMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWluX25ld190b2tlbnMlM0QxJTJDJTIwZW9zX3Rva2VuX2lkJTNEMTY2NCklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyMEluY3JlYXNpbmclMjAlNjBtaW5fbmV3X3Rva2VucyU2MCUyMHdpbGwlMjBidXJ5JTIwdGhlJTIwZmlyc3QlMjBvY2N1cnJlbmNlJTIwb2YlMjAlNjAlMjBjb21wYW55JTYwJTIwZ2VuZXJhdGluZyUyMGElMjBkaWZmZXJlbnQlMjBzZXF1ZW5jZS4lMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWluX25ld190b2tlbnMlM0QyJTJDJTIwZW9zX3Rva2VuX2lkJTNEMTY2NCklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyMElmJTIwbm8lMjBtb3JlJTIwb2NjdXJyZW5jZXMlMjBvZiUyMHRoZSUyMCU2MGVvc190b2tlbiU2MCUyMGhhcHBlbiUyMGFmdGVyJTIwJTYwbWluX25ld190b2tlbnMlNjAlMjBpdCUyMHJldHVybnMlMjB0byUyMHRoZSUyMDIwJTIwZGVmYXVsdCUyMHRva2Vucy4lMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWluX25ld190b2tlbnMlM0QxMCUyQyUyMGVvc190b2tlbl9pZCUzRDE2NjQpJTBBcHJpbnQodG9rZW5pemVyLmRlY29kZShvdXRwdXRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.pad_token_id = model.config.eos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>model.generation_config.pad_token_id = model.config.eos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>input_context = <span class="hljs-string">&quot;Hugging Face Company is&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer.encode(input_context, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Without \`eos_token_id\`, it will generate the default length, 20, ignoring \`min_new_tokens\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, min_new_tokens=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a company that has been working on a new product <span class="hljs-keyword">for</span> the past year.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If \`eos_token_id\` is set to \` company\` it will take into account how many \`min_new_tokens\` have been generated</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># before stopping. Note that \` Company\` (5834) and \` company\` (1664) are not actually the same token, and even</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># if they were \` Company\` would be ignored by \`min_new_tokens\` as it excludes the prompt.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, min_new_tokens=<span class="hljs-number">1</span>, eos_token_id=<span class="hljs-number">1664</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a company

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Increasing \`min_new_tokens\` will bury the first occurrence of \` company\` generating a different sequence.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, min_new_tokens=<span class="hljs-number">2</span>, eos_token_id=<span class="hljs-number">1664</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a new company

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If no more occurrences of the \`eos_token\` happen after \`min_new_tokens\` it returns to the 20 default tokens.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, min_new_tokens=<span class="hljs-number">10</span>, eos_token_id=<span class="hljs-number">1664</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a new <span class="hljs-keyword">and</span> innovative brand of facial recognition technology that <span class="hljs-keyword">is</span> designed to <span class="hljs-built_in">help</span> you`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function ex(E){let v,M,k,w,x,h,$,V;return{c(){v=s("p"),M=a("Make sure that "),k=s("code"),w=a("do_sample=True"),x=a(" is included in the "),h=s("code"),$=a("generate"),V=a(` arguments otherwise the temperature value won\u2019t have
any effect.`)},l(J){v=n(J,"P",{});var U=o(v);M=i(U,"Make sure that "),k=n(U,"CODE",{});var F=o(k);w=i(F,"do_sample=True"),F.forEach(r),x=i(U," is included in the "),h=n(U,"CODE",{});var Z=o(h);$=i(Z,"generate"),Z.forEach(r),V=i(U,` arguments otherwise the temperature value won\u2019t have
any effect.`),U.forEach(r)},m(J,U){m(J,v,U),t(v,M),t(v,k),t(k,w),t(v,x),t(v,h),t(h,$),t(v,V)},d(J){J&&r(v)}}}function tx(E){let v,M,k,w,x;return w=new ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQW1vZGVsLmNvbmZpZy5wYWRfdG9rZW5faWQlMjAlM0QlMjBtb2RlbC5jb25maWcuZW9zX3Rva2VuX2lkJTBBbW9kZWwuZ2VuZXJhdGlvbl9jb25maWcucGFkX3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmVvc190b2tlbl9pZCUwQWlucHV0X2NvbnRleHQlMjAlM0QlMjAlMjJIdWdnaW5nJTIwRmFjZSUyMENvbXBhbnklMjBpcyUyMiUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplci5lbmNvZGUoaW5wdXRfY29udGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBdG9yY2gubWFudWFsX3NlZWQoMCklMEElMEElMjMlMjBXaXRoJTIwdGVtcGVyYXR1cmUlM0QxJTJDJTIwdGhlJTIwZGVmYXVsdCUyQyUyMHdlJTIwY29uc2lzdGVudGx5JTIwZ2V0JTIwcmFuZG9tJTIwb3V0cHV0cyUyMGR1ZSUyMHRvJTIwcmFuZG9tJTIwc2FtcGxpbmcuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0X2lkcyUzRGlucHV0X2lkcyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAlMkMlMjB0ZW1wZXJhdHVyZSUzRDElMkMlMjBkb19zYW1wbGUlM0RUcnVlKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0cHV0cyU1QjAlNUQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0X2lkcyUzRGlucHV0X2lkcyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAlMkMlMjB0ZW1wZXJhdHVyZSUzRDElMkMlMjBkb19zYW1wbGUlM0RUcnVlKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0cHV0cyU1QjAlNUQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkpJTBBJTBBJTIzJTIwSG93ZXZlciUyQyUyMHdpdGglMjB0ZW1wZXJhdHVyZSUyMGNsb3NlJTIwdG8lMjAwJTIwJTJDJTIwdGhlJTIwb3V0cHV0JTIwcmVtYWlucyUyMGludmFyaWFudC4lMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QxMCUyQyUyMHRlbXBlcmF0dXJlJTNEMC4wMDAxJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyMGV2ZW4lMjBpZiUyMHdlJTIwc2V0JTIwYSUyMGRpZmZlcmVudCUyMHNlZWQuJTBBdG9yY2gubWFudWFsX3NlZWQoNDIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0X2lkcyUzRGlucHV0X2lkcyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAlMkMlMjB0ZW1wZXJhdHVyZSUzRDAuMDAwMSUyQyUyMGRvX3NhbXBsZSUzRFRydWUpJTBBcHJpbnQodG9rZW5pemVyLmRlY29kZShvdXRwdXRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.pad_token_id = model.config.eos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>model.generation_config.pad_token_id = model.config.eos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>input_context = <span class="hljs-string">&quot;Hugging Face Company is&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer.encode(input_context, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">0</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With temperature=1, the default, we consistently get random outputs due to random sampling.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, max_new_tokens=<span class="hljs-number">10</span>, temperature=<span class="hljs-number">1</span>, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> one of these companies that <span class="hljs-keyword">is</span> going to take a

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, max_new_tokens=<span class="hljs-number">10</span>, temperature=<span class="hljs-number">1</span>, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> one of these companies, you can make a very

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># However, with temperature close to 0 , the output remains invariant.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, max_new_tokens=<span class="hljs-number">10</span>, temperature=<span class="hljs-number">0.0001</span>, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a company that has been around <span class="hljs-keyword">for</span> over <span class="hljs-number">20</span> years

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># even if we set a different seed.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>torch.manual_seed(<span class="hljs-number">42</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids=input_ids, max_new_tokens=<span class="hljs-number">10</span>, temperature=<span class="hljs-number">0.0001</span>, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a company that has been around <span class="hljs-keyword">for</span> over <span class="hljs-number">20</span> years`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function rx(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMHRoZSUyMG1vZGVsJTIwYW5kJTIwdG9rZW5pemVyJTIwZm9yJTIwaXQlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMkknbSUyMG5vdCUyMGdvaW5nJTIwdG8lMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMFRoaXMlMjBzaG93cyUyMGElMjBub3JtYWwlMjBnZW5lcmF0ZSUyMHdpdGhvdXQlMjBhbnklMjBzcGVjaWZpYyUyMHBhcmFtZXRlcnMlMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9sZW5ndGglM0QyMCklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCklMEElMEElMjMlMjBUaGlzJTIwZ2VuZXJhdGVzJTIwYSUyMHBlbmFsdHklMjBmb3IlMjByZXBlYXRlZCUyMHRva2VucyUwQXBlbmFsaXplZF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMkMlMjBtYXhfbGVuZ3RoJTNEMjAlMkMlMjByZXBldGl0aW9uX3BlbmFsdHklM0QxLjIpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShiaWFzZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing the model and tokenizer for it</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;I&#x27;m not going to&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This shows a normal generate without any specific parameters</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_length=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
I<span class="hljs-string">&#x27;m not going to lie, I&#x27;</span>m <span class="hljs-keyword">not</span> going to lie. I<span class="hljs-string">&#x27;m not going to lie

&gt;&gt;&gt; # This generates a penalty for repeated tokens
&gt;&gt;&gt; penalized_ids = model.generate(inputs[&quot;input_ids&quot;], max_length=20, repetition_penalty=1.2)
&gt;&gt;&gt; print(tokenizer.batch_decode(biased_ids, skip_special_tokens=True)[0])
I&#x27;</span>m <span class="hljs-keyword">not</span> going to lie, I was really excited about this. It<span class="hljs-string">&#x27;s a great game</span>`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function sx(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUyQyUyMHNldF9zZWVkJTBBJTBBc2V0X3NlZWQoMCklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBwcm9iYWJseSUyMG9uZSUyMG9mJTIwdGhlJTIwbW9zdCUyMGltcG9ydGFudCUyMHRoaW5ncyUyMGZvciUyMHBhcmVudHMlMjB0byUyMHRlYWNoJTIwY2hpbGRyZW4lMjBhYm91dCUyMHBhdGllbmNlJTIwYW5kJTIwYWNjZXB0YW5jZS4lMjBJbiUyMHRoaXMlMjB3YXklMkMlMjB3ZSUyMGFzJTIwYSUyMHNvY2lldHklMjBjYW4lMjBlbnN1cmUlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBzZXF1ZW5jZXMlMjB3aXRob3V0JTIwdG9wX3AlMjBzYW1wbGluZyUwQSUyMyUyMFdlJTIwc2VlJTIwdGhhdCUyMHRoZSUyMGFuc3dlciUyMHRlbmRzJTIwdG8lMjBoYXZlJTIwYSUyMGxvdCUyMG9mJTIwcmVwZWF0ZWQlMjB0b2tlbnMlMjBhbmQlMjBwaHJhc2VzJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X2xlbmd0aCUzRDU1KSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0cHV0cyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQpJTBBJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBzZXF1ZW5jZXMlMjB3aXRoJTIwdG9wX3AlMjBzYW1wbGluZyUzQSUyMHNldCUyMCU2MGRvX3NhbXBsZSUzRFRydWUlNjAlMjB0byUyMHVzZSUyMHRvcF9wJTIwc2FtcGxpbmclMjB3aXRoJTIwJTYwdG9wX3AlNjAlMjBhcnVnbWVudCUwQSUyMyUyMFdlJTIwYWxyZWFkeSUyMHNlZSUyMHRoYXQlMjB0aGUlMjBhbnN3ZXIlMjBoYXMlMjBsZXNzJTIwcmVwZXRpdGl2ZSUyMHRva2VucyUyMGFuZCUyMGlzJTIwbW9yZSUyMGRpdmVyc2UlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbGVuZ3RoJTNENTUlMkMlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTIwdG9wX3AlM0QwLjI1KSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0cHV0cyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQpJTBBJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBzZXF1ZW5jZXMlMjB3aXRoJTIwdG9wX3AlMjBzYW1wbGluZyUyMHdpdGglMjBhJTIwbGFyZ2VyJTIwdG9wX3AlMjB2YWx1ZSUwQSUyMyUyMFdlJTIwc2VlJTIwdGhhdCUyMGFzJTIwd2UlMjBpbmNyZWFzZSUyMHRoZSUyMHRvcF9wJTIwdmFsdWUlMkMlMjBsZXNzJTIwcHJvYmFibGUlMjB0b2tlbnMlMjBhbHNvJTIwZ2V0JTIwc2VsZWN0ZWQlMjBkdXJpbmclMjB0ZXh0JTIwZ2VuZXJhdGlvbiUyQyUyMG1ha2luZyUyMHRoZSUyMGFuc3dlciUyMG1vcmUlMjBkaXZlcnNlJTBBJTIzJTIwUHJvJTIwVGlwJTNBJTIwSW4lMjBwcmFjdGljZSUyQyUyMHdlJTIwdGVuZCUyMHRvJTIwdXNlJTIwdG9wX3AlMjB2YWx1ZXMlMjBiZXR3ZWVuJTIwMC45JTIwYW5kJTIwMS4wISUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMG1heF9sZW5ndGglM0Q1NSUyQyUyMGRvX3NhbXBsZSUzRFRydWUlMkMlMjB0b3BfcCUzRDAuOTUpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCklMEElMEE=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM, set_seed

<span class="hljs-meta">&gt;&gt;&gt; </span>set_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;It is probably one of the most important things for parents to teach children about patience and acceptance. In this way, we as a society can ensure&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate sequences without top_p sampling</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We see that the answer tends to have a lot of repeated tokens and phrases</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, max_length=<span class="hljs-number">55</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
<span class="hljs-string">&#x27;It is probably one of the most important things for parents to teach children about patience and acceptance. In this way, we as a society can ensure that our children are not taught to be impatient or to be afraid of the future.

first step is to teach them&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate sequences with top_p sampling: set \`do_sample=True\` to use top_p sampling with \`top_p\` arugment</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We already see that the answer has less repetitive tokens and is more diverse</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, max_length=<span class="hljs-number">55</span>, do_sample=<span class="hljs-literal">True</span>, top_p=<span class="hljs-number">0.25</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
<span class="hljs-string">&#x27;It is probably one of the most important things for parents to teach children about patience and acceptance. In this way, we as a society can ensure that children learn to be more accepting of others and to be more tolerant of others.

an also teach children to be&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate sequences with top_p sampling with a larger top_p value</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We see that as we increase the top_p value, less probable tokens also get selected during text generation, making the answer more diverse</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pro Tip: In practice, we tend to use top_p values between 0.9 and 1.0!</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, max_length=<span class="hljs-number">55</span>, do_sample=<span class="hljs-literal">True</span>, top_p=<span class="hljs-number">0.95</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
<span class="hljs-string">&#x27;It is probably one of the most important things for parents to teach children about patience and acceptance. In this way, we as a society can ensure we have the best learning environment, so that we can teach to learn and not just take advantage of the environment.

</span>`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function nx(E){let v,M,k,w;return{c(){v=s("p"),M=a(`Use n-gram penalties with care. For instance, penalizing 2-grams (bigrams) in an article about the city of New York
might lead to undesirable outcomes where the city\u2019s name appears only once in the entire text.
`),k=s("a"),w=a("Reference"),this.h()},l(x){v=n(x,"P",{});var h=o(v);M=i(h,`Use n-gram penalties with care. For instance, penalizing 2-grams (bigrams) in an article about the city of New York
might lead to undesirable outcomes where the city\u2019s name appears only once in the entire text.
`),k=n(h,"A",{href:!0,rel:!0});var $=o(k);w=i($,"Reference"),$.forEach(r),h.forEach(r),this.h()},h(){d(k,"href","https://huggingface.co/blog/how-to-generate"),d(k,"rel","nofollow")},m(x,h){m(x,v,h),t(v,M),t(v,k),t(k,w)},d(x){x&&r(v)}}}function ox(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVDJUb2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwR1BUMlRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIySSUyMGVuam95JTIwd2F0Y2hpbmclMjBmb290YmFsbCUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbGVuZ3RoJTNENTApJTBBcHJpbnQodG9rZW5pemVyLmRlY29kZShvdXRwdXQlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyME5vdyUyMGxldCdzJTIwYWRkJTIwbmdyYW0lMjBzaXplJTIwdXNpbmclMjAlM0Nub19yZXBlYXRfbmdyYW1fc2l6ZSUzRSUyMGluJTIwbW9kZWwuZ2VuZXJhdGUuJTIwVGhpcyUyMHNob3VsZCUyMHN0b3AlMjB0aGUlMjByZXBldGl0aW9ucyUyMGluJTIwdGhlJTIwb3V0cHV0LiUwQW91dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X2xlbmd0aCUzRDUwJTJDJTIwbm9fcmVwZWF0X25ncmFtX3NpemUlM0QyKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0cHV0JTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPT2Tokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;I enjoy watching football&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>output = model.generate(**inputs, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(output[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
<span class="hljs-string">&quot;I enjoy playing football on the weekends, but I&#x27;m not a big fan of the idea of playing in the middle of the night. I&#x27;m not a big fan of the idea of playing in the middle of the night. I&#x27;m not a big&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Now let&#x27;s add ngram size using &lt;no_repeat_ngram_size&gt; in model.generate. This should stop the repetitions in the output.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output = model.generate(**inputs, max_length=<span class="hljs-number">50</span>, no_repeat_ngram_size=<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(output[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
I enjoy playing football on the weekends, but I<span class="hljs-string">&#x27;m not a big fan of the idea of playing in the middle of a game. I think it&#x27;</span>s a bit of an overreaction to the fact that we<span class="hljs-string">&#x27;re playing a team that&#x27;</span>s playing<span class="hljs-string">&quot;</span>`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function ax(E){let v,M,k,w,x,h,$,V,J,U,F,Z,H,ve,W,Q,Te;return{c(){v=s("p"),M=a("In order to get the token ids of the sequences that you want to bias, make sure to set "),k=s("code"),w=a("add_prefix_space=True"),x=a(` when
initializing the tokenizer, and use `),h=s("code"),$=a("tokenizer(bad_words, add_special_tokens=False).input_ids"),V=a(`. The
`),J=s("code"),U=a("add_prefix_space"),F=a(` argument is only supported for some slow tokenizers, as fast tokenizers\u2019 prefixing behaviours
come from `),Z=s("code"),H=a("pre tokenizers"),ve=a(". Read more "),W=s("a"),Q=a("here"),Te=a("."),this.h()},l(X){v=n(X,"P",{});var j=o(v);M=i(j,"In order to get the token ids of the sequences that you want to bias, make sure to set "),k=n(j,"CODE",{});var kt=o(k);w=i(kt,"add_prefix_space=True"),kt.forEach(r),x=i(j,` when
initializing the tokenizer, and use `),h=n(j,"CODE",{});var $t=o(h);$=i($t,"tokenizer(bad_words, add_special_tokens=False).input_ids"),$t.forEach(r),V=i(j,`. The
`),J=n(j,"CODE",{});var me=o(J);U=i(me,"add_prefix_space"),me.forEach(r),F=i(j,` argument is only supported for some slow tokenizers, as fast tokenizers\u2019 prefixing behaviours
come from `),Z=n(j,"CODE",{});var Mt=o(Z);H=i(Mt,"pre tokenizers"),Mt.forEach(r),ve=i(j,". Read more "),W=n(j,"A",{href:!0,rel:!0});var xt=o(W);Q=i(xt,"here"),xt.forEach(r),Te=i(j,"."),j.forEach(r),this.h()},h(){d(W,"href","https://huggingface.co/docs/tokenizers/api/pre-tokenizers"),d(W,"rel","nofollow")},m(X,j){m(X,v,j),t(v,M),t(v,k),t(k,w),t(v,x),t(v,h),t(h,$),t(v,V),t(v,J),t(J,U),t(v,F),t(v,Z),t(Z,H),t(v,ve),t(v,W),t(W,Q),t(v,Te)},d(X){X&&r(v)}}}function ix(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyVGhlJTIwZnVsbCUyMG5hbWUlMjBvZiUyMERvbmFsZCUyMGlzJTIwRG9uYWxkJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9uZXdfdG9rZW5zJTNENCklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCklMEElMEElMjMlMjBOb3clMjBsZXQncyUyMGNvbnRyb2wlMjBnZW5lcmF0aW9uJTIwdGhyb3VnaCUyMGElMjBiaWFzLiUyMFBsZWFzZSUyMG5vdGUlMjB0aGF0JTIwdGhlJTIwdG9rZW5pemVyJTIwaXMlMjBpbml0aWFsaXplZCUyMGRpZmZlcmVudGx5ISUwQXRva2VuaXplcl93aXRoX3ByZWZpeF9zcGFjZSUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIlMkMlMjBhZGRfcHJlZml4X3NwYWNlJTNEVHJ1ZSklMEElMEElMEFkZWYlMjBnZXRfdG9rZW5zX2FzX3R1cGxlKHdvcmQpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwdHVwbGUodG9rZW5pemVyX3dpdGhfcHJlZml4X3NwYWNlKCU1QndvcmQlNUQlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSkuaW5wdXRfaWRzJTVCMCU1RCklMEElMEElMEElMjMlMjBJZiUyMHdlJTIwYWRkJTIwYSUyMG5lZ2F0aXZlJTIwYmlhcyUyMHdpdGhvdXQlMjBiZWFtJTIwc2VhcmNoJTJDJTIwaXQlMjBtYXklMjBiZWNvbWUlMjAlMjJzdHVjayUyMiUyMGluJTIwYSUyMHByZWZpeCUyMHdpdGhvdXQlMjBnb29kJTIwY29udGludWF0aW9ucyUwQXNlcXVlbmNlX2JpYXMlMjAlM0QlMjAlN0JnZXRfdG9rZW5zX2FzX3R1cGxlKCUyMlRydW1wJTIyKSUzQSUyMC0xMC4wJTdEJTBBYmlhc2VkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9uZXdfdG9rZW5zJTNENCUyQyUyMHNlcXVlbmNlX2JpYXMlM0RzZXF1ZW5jZV9iaWFzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoYmlhc2VkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQpJTBBJTBBYmlhc2VkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9uZXdfdG9rZW5zJTNENCUyQyUyMG51bV9iZWFtcyUzRDQlMkMlMjBzZXF1ZW5jZV9iaWFzJTNEc2VxdWVuY2VfYmlhcyklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGJpYXNlZF9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGFkZCUyMGElMjBwb3NpdGl2ZSUyMGJpYXMlMjB0byUyMG51ZGdlJTIwdGhlJTIwbW9kZWwlMjB0b3dhcmRzJTIwc3BlY2lmaWMlMjB0b2tlbnMlMjBvciUyMGNvbnRpbnVhdGlvbnMlMEFzZXF1ZW5jZV9iaWFzJTIwJTNEJTIwJTdCZ2V0X3Rva2Vuc19hc190dXBsZSglMjJEb25hbGQlMjBEdWNrJTIyKSUzQSUyMDEwLjAlN0QlMEFiaWFzZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTIwbWF4X25ld190b2tlbnMlM0Q0JTJDJTIwbnVtX2JlYW1zJTNENCUyQyUyMHNlcXVlbmNlX2JpYXMlM0RzZXF1ZW5jZV9iaWFzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoYmlhc2VkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;The full name of Donald is Donald&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald J. Trump Jr

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Now let&#x27;s control generation through a bias. Please note that the tokenizer is initialized differently!</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_with_prefix_space = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>, add_prefix_space=<span class="hljs-literal">True</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">get_tokens_as_tuple</span>(<span class="hljs-params">word</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> <span class="hljs-built_in">tuple</span>(tokenizer_with_prefix_space([word], add_special_tokens=<span class="hljs-literal">False</span>).input_ids[<span class="hljs-number">0</span>])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If we add a negative bias without beam search, it may become &quot;stuck&quot; in a prefix without good continuations</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_bias = {get_tokens_as_tuple(<span class="hljs-string">&quot;Trump&quot;</span>): -<span class="hljs-number">10.0</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>biased_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, sequence_bias=sequence_bias)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald J. Donald,

<span class="hljs-meta">&gt;&gt;&gt; </span>biased_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, num_beams=<span class="hljs-number">4</span>, sequence_bias=sequence_bias)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald Rumsfeld,

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also add a positive bias to nudge the model towards specific tokens or continuations</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_bias = {get_tokens_as_tuple(<span class="hljs-string">&quot;Donald Duck&quot;</span>): <span class="hljs-number">10.0</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>biased_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, num_beams=<span class="hljs-number">4</span>, sequence_bias=sequence_bias)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald Duck.`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function cx(E){let v,M,k,w,x,h,$,V,J,U,F,Z,H,ve,W,Q,Te;return{c(){v=s("p"),M=a(`In order to get the token ids of the words that should not appear in the generated text, make sure to set
`),k=s("code"),w=a("add_prefix_space=True"),x=a(" when initializing the tokenizer, and use "),h=s("code"),$=a("tokenizer(bad_words, add_special_tokens=False).input_ids"),V=a(". The "),J=s("code"),U=a("add_prefix_space"),F=a(` argument is only supported for some slow tokenizers,
as fast tokenizers\u2019 prefixing behaviours come from `),Z=s("code"),H=a("pre tokenizers"),ve=a(`. Read more
`),W=s("a"),Q=a("here"),Te=a("."),this.h()},l(X){v=n(X,"P",{});var j=o(v);M=i(j,`In order to get the token ids of the words that should not appear in the generated text, make sure to set
`),k=n(j,"CODE",{});var kt=o(k);w=i(kt,"add_prefix_space=True"),kt.forEach(r),x=i(j," when initializing the tokenizer, and use "),h=n(j,"CODE",{});var $t=o(h);$=i($t,"tokenizer(bad_words, add_special_tokens=False).input_ids"),$t.forEach(r),V=i(j,". The "),J=n(j,"CODE",{});var me=o(J);U=i(me,"add_prefix_space"),me.forEach(r),F=i(j,` argument is only supported for some slow tokenizers,
as fast tokenizers\u2019 prefixing behaviours come from `),Z=n(j,"CODE",{});var Mt=o(Z);H=i(Mt,"pre tokenizers"),Mt.forEach(r),ve=i(j,`. Read more
`),W=n(j,"A",{href:!0,rel:!0});var xt=o(W);Q=i(xt,"here"),xt.forEach(r),Te=i(j,"."),j.forEach(r),this.h()},h(){d(W,"href","https://huggingface.co/docs/tokenizers/api/pre-tokenizers"),d(W,"rel","nofollow")},m(X,j){m(X,v,j),t(v,M),t(v,k),t(k,w),t(v,x),t(v,h),t(h,$),t(v,V),t(v,J),t(J,U),t(v,F),t(v,Z),t(Z,H),t(v,ve),t(v,W),t(W,Q),t(v,Te)},d(X){X&&r(v)}}}function lx(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIySW4lMjBhJTIwd29yZCUyQyUyMHRoZSUyMGNha2UlMjBpcyUyMGElMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXN1bW1hcnlfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTIwbWF4X25ld190b2tlbnMlM0Q1JTJDJTIwcGFkX3Rva2VuX2lkJTNEdG9rZW5pemVyLmVvc190b2tlbl9pZCklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCklMEElMEElMjMlMjBOb3clMjBsZXQncyUyMGNvbnRyb2wlMjBnZW5lcmF0aW9uJTIwdGFraW5nJTIwdGhlJTIwYmFkJTIwd29yZHMlMjBvdXQuJTIwUGxlYXNlJTIwbm90ZSUyMHRoYXQlMjB0aGUlMjB0b2tlbml6ZXIlMjBpcyUyMGluaXRpYWxpemVkJTIwZGlmZmVyZW50bHklMEElMEF0b2tlbml6ZXJfd2l0aF9wcmVmaXhfc3BhY2UlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyJTJDJTIwYWRkX3ByZWZpeF9zcGFjZSUzRFRydWUpJTBBJTBBJTBBZGVmJTIwZ2V0X3Rva2Vuc19hc19saXN0KHdvcmRfbGlzdCklM0ElMEElMjAlMjAlMjAlMjAlMjJDb252ZXJ0cyUyMGElMjBzZXF1ZW5jZSUyMG9mJTIwd29yZHMlMjBpbnRvJTIwYSUyMGxpc3QlMjBvZiUyMHRva2VucyUyMiUwQSUyMCUyMCUyMCUyMHRva2Vuc19saXN0JTIwJTNEJTIwJTVCJTVEJTBBJTIwJTIwJTIwJTIwZm9yJTIwd29yZCUyMGluJTIwd29yZF9saXN0LnNwbGl0KCUyMiUyMCUyMiklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0b2tlbml6ZWRfd29yZCUyMCUzRCUyMHRva2VuaXplcl93aXRoX3ByZWZpeF9zcGFjZSglNUJ3b3JkJTVEJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UpLmlucHV0X2lkcyU1QjAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0b2tlbnNfbGlzdC5hcHBlbmQodG9rZW5pemVkX3dvcmQpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwdG9rZW5zX2xpc3QlMEElMEElMEF3b3JkX2xpc3QlMjAlM0QlMjAlMjJtZXNzJTIyJTBBYmFkX3dvcmRzX2lkcyUyMCUzRCUyMGdldF90b2tlbnNfYXNfbGlzdCh3b3JkX2xpc3QlM0R3b3JkX2xpc3QpJTBBJTBBYmFkd29yZHNfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0Q1JTJDJTBBJTIwJTIwJTIwJTIwYmFkX3dvcmRzX2lkcyUzRGJhZF93b3Jkc19pZHMlMkMlMEElMjAlMjAlMjAlMjBlb3NfdG9rZW5faWQlM0R0b2tlbml6ZXJfd2l0aF9wcmVmaXhfc3BhY2UuZW9zX3Rva2VuX2lkJTJDJTBBKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoYmFkd29yZHNfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCklMEElMEFiYWR3b3Jkc19pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDQlMkMlMjBudW1fYmVhbXMlM0Q1JTJDJTIwYmFkX3dvcmRzX2lkcyUzRGJhZF93b3Jkc19pZHMpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShiaWFzZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;In a word, the cake is a&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">5</span>, pad_token_id=tokenizer.eos_token_id)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
In a word, the cake <span class="hljs-keyword">is</span> a bit of a mess.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Now let&#x27;s control generation taking the bad words out. Please note that the tokenizer is initialized differently</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_with_prefix_space = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>, add_prefix_space=<span class="hljs-literal">True</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">get_tokens_as_list</span>(<span class="hljs-params">word_list</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Converts a sequence of words into a list of tokens&quot;</span>
<span class="hljs-meta">... </span>    tokens_list = []
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> word <span class="hljs-keyword">in</span> word_list.split(<span class="hljs-string">&quot; &quot;</span>):
<span class="hljs-meta">... </span>        tokenized_word = tokenizer_with_prefix_space([word], add_special_tokens=<span class="hljs-literal">False</span>).input_ids[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>        tokens_list.append(tokenized_word)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> tokens_list


<span class="hljs-meta">&gt;&gt;&gt; </span>word_list = <span class="hljs-string">&quot;mess&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>bad_words_ids = get_tokens_as_list(word_list=word_list)

<span class="hljs-meta">&gt;&gt;&gt; </span>badwords_ids = model.generate(
<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;input_ids&quot;</span>],
<span class="hljs-meta">... </span>    max_new_tokens=<span class="hljs-number">5</span>,
<span class="hljs-meta">... </span>    bad_words_ids=bad_words_ids,
<span class="hljs-meta">... </span>    eos_token_id=tokenizer_with_prefix_space.eos_token_id,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(badwords_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
In a word, the cake <span class="hljs-keyword">is</span> a bit of a surprise.

<span class="hljs-meta">&gt;&gt;&gt; </span>badwords_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, num_beams=<span class="hljs-number">5</span>, bad_words_ids=bad_words_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
In a word, the cake <span class="hljs-keyword">is</span> a great way to start`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function dx(E){let v,M;return v=new ye({props:{code:"Y29tcGxldGVkJTIwJTNEJTIwRmFsc2UlMEF3aGlsZSUyMG5vdCUyMGNvbXBsZXRlZCUzQSUwQSUyMCUyMCUyMCUyMF8lMkMlMjBjb21wbGV0ZWQlMjAlM0QlMjBjb25zdHJhaW50LnVwZGF0ZShjb25zdHJhaW50LmFkdmFuY2UoKSk=",highlighted:`completed = <span class="hljs-literal">False</span>
<span class="hljs-keyword">while</span> <span class="hljs-keyword">not</span> completed:
    _, completed = constraint.update(constraint.advance())`}}),{c(){g(v.$$.fragment)},l(k){f(v.$$.fragment,k)},m(k,w){u(v,k,w),M=!0},p:wt,i(k){M||(_(v.$$.fragment,k),M=!0)},o(k){b(v.$$.fragment,k),M=!1},d(k){y(v,k)}}}function px(E){let v,M;return{c(){v=s("p"),M=a("The API for the streamer classes is still under development and may change in the future.")},l(k){v=n(k,"P",{});var w=o(v);M=i(w,"The API for the streamer classes is still under development and may change in the future."),w.forEach(r)},m(k,w){m(k,v,w),t(v,M)},d(k){k&&r(v)}}}function mx(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUyQyUyMFRleHRTdHJlYW1lciUwQSUwQXRvayUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2soJTVCJTIyQW4lMjBpbmNyZWFzaW5nJTIwc2VxdWVuY2UlM0ElMjBvbmUlMkMlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXN0cmVhbWVyJTIwJTNEJTIwVGV4dFN0cmVhbWVyKHRvayklMEElMEElMjMlMjBEZXNwaXRlJTIwcmV0dXJuaW5nJTIwdGhlJTIwdXN1YWwlMjBvdXRwdXQlMkMlMjB0aGUlMjBzdHJlYW1lciUyMHdpbGwlMjBhbHNvJTIwcHJpbnQlMjB0aGUlMjBnZW5lcmF0ZWQlMjB0ZXh0JTIwdG8lMjBzdGRvdXQuJTBBXyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwc3RyZWFtZXIlM0RzdHJlYW1lciUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMjAp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, TextStreamer

<span class="hljs-meta">&gt;&gt;&gt; </span>tok = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tok([<span class="hljs-string">&quot;An increasing sequence: one,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>streamer = TextStreamer(tok)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Despite returning the usual output, the streamer will also print the generated text to stdout.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>_ = model.generate(**inputs, streamer=streamer, max_new_tokens=<span class="hljs-number">20</span>)
An increasing sequence: one, two, three, four, five, six, seven, eight, nine, ten, eleven,`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function hx(E){let v,M;return{c(){v=s("p"),M=a("The API for the streamer classes is still under development and may change in the future.")},l(k){v=n(k,"P",{});var w=o(v);M=i(w,"The API for the streamer classes is still under development and may change in the future."),w.forEach(r)},m(k,w){m(k,v,w),t(v,M)},d(k){k&&r(v)}}}function gx(E){let v,M,k,w,x;return w=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUyQyUyMFRleHRJdGVyYXRvclN0cmVhbWVyJTBBZnJvbSUyMHRocmVhZGluZyUyMGltcG9ydCUyMFRocmVhZCUwQSUwQXRvayUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2soJTVCJTIyQW4lMjBpbmNyZWFzaW5nJTIwc2VxdWVuY2UlM0ElMjBvbmUlMkMlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXN0cmVhbWVyJTIwJTNEJTIwVGV4dEl0ZXJhdG9yU3RyZWFtZXIodG9rKSUwQSUwQSUyMyUyMFJ1biUyMHRoZSUyMGdlbmVyYXRpb24lMjBpbiUyMGElMjBzZXBhcmF0ZSUyMHRocmVhZCUyQyUyMHNvJTIwdGhhdCUyMHdlJTIwY2FuJTIwZmV0Y2glMjB0aGUlMjBnZW5lcmF0ZWQlMjB0ZXh0JTIwaW4lMjBhJTIwbm9uLWJsb2NraW5nJTIwd2F5LiUwQWdlbmVyYXRpb25fa3dhcmdzJTIwJTNEJTIwZGljdChpbnB1dHMlMkMlMjBzdHJlYW1lciUzRHN0cmVhbWVyJTJDJTIwbWF4X25ld190b2tlbnMlM0QyMCklMEF0aHJlYWQlMjAlM0QlMjBUaHJlYWQodGFyZ2V0JTNEbW9kZWwuZ2VuZXJhdGUlMkMlMjBrd2FyZ3MlM0RnZW5lcmF0aW9uX2t3YXJncyklMEF0aHJlYWQuc3RhcnQoKSUwQWdlbmVyYXRlZF90ZXh0JTIwJTNEJTIwJTIyJTIyJTBBZm9yJTIwbmV3X3RleHQlMjBpbiUyMHN0cmVhbWVyJTNBJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdGVkX3RleHQlMjAlMkIlM0QlMjBuZXdfdGV4dCUwQWdlbmVyYXRlZF90ZXh0",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> threading <span class="hljs-keyword">import</span> Thread

<span class="hljs-meta">&gt;&gt;&gt; </span>tok = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tok([<span class="hljs-string">&quot;An increasing sequence: one,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>streamer = TextIteratorStreamer(tok)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Run the generation in a separate thread, so that we can fetch the generated text in a non-blocking way.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generation_kwargs = <span class="hljs-built_in">dict</span>(inputs, streamer=streamer, max_new_tokens=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>thread = Thread(target=model.generate, kwargs=generation_kwargs)
<span class="hljs-meta">&gt;&gt;&gt; </span>thread.start()
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> new_text <span class="hljs-keyword">in</span> streamer:
<span class="hljs-meta">... </span>    generated_text += new_text
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text
<span class="hljs-string">&#x27;An increasing sequence: one, two, three, four, five, six, seven, eight, nine, ten, eleven,&#x27;</span>`}}),{c(){v=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){v=n(h,"P",{});var $=o(v);M=i($,"Examples:"),$.forEach(r),k=l(h),f(w.$$.fragment,h)},m(h,$){m(h,v,$),t(v,M),m(h,k,$),u(w,h,$),x=!0},p:wt,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&r(v),h&&r(k),y(w,h)}}}function fx(E){let v,M,k,w,x,h,$,V,J,U,F,Z,H,ve,W,Q,Te,X,j,kt,$t,me,Mt,xt,da,Bg,Zg,pa,Sg,Vg,ma,Pg,Dg,ha,qg,Gg,nm,ga,Xg,om,jt,Kt,El,ls,Rg,Fl,Cg,am,he,Ng,fa,Ag,Og,ua,Hg,Qg,_a,Yg,Kg,im,ba,ef,cm,ds,lm,ct,tf,Ll,rf,sf,ya,nf,of,dm,ge,va,zl,af,cf,lf,Ta,Jl,df,pf,mf,wa,Ul,hf,gf,ff,ka,Il,uf,_f,pm,S,bf,Wl,yf,vf,Bl,Tf,wf,Zl,kf,$f,Sl,Mf,xf,Vl,jf,Ef,Pl,Ff,Lf,mm,Y,zf,Dl,Jf,Uf,ql,If,Wf,Gl,Bf,Zf,Xl,Sf,Vf,hm,K,Pf,Rl,Df,qf,Cl,Gf,Xf,Nl,Rf,Cf,Al,Nf,Af,gm,ps,fm,er,Of,Ol,Hf,Qf,um,ee,Yf,Hl,Kf,eu,Ql,tu,ru,Yl,su,nu,Kl,ou,au,_m,$a,iu,bm,Et,tr,ed,ms,cu,td,lu,ym,Ft,hs,du,rd,pu,vm,Lt,gs,mu,sd,hu,Tm,we,fs,gu,nd,fu,uu,rr,us,_u,od,bu,wm,zt,sr,ad,_s,yu,id,vu,km,Jt,bs,Tu,cd,wu,$m,Ut,ys,ku,ld,$u,Mm,ke,vs,Mu,dd,xu,ju,nr,Ts,Eu,pd,Fu,xm,It,or,md,ws,Lu,hd,zu,jm,Wt,ks,Ju,gd,Uu,Em,Bt,$s,Iu,fd,Wu,Fm,Zt,ar,ud,Ms,Bu,_d,Zu,Lm,St,xs,Su,bd,Vu,zm,Vt,js,Pu,yd,Du,Jm,Pt,ir,vd,Es,qu,Td,Gu,Um,cr,Xu,Ma,Ru,Cu,Im,$e,Fs,Nu,wd,Au,Ou,xa,Ls,Wm,Me,zs,Hu,P,Qu,ja,Yu,Ku,Ea,e_,t_,kd,r_,s_,$d,Md,n_,o_,Fa,a_,i_,La,c_,l_,d_,za,Js,Bm,xe,Us,p_,xd,m_,h_,Ja,Is,Zm,je,Ws,g_,Ua,Ia,f_,u_,__,Wa,Bs,Sm,oe,Zs,b_,fe,Ba,y_,v_,jd,T_,w_,Ed,k_,$_,Fd,M_,x_,j_,lr,E_,Za,Ss,Vm,R,Vs,F_,Sa,Va,L_,z_,J_,dr,U_,pr,I_,Pa,Ps,Pm,ae,Ds,W_,mr,Da,B_,Z_,qs,S_,V_,P_,hr,D_,qa,Gs,Dm,ie,Xs,q_,Ga,Xa,G_,X_,R_,gr,C_,Ra,Rs,qm,Ee,Cs,N_,Ca,Na,A_,O_,H_,Aa,Ns,Gm,Fe,As,Q_,fr,Oa,Y_,K_,Os,eb,tb,rb,Ha,Hs,Xm,C,Qs,sb,Dt,nb,Qa,ob,ab,Ys,ib,cb,lb,ur,db,_r,pb,Ya,Ks,Rm,N,en,mb,Ka,ei,hb,gb,fb,br,ub,yr,_b,ti,tn,Cm,A,rn,bb,ri,si,yb,vb,Tb,vr,wb,Tr,kb,ni,sn,Nm,Le,nn,$b,wr,oi,Mb,xb,on,jb,Eb,Fb,ai,an,Am,ze,cn,Lb,lt,ii,zb,Jb,ci,Ub,Ib,ln,Wb,Bb,Zb,li,dn,Om,Je,pn,Sb,di,pi,Vb,Pb,Db,mi,mn,Hm,Ue,hn,qb,kr,hi,Gb,Xb,Ld,Rb,Cb,Nb,gi,gn,Qm,Ie,fn,Ab,dt,fi,Ob,Hb,zd,Qb,Yb,Jd,Kb,ey,ty,ui,un,Ym,We,_n,ry,Ud,sy,ny,$r,bn,oy,Id,ay,Km,Be,yn,iy,ce,cy,_i,ly,dy,Wd,py,my,Bd,Zd,hy,gy,bi,fy,uy,_y,yi,vn,eh,Ze,Tn,by,Sd,yy,vy,Mr,wn,Ty,Vd,wy,th,Se,kn,ky,vi,Ti,$y,My,xy,wi,$n,rh,Ve,Mn,jy,ki,$i,Ey,Fy,Ly,Mi,xn,sh,Pe,jn,zy,xi,ji,Jy,Uy,Iy,Ei,En,nh,De,Fn,Wy,Fi,Li,By,Zy,Sy,zi,Ln,oh,qe,zn,Vy,Ji,Ui,Py,Dy,qy,Ii,Jn,ah,Ge,Un,Gy,xr,Wi,Xy,Ry,In,Cy,Ny,Ay,Bi,Wn,ih,Xe,Bn,Oy,Zi,Si,Hy,Qy,Yy,Vi,Zn,ch,Re,Sn,Ky,Pi,Di,ev,tv,rv,qi,Vn,lh,Ce,Pn,sv,jr,Gi,nv,ov,Pd,av,iv,cv,Xi,Dn,dh,Ne,qn,lv,Dd,dv,pv,Er,Gn,mv,qd,hv,ph,Ae,Xn,gv,D,fv,Ri,uv,_v,Ci,bv,yv,Gd,vv,Tv,Xd,Rd,wv,kv,Ni,$v,Mv,Ai,xv,jv,Ev,Oi,Rn,mh,Oe,Cn,Fv,Cd,Lv,zv,Fr,Nn,Jv,Nd,Uv,hh,He,An,Iv,Hi,Qi,Wv,Bv,Zv,Yi,On,gh,Qe,Hn,Sv,Ki,ec,Vv,Pv,Dv,tc,Qn,fh,Ye,Yn,qv,rc,sc,Gv,Xv,Rv,nc,Kn,uh,Ke,eo,Cv,oc,ac,Nv,Av,Ov,ic,to,_h,et,ro,Hv,Lr,cc,Qv,Yv,Ad,Kv,eT,tT,lc,so,bh,tt,no,rT,dc,pc,sT,nT,oT,mc,oo,yh,qt,zr,Od,ao,aT,Hd,iT,vh,Jr,cT,hc,lT,dT,Th,rt,io,pT,Qd,mT,hT,gc,co,wh,Gt,lo,gT,fc,po,kh,st,mo,fT,ho,uT,Yd,_T,bT,yT,uc,go,$h,nt,fo,vT,uo,TT,Kd,wT,kT,$T,_c,_o,Mh,Xt,Ur,ep,bo,MT,tp,xT,xh,Ir,jT,bc,ET,FT,jh,L,yo,LT,rp,zT,JT,sp,UT,IT,Wr,WT,np,BT,ZT,Br,vo,ST,op,VT,PT,Zr,To,DT,ap,qT,GT,Sr,wo,XT,ip,RT,CT,Vr,ko,NT,$o,AT,cp,OT,HT,QT,Pr,Mo,YT,lp,KT,e2,Dr,xo,t2,dp,r2,s2,pt,jo,n2,Eo,o2,pp,a2,i2,c2,mp,l2,Eh,Rt,Fo,d2,yc,vc,p2,m2,Fh,Ct,Lo,h2,zo,g2,Tc,f2,u2,Lh,le,Jo,_2,hp,b2,y2,G,Uo,v2,gp,T2,w2,Nt,k2,fp,$2,M2,up,x2,j2,E2,_p,bp,F2,L2,ot,z2,yp,J2,U2,vp,I2,W2,Tp,B2,Z2,S2,wp,V2,P2,qr,Io,D2,kp,q2,zh,At,Gr,$p,Wo,G2,Mp,X2,Jh,de,Bo,R2,Ot,C2,wc,N2,A2,kc,O2,H2,Q2,$c,Zo,Y2,Mc,So,Uh,q,Vo,K2,xc,jc,ew,tw,rw,Po,sw,Do,nw,ow,aw,Ec,iw,qo,cw,lw,Fc,Go,dw,Lc,Xo,Ih,pe,Ro,pw,zc,Jc,mw,hw,gw,Uc,Co,fw,Ic,No,Wh,Ht,Xr,xp,Ao,uw,jp,_w,Bh,at,Oo,bw,Ep,yw,vw,Wc,Tw,Ho,ww,Zh,it,Qo,kw,Fp,$w,Mw,Bc,xw,Yo,jw,Sh,Qt,Rr,Lp,Ko,Ew,zp,Fw,Vh,B,ea,Lw,Jp,zw,Jw,Cr,Uw,Nr,Iw,Ar,ta,Ww,Up,Bw,Zw,Or,ra,Sw,Ip,Vw,Pw,Hr,sa,Dw,Wp,qw,Ph,O,na,Gw,Bp,Xw,Rw,Qr,Cw,Yr,Nw,Kr,oa,Aw,Zp,Ow,Dh;return h=new be({}),ls=new be({}),ds=new ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVDJUb2tlbml6ZXIlMkMlMjBHUFQyTE1IZWFkTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBHUFQyVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUMkxNSGVhZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIwYW5kJTIwJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFnZW5lcmF0aW9uX291dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwcmV0dXJuX2RpY3RfaW5fZ2VuZXJhdGUlM0RUcnVlJTJDJTIwb3V0cHV0X3Njb3JlcyUzRFRydWUp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPT2Tokenizer, GPT2LMHeadModel

tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
model = GPT2LMHeadModel.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute and &quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generation_output = model.generate(**inputs, return_dict_in_generate=<span class="hljs-literal">True</span>, output_scores=<span class="hljs-literal">True</span>)`}}),ps=new ye({props:{code:"Z2VuZXJhdGlvbl9vdXRwdXQlNUIlM0EyJTVE",highlighted:'generation_output[:<span class="hljs-number">2</span>]'}}),ms=new be({}),hs=new T({props:{name:"class transformers.generation.GreedySearchDecoderOnlyOutput",anchor:"transformers.generation.GreedySearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L85"}}),gs=new T({props:{name:"class transformers.generation.GreedySearchEncoderDecoderOutput",anchor:"transformers.generation.GreedySearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</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>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L181"}}),fs=new T({props:{name:"class transformers.generation.FlaxGreedySearchOutput",anchor:"transformers.generation.FlaxGreedySearchOutput",parameters:[{name:"sequences",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxGreedySearchOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L55"}}),us=new T({props:{name:"replace",anchor:"transformers.generation.FlaxGreedySearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),_s=new be({}),bs=new T({props:{name:"class transformers.generation.SampleDecoderOnlyOutput",anchor:"transformers.generation.SampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L223"}}),ys=new T({props:{name:"class transformers.generation.SampleEncoderDecoderOutput",anchor:"transformers.generation.SampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape
<code>(batch_size*num_return_sequences, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L252"}}),vs=new T({props:{name:"class transformers.generation.FlaxSampleOutput",anchor:"transformers.generation.FlaxSampleOutput",parameters:[{name:"sequences",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxSampleOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L69"}}),Ts=new T({props:{name:"replace",anchor:"transformers.generation.FlaxSampleOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),ws=new be({}),ks=new T({props:{name:"class transformers.generation.BeamSearchDecoderOnlyOutput",anchor:"transformers.generation.BeamSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L295"}}),$s=new T({props:{name:"class transformers.generation.BeamSearchEncoderDecoderOutput",anchor:"transformers.generation.BeamSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_beams*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L330"}}),Ms=new be({}),xs=new T({props:{name:"class transformers.generation.BeamSampleDecoderOnlyOutput",anchor:"transformers.generation.BeamSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L380"}}),js=new T({props:{name:"class transformers.generation.BeamSampleEncoderDecoderOutput",anchor:"transformers.generation.BeamSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_beams, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_beams, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L415"}}),Es=new be({}),Fs=new T({props:{name:"class transformers.LogitsProcessor",anchor:"transformers.LogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L44"}}),Ls=new T({props:{name:"__call__",anchor:"transformers.LogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L47",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),zs=new T({props:{name:"class transformers.LogitsProcessorList",anchor:"transformers.LogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L64"}}),Js=new T({props:{name:"__call__",anchor:"transformers.LogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LogitsProcessorList.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using
beam search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.LogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional kwargs that are specific to a logits processor.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L71",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Us=new T({props:{name:"class transformers.LogitsWarper",anchor:"transformers.LogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L54"}}),Is=new T({props:{name:"__call__",anchor:"transformers.LogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsWarper.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L57",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ws=new T({props:{name:"class transformers.MinLengthLogitsProcessor",anchor:"transformers.MinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.MinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L101"}}),Bs=new T({props:{name:"__call__",anchor:"transformers.MinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MinLengthLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L124",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Zs=new T({props:{name:"class transformers.MinNewTokensLengthLogitsProcessor",anchor:"transformers.MinNewTokensLengthLogitsProcessor",parameters:[{name:"prompt_length_to_skip",val:": int"},{name:"min_new_tokens",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.prompt_length_to_skip",description:`<strong>prompt_length_to_skip</strong> (<code>int</code>) &#x2014;
The input tokens length. Not a valid argument when used with <code>generate</code> as it will automatically assign the
input length.`,name:"prompt_length_to_skip"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.min_new_tokens",description:`<strong>min_new_tokens</strong> (<code>int</code>) &#x2014;
The minimum <em>new</em> tokens length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_new_tokens"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L133"}}),lr=new Tt({props:{anchor:"transformers.MinNewTokensLengthLogitsProcessor.example",$$slots:{default:[KM]},$$scope:{ctx:E}}}),Ss=new T({props:{name:"__call__",anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L202",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Vs=new T({props:{name:"class transformers.TemperatureLogitsWarper",anchor:"transformers.TemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
Strictly positive float value used to modulate the logits distribution. A value smaller than <code>1</code> decreases
randomness (and vice versa), with <code>0</code> being equivalent to shifting all probability mass to the most likely
token.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L212"}}),dr=new jl({props:{$$slots:{default:[ex]},$$scope:{ctx:E}}}),pr=new Tt({props:{anchor:"transformers.TemperatureLogitsWarper.example",$$slots:{default:[tx]},$$scope:{ctx:E}}}),Ps=new T({props:{name:"__call__",anchor:"transformers.TemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TemperatureLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L273",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ds=new T({props:{name:"class transformers.RepetitionPenaltyLogitsProcessor",anchor:"transformers.RepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L279"}}),hr=new Tt({props:{anchor:"transformers.RepetitionPenaltyLogitsProcessor.example",$$slots:{default:[rx]},$$scope:{ctx:E}}}),Gs=new T({props:{name:"__call__",anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L321",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Xs=new T({props:{name:"class transformers.TopPLogitsWarper",anchor:"transformers.TopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L361"}}),gr=new Tt({props:{anchor:"transformers.TopPLogitsWarper.example",$$slots:{default:[sx]},$$scope:{ctx:E}}}),Rs=new T({props:{name:"__call__",anchor:"transformers.TopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TopPLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L417",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Cs=new T({props:{name:"class transformers.TopKLogitsWarper",anchor:"transformers.TopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L433"}}),Ns=new T({props:{name:"__call__",anchor:"transformers.TopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TopKLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L453",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),As=new T({props:{name:"class transformers.TypicalLogitsWarper",anchor:"transformers.TypicalLogitsWarper",parameters:[{name:"mass",val:": float = 0.9"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.mass",description:`<strong>mass</strong> (<code>float</code>) &#x2014;
Value of typical_p between 0 and 1 inclusive, defaults to 0.9.`,name:"mass"},{anchor:"transformers.TypicalLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TypicalLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L462"}}),Hs=new T({props:{name:"__call__",anchor:"transformers.TypicalLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TypicalLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L487",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Qs=new T({props:{name:"class transformers.NoRepeatNGramLogitsProcessor",anchor:"transformers.NoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L715"}}),ur=new jl({props:{$$slots:{default:[nx]},$$scope:{ctx:E}}}),_r=new Tt({props:{anchor:"transformers.NoRepeatNGramLogitsProcessor.example",$$slots:{default:[ox]},$$scope:{ctx:E}}}),Ks=new T({props:{name:"__call__",anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L761",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),en=new T({props:{name:"class transformers.SequenceBiasLogitsProcessor",anchor:"transformers.SequenceBiasLogitsProcessor",parameters:[{name:"sequence_bias",val:": typing.Dict[typing.Tuple[int], float]"}],parametersDescription:[{anchor:"transformers.SequenceBiasLogitsProcessor.sequence_bias",description:`<strong>sequence_bias</strong> (<code>Dict[Tuple[int], float]</code>) &#x2014;
Dictionary that maps a sequence of tokens to its bias term. Positive biases increase the odds of the
sequence being selected, while negative biases do the opposite. If a sequence has a length of 1, its bias
will always be applied. Otherwise, the bias will only be applied if the sequence in question is about to be
completed (in the token selection step after this processor is applied).`,name:"sequence_bias"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L814"}}),br=new jl({props:{$$slots:{default:[ax]},$$scope:{ctx:E}}}),yr=new Tt({props:{anchor:"transformers.SequenceBiasLogitsProcessor.example",$$slots:{default:[ix]},$$scope:{ctx:E}}}),tn=new T({props:{name:"__call__",anchor:"transformers.SequenceBiasLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SequenceBiasLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SequenceBiasLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L885",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),rn=new T({props:{name:"class transformers.NoBadWordsLogitsProcessor",anchor:"transformers.NoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated.`,name:"bad_words_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L962"}}),vr=new jl({props:{$$slots:{default:[cx]},$$scope:{ctx:E}}}),Tr=new Tt({props:{anchor:"transformers.NoBadWordsLogitsProcessor.example",$$slots:{default:[lx]},$$scope:{ctx:E}}}),sn=new T({props:{name:"__call__",anchor:"transformers.NoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L885",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),nn=new T({props:{name:"class transformers.PrefixConstrainedLogitsProcessor",anchor:"transformers.PrefixConstrainedLogitsProcessor",parameters:[{name:"prefix_allowed_tokens_fn",val:": typing.Callable[[int, torch.Tensor], typing.List[int]]"},{name:"num_beams",val:": int"}],parametersDescription:[{anchor:"transformers.PrefixConstrainedLogitsProcessor.prefix_allowed_tokens_fn",description:`<strong>prefix_allowed_tokens_fn</strong> (<code>Callable[[int, torch.Tensor], List[int]]</code>) &#x2014;
This function constraints the beam search to allowed tokens only at each step. This function takes 2
arguments <code>inputs_ids</code> and the batch ID <code>batch_id</code>. It has to return a list with the allowed tokens for the
next generation step conditioned on the previously generated tokens <code>inputs_ids</code> and the batch ID
<code>batch_id</code>.`,name:"prefix_allowed_tokens_fn"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1059"}}),an=new T({props:{name:"__call__",anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1076",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),cn=new T({props:{name:"class transformers.HammingDiversityLogitsProcessor",anchor:"transformers.HammingDiversityLogitsProcessor",parameters:[{name:"diversity_penalty",val:": float"},{name:"num_beams",val:": int"},{name:"num_beam_groups",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.diversity_penalty",description:`<strong>diversity_penalty</strong> (<code>float</code>) &#x2014;
This value is subtracted from a beam&#x2019;s score if it generates a token same as any beam from other group at a
particular time. Note that <code>diversity_penalty</code> is only effective if <code>group beam search</code> is enabled.`,name:"diversity_penalty"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams used for group beam search. See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more
details.`,name:"num_beams"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1086"}}),dn=new T({props:{name:"__call__",anchor:"transformers.HammingDiversityLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"current_tokens",val:": LongTensor"},{name:"beam_group_idx",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using
beam search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.current_tokens",description:`<strong>current_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary, corresponding to the tokens selected by the other
beam groups in the current generation step.`,name:"current_tokens"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.beam_group_idx",description:`<strong>beam_group_idx</strong> (<code>int</code>) &#x2014;
The index of the beam group currently being processed.`,name:"beam_group_idx"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1117",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),pn=new T({props:{name:"class transformers.ForcedBOSTokenLogitsProcessor",anchor:"transformers.ForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1163"}}),mn=new T({props:{name:"__call__",anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1175",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),hn=new T({props:{name:"class transformers.ForcedEOSTokenLogitsProcessor",anchor:"transformers.ForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Optionally, use a
list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1185"}}),gn=new T({props:{name:"__call__",anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1203",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),fn=new T({props:{name:"class transformers.InfNanRemoveLogitsProcessor",anchor:"transformers.InfNanRemoveLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1214"}}),un=new T({props:{name:"__call__",anchor:"transformers.InfNanRemoveLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.InfNanRemoveLogitsProcessor.__call__.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. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.InfNanRemoveLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1220",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),_n=new T({props:{name:"class transformers.TFLogitsProcessor",anchor:"transformers.TFLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L53"}}),bn=new T({props:{name:"__call__",anchor:"transformers.TFLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.TFLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessor.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L56",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),yn=new T({props:{name:"class transformers.TFLogitsProcessorList",anchor:"transformers.TFLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L75"}}),vn=new T({props:{name:"__call__",anchor:"transformers.TFLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.TFLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessorList.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L82",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Tn=new T({props:{name:"class transformers.TFLogitsWarper",anchor:"transformers.TFLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L64"}}),wn=new T({props:{name:"__call__",anchor:"transformers.TFLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.TFLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsWarper.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsWarper.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L67",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),kn=new T({props:{name:"class transformers.TFTemperatureLogitsWarper",anchor:"transformers.TFTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TFTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L98"}}),$n=new T({props:{name:"__call__",anchor:"transformers.TFTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L113"}}),Mn=new T({props:{name:"class transformers.TFTopPLogitsWarper",anchor:"transformers.TFTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TFTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L146"}}),xn=new T({props:{name:"__call__",anchor:"transformers.TFTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L170"}}),jn=new T({props:{name:"class transformers.TFTopKLogitsWarper",anchor:"transformers.TFTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TFTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L118"}}),En=new T({props:{name:"__call__",anchor:"transformers.TFTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L138"}}),Fn=new T({props:{name:"class transformers.TFMinLengthLogitsProcessor",anchor:"transformers.TFMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.TFMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L202"}}),Ln=new T({props:{name:"__call__",anchor:"transformers.TFMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L228"}}),zn=new T({props:{name:"class transformers.TFNoBadWordsLogitsProcessor",anchor:"transformers.TFNoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated. In order to get the tokens of the words
that should not appear in the generated text, make sure to set <code>add_prefix_space=True</code> when initializing
the tokenizer, and use <code>tokenizer(bad_words, add_special_tokens=False).input_ids</code>. The <code>add_prefix_space</code>
argument is only supported for some slow tokenizers, as fast tokenizers&#x2019; prefixing behaviours come from
<code>pre tokenizers</code>. Read more <a href="https://huggingface.co/docs/tokenizers/api/pre-tokenizers" rel="nofollow">here</a>.`,name:"bad_words_ids"},{anchor:"transformers.TFNoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L288"}}),Jn=new T({props:{name:"__call__",anchor:"transformers.TFNoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L367"}}),Un=new T({props:{name:"class transformers.TFNoRepeatNGramLogitsProcessor",anchor:"transformers.TFNoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L388"}}),Wn=new T({props:{name:"__call__",anchor:"transformers.TFNoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L427"}}),Bn=new T({props:{name:"class transformers.TFRepetitionPenaltyLogitsProcessor",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L238"}}),Zn=new T({props:{name:"__call__",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L280"}}),Sn=new T({props:{name:"class transformers.TFForcedBOSTokenLogitsProcessor",anchor:"transformers.TFForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L448"}}),Vn=new T({props:{name:"__call__",anchor:"transformers.TFForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L462"}}),Pn=new T({props:{name:"class transformers.TFForcedEOSTokenLogitsProcessor",anchor:"transformers.TFForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L478"}}),Dn=new T({props:{name:"__call__",anchor:"transformers.TFForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L495"}}),qn=new T({props:{name:"class transformers.FlaxLogitsProcessor",anchor:"transformers.FlaxLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L50"}}),Gn=new T({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.FlaxLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L53",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Xn=new T({props:{name:"class transformers.FlaxLogitsProcessorList",anchor:"transformers.FlaxLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L72"}}),Rn=new T({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.FlaxLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L79",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Cn=new T({props:{name:"class transformers.FlaxLogitsWarper",anchor:"transformers.FlaxLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L61"}}),Nn=new T({props:{name:"__call__",anchor:"transformers.FlaxLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"}],parametersDescription:[{anchor:"transformers.FlaxLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</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/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.FlaxLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsWarper.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L64",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),An=new T({props:{name:"class transformers.FlaxTemperatureLogitsWarper",anchor:"transformers.FlaxTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.FlaxTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L95"}}),On=new T({props:{name:"__call__",anchor:"transformers.FlaxTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L110"}}),Hn=new T({props:{name:"class transformers.FlaxTopPLogitsWarper",anchor:"transformers.FlaxTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.FlaxTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L115"}}),Qn=new T({props:{name:"__call__",anchor:"transformers.FlaxTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L139"}}),Yn=new T({props:{name:"class transformers.FlaxTopKLogitsWarper",anchor:"transformers.FlaxTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.FlaxTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L159"}}),Kn=new T({props:{name:"__call__",anchor:"transformers.FlaxTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L179"}}),eo=new T({props:{name:"class transformers.FlaxForcedBOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L194"}}),to=new T({props:{name:"__call__",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L206"}}),ro=new T({props:{name:"class transformers.FlaxForcedEOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L216"}}),so=new T({props:{name:"__call__",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L231"}}),no=new T({props:{name:"class transformers.FlaxMinLengthLogitsProcessor",anchor:"transformers.FlaxMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.FlaxMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L241"}}),oo=new T({props:{name:"__call__",anchor:"transformers.FlaxMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L262"}}),ao=new be({}),io=new T({props:{name:"class transformers.StoppingCriteria",anchor:"transformers.StoppingCriteria",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L36"}}),co=new T({props:{name:"__call__",anchor:"transformers.StoppingCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteria.__call__.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.StoppingCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.StoppingCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L39",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),lo=new T({props:{name:"class transformers.StoppingCriteriaList",anchor:"transformers.StoppingCriteriaList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L124"}}),po=new T({props:{name:"__call__",anchor:"transformers.StoppingCriteriaList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteriaList.__call__.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.StoppingCriteriaList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.StoppingCriteriaList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L125",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),mo=new T({props:{name:"class transformers.MaxLengthCriteria",anchor:"transformers.MaxLengthCriteria",parameters:[{name:"max_length",val:": int"},{name:"max_position_embeddings",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length that the output sequence can have in number of tokens.`,name:"max_length"},{anchor:"transformers.MaxLengthCriteria.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <code>optional</code>) &#x2014;
The maximum model length, as defined by the model&#x2019;s <code>config.max_position_embeddings</code> attribute.`,name:"max_position_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L44"}}),go=new T({props:{name:"__call__",anchor:"transformers.MaxLengthCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.__call__.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.MaxLengthCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.MaxLengthCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L60",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),fo=new T({props:{name:"class transformers.MaxTimeCriteria",anchor:"transformers.MaxTimeCriteria",parameters:[{name:"max_time",val:": float"},{name:"initial_timestamp",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.max_time",description:`<strong>max_time</strong> (<code>float</code>) &#x2014;
The maximum allowed time in seconds for the generation.`,name:"max_time"},{anchor:"transformers.MaxTimeCriteria.initial_time",description:`<strong>initial_time</strong> (<code>float</code>, <em>optional</em>, defaults to <code>time.time()</code>) &#x2014;
The start of the generation allowed time.`,name:"initial_time"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L102"}}),_o=new T({props:{name:"__call__",anchor:"transformers.MaxTimeCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.__call__.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.MaxTimeCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.MaxTimeCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L119",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),bo=new be({}),yo=new T({props:{name:"class transformers.Constraint",anchor:"transformers.Constraint",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L5"}}),Wr=new Tt({props:{anchor:"transformers.Constraint.example",$$slots:{default:[dx]},$$scope:{ctx:E}}}),vo=new T({props:{name:"advance",anchor:"transformers.Constraint.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L48",returnDescription:`
<p>Must be a tensor of a list of indexable tokens, not some integer.</p>
`,returnType:`
<p>token_ids(<code>torch.tensor</code>)</p>
`}}),To=new T({props:{name:"copy",anchor:"transformers.Constraint.copy",parameters:[{name:"stateful",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L113",returnDescription:`
<p>The same constraint as the one being called from.</p>
`,returnType:`
<p>constraint(<code>Constraint</code>)</p>
`}}),wo=new T({props:{name:"does_advance",anchor:"transformers.Constraint.does_advance",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L60"}}),ko=new T({props:{name:"remaining",anchor:"transformers.Constraint.remaining",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L104"}}),Mo=new T({props:{name:"reset",anchor:"transformers.Constraint.reset",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L94"}}),xo=new T({props:{name:"test",anchor:"transformers.Constraint.test",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L24"}}),jo=new T({props:{name:"update",anchor:"transformers.Constraint.update",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L69",returnDescription:`
<p>Whether this constraint has become one step closer to being fulfuilled.
completed(<code>bool</code>):
Whether this constraint has been completely fulfilled by this token being generated.
reset (<code>bool</code>):
Whether this constraint has reset its progress by this token being generated.</p>
`,returnType:`
<p>stepped(<code>bool</code>)</p>
`}}),Fo=new T({props:{name:"class transformers.PhrasalConstraint",anchor:"transformers.PhrasalConstraint",parameters:[{name:"token_ids",val:": typing.List[int]"}],parametersDescription:[{anchor:"transformers.PhrasalConstraint.token_ids",description:`<strong>token_ids</strong> (<code>List[int]</code>) &#x2014;
The id of the token that must be generated by the output.`,name:"token_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L129"}}),Lo=new T({props:{name:"class transformers.DisjunctiveConstraint",anchor:"transformers.DisjunctiveConstraint",parameters:[{name:"nested_token_ids",val:": typing.List[typing.List[int]]"}],parametersDescription:[{anchor:"transformers.DisjunctiveConstraint.nested_token_ids",description:"<strong>nested_token_ids</strong> (<code>List[List[int]]</code>) &#x2014; a list of words, where each word is a list of ids. This constraint",name:"nested_token_ids"},{anchor:"transformers.DisjunctiveConstraint.is",description:"<strong>is</strong> fulfilled by generating just one from the list of words. &#x2014;",name:"is"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L261"}}),Jo=new T({props:{name:"class transformers.ConstraintListState",anchor:"transformers.ConstraintListState",parameters:[{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"}],parametersDescription:[{anchor:"transformers.ConstraintListState.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> objects that must be fulfilled by the beam scorer.`,name:"constraints"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L350"}}),Uo=new T({props:{name:"advance",anchor:"transformers.ConstraintListState.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L382"}}),Io=new T({props:{name:"reset",anchor:"transformers.ConstraintListState.reset",parameters:[{name:"token_ids",val:": typing.Optional[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L417"}}),Wo=new be({}),Bo=new T({props:{name:"class transformers.BeamScorer",anchor:"transformers.BeamScorer",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L91"}}),Zo=new T({props:{name:"process",anchor:"transformers.BeamScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.BeamScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.BeamScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.BeamScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.BeamScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.BeamScorer.process.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Beam indices indicating to which beam hypothesis each token correspond.`,name:"beam_indices"},{anchor:"transformers.BeamScorer.process.group_index",description:`<strong>group_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the group of beams. Used with <a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search">group_beam_search()</a>.`,name:"group_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L97",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of all
non-finished beams.</li>
<li><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be added
to the non-finished beam_hypotheses.</li>
<li><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),So=new T({props:{name:"finalize",anchor:"transformers.BeamScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.finalize.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.BeamScorer.finalize.final_beam_scores",description:`<strong>final_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The final scores of all non-finished beams.`,name:"final_beam_scores"},{anchor:"transformers.BeamScorer.finalize.final_beam_tokens",description:`<strong>final_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The last tokens to be added to the non-finished beam_hypotheses.`,name:"final_beam_tokens"},{anchor:"transformers.BeamScorer.finalize.final_beam_indices",description:`<strong>final_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The beam indices indicating to which beam the <code>final_beam_tokens</code> shall be added.`,name:"final_beam_indices"},{anchor:"transformers.BeamScorer.finalize.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.finalize.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L109",returnDescription:`
<p>The generated sequences.
The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter if all batches finished early
due to the <code>eos_token_id</code>.</p>
`,returnType:`
<p><code>torch.LongTensor</code> of shape <code>(batch_size * num_return_sequences, sequence_length)</code></p>
`}}),Vo=new T({props:{name:"class transformers.BeamSearchScorer",anchor:"transformers.BeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Union[str, bool, NoneType] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"max_length",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.BeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.BeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.BeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.BeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:
<code>True</code>, where the generation stops as soon as there are <code>num_beams</code> complete candidates; <code>False</code>, where an
heuristic is applied and the generation stops when is it very unlikely to find better candidates;
<code>&quot;never&quot;</code>, where the beam search procedure only stops when there cannot be better candidates (canonical
beam search algorithm).`,name:"do_early_stopping"},{anchor:"transformers.BeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.BeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"},{anchor:"transformers.BeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L123"}}),Go=new T({props:{name:"process",anchor:"transformers.BeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"group_index",val:": typing.Optional[int] = 0"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L215"}}),Xo=new T({props:{name:"finalize",anchor:"transformers.BeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L315"}}),Ro=new T({props:{name:"class transformers.ConstrainedBeamSearchScorer",anchor:"transformers.ConstrainedBeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Union[str, bool, NoneType] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"max_length",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.ConstrainedBeamSearchScorer.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of positive constraints represented as <code>Constraint</code> objects that must be fulfilled in the generation
output. For more information, the documentation of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> should be read.`,name:"constraints"},{anchor:"transformers.ConstrainedBeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.ConstrainedBeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.ConstrainedBeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:
<code>True</code>, where the generation stops as soon as there are <code>num_beams</code> complete candidates; <code>False</code>, where an
heuristic is applied and the generation stops when is it very unlikely to find better candidates;
<code>&quot;never&quot;</code>, where the beam search procedure only stops when there cannot be better candidates (canonical
beam search algorithm).`,name:"do_early_stopping"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"},{anchor:"transformers.ConstrainedBeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L410"}}),Co=new T({props:{name:"process",anchor:"transformers.ConstrainedBeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"scores_for_all_vocab",val:": FloatTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</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.ConstrainedBeamSearchScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.scores_for_all_vocab",description:`<strong>scores_for_all_vocab</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
The scores of all tokens in the vocabulary for each of the beam hypotheses.`,name:"scores_for_all_vocab"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Beam indices indicating to which beam hypothesis each token correspond.`,name:"beam_indices"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L504",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li>
<p><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of
all
non-finished beams.</p>
</li>
<li>
<p><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be
added
to the non-finished beam_hypotheses.</p>
</li>
<li>
<p><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</p>
</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),No=new T({props:{name:"finalize",anchor:"transformers.ConstrainedBeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L798"}}),Ao=new be({}),Oo=new T({props:{name:"transformers.top_k_top_p_filtering",anchor:"transformers.top_k_top_p_filtering",parameters:[{name:"logits",val:": FloatTensor"},{name:"top_k",val:": int = 0"},{name:"top_p",val:": float = 1.0"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L4690"}}),Qo=new T({props:{name:"transformers.tf_top_k_top_p_filtering",anchor:"transformers.tf_top_k_top_p_filtering",parameters:[{name:"logits",val:""},{name:"top_k",val:" = 0"},{name:"top_p",val:" = 1.0"},{name:"filter_value",val:" = -inf"},{name:"min_tokens_to_keep",val:" = 1"}],parametersDescription:[{anchor:"transformers.tf_top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.tf_top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.tf_top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L3059"}}),Ko=new be({}),ea=new T({props:{name:"class transformers.TextStreamer",anchor:"transformers.TextStreamer",parameters:[{name:"tokenizer",val:": AutoTokenizer"},{name:"skip_prompt",val:": bool = False"},{name:"**decode_kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextStreamer.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;
The tokenized used to decode the tokens.`,name:"tokenizer"},{anchor:"transformers.TextStreamer.skip_prompt",description:`<strong>skip_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to skip the prompt to <code>.generate()</code> or not. Useful e.g. for chatbots.`,name:"skip_prompt"},{anchor:"transformers.TextStreamer.decode_kwargs",description:`<strong>decode_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the tokenizer&#x2019;s <code>decode</code> method.`,name:"decode_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L38"}}),Cr=new jl({props:{warning:!0,$$slots:{default:[px]},$$scope:{ctx:E}}}),Nr=new Tt({props:{anchor:"transformers.TextStreamer.example",$$slots:{default:[mx]},$$scope:{ctx:E}}}),ta=new T({props:{name:"end",anchor:"transformers.TextStreamer.end",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L116"}}),ra=new T({props:{name:"on_finalized_text",anchor:"transformers.TextStreamer.on_finalized_text",parameters:[{name:"text",val:": str"},{name:"stream_end",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L130"}}),sa=new T({props:{name:"put",anchor:"transformers.TextStreamer.put",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L82"}}),na=new T({props:{name:"class transformers.TextIteratorStreamer",anchor:"transformers.TextIteratorStreamer",parameters:[{name:"tokenizer",val:": AutoTokenizer"},{name:"skip_prompt",val:": bool = False"},{name:"timeout",val:": typing.Optional[float] = None"},{name:"**decode_kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextIteratorStreamer.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;
The tokenized used to decode the tokens.`,name:"tokenizer"},{anchor:"transformers.TextIteratorStreamer.skip_prompt",description:`<strong>skip_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to skip the prompt to <code>.generate()</code> or not. Useful e.g. for chatbots.`,name:"skip_prompt"},{anchor:"transformers.TextIteratorStreamer.timeout",description:`<strong>timeout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The timeout for the text queue. If <code>None</code>, the queue will block indefinitely. Useful to handle exceptions
in <code>.generate()</code>, when it is called in a separate thread.`,name:"timeout"},{anchor:"transformers.TextIteratorStreamer.decode_kwargs",description:`<strong>decode_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the tokenizer&#x2019;s <code>decode</code> method.`,name:"decode_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L159"}}),Qr=new jl({props:{warning:!0,$$slots:{default:[hx]},$$scope:{ctx:E}}}),Yr=new Tt({props:{anchor:"transformers.TextIteratorStreamer.example",$$slots:{default:[gx]},$$scope:{ctx:E}}}),oa=new T({props:{name:"on_finalized_text",anchor:"transformers.TextIteratorStreamer.on_finalized_text",parameters:[{name:"text",val:": str"},{name:"stream_end",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L213"}}),{c(){v=s("meta"),M=c(),k=s("h1"),w=s("a"),x=s("span"),g(h.$$.fragment),$=c(),V=s("span"),J=a("Utilities for Generation"),U=c(),F=s("p"),Z=a("This page lists all the utility functions used by "),H=s("a"),ve=a("generate()"),W=a(`,
`),Q=s("a"),Te=a("greedy_search()"),X=a(`,
`),j=s("a"),kt=a("contrastive_search()"),$t=a(`,
`),me=s("a"),Mt=a("sample()"),xt=a(`,
`),da=s("a"),Bg=a("beam_search()"),Zg=a(`,
`),pa=s("a"),Sg=a("beam_sample()"),Vg=a(`,
`),ma=s("a"),Pg=a("group_beam_search()"),Dg=a(`, and
`),ha=s("a"),qg=a("constrained_beam_search()"),Gg=a("."),nm=c(),ga=s("p"),Xg=a("Most of those are only useful if you are studying the code of the generate methods in the library."),om=c(),jt=s("h2"),Kt=s("a"),El=s("span"),g(ls.$$.fragment),Rg=c(),Fl=s("span"),Cg=a("Generate Outputs"),am=c(),he=s("p"),Ng=a("The output of "),fa=s("a"),Ag=a("generate()"),Og=a(` is an instance of a subclass of
`),ua=s("a"),Hg=a("ModelOutput"),Qg=a(`. This output is a data structure containing all the information returned
by `),_a=s("a"),Yg=a("generate()"),Kg=a(", but that can also be used as tuple or dictionary."),im=c(),ba=s("p"),ef=a("Here\u2019s an example:"),cm=c(),g(ds.$$.fragment),lm=c(),ct=s("p"),tf=a("The "),Ll=s("code"),rf=a("generation_output"),sf=a(" object is a "),ya=s("a"),nf=a("GreedySearchDecoderOnlyOutput"),of=a(`, as we can
see in the documentation of that class below, it means it has the following attributes:`),dm=c(),ge=s("ul"),va=s("li"),zl=s("code"),af=a("sequences"),cf=a(": the generated sequences of tokens"),lf=c(),Ta=s("li"),Jl=s("code"),df=a("scores"),pf=a(" (optional): the prediction scores of the language modelling head, for each generation step"),mf=c(),wa=s("li"),Ul=s("code"),hf=a("hidden_states"),gf=a(" (optional): the hidden states of the model, for each generation step"),ff=c(),ka=s("li"),Il=s("code"),uf=a("attentions"),_f=a(" (optional): the attention weights of the model, for each generation step"),pm=c(),S=s("p"),bf=a("Here we have the "),Wl=s("code"),yf=a("scores"),vf=a(" since we passed along "),Bl=s("code"),Tf=a("output_scores=True"),wf=a(", but we don\u2019t have "),Zl=s("code"),kf=a("hidden_states"),$f=a(` and
`),Sl=s("code"),Mf=a("attentions"),xf=a(" because we didn\u2019t pass "),Vl=s("code"),jf=a("output_hidden_states=True"),Ef=a(" or "),Pl=s("code"),Ff=a("output_attentions=True"),Lf=a("."),mm=c(),Y=s("p"),zf=a(`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),Dl=s("code"),Jf=a("None"),Uf=a(". Here for instance "),ql=s("code"),If=a("generation_output.scores"),Wf=a(` are all the generated prediction scores of the
language modeling head, and `),Gl=s("code"),Bf=a("generation_output.attentions"),Zf=a(" is "),Xl=s("code"),Sf=a("None"),Vf=a("."),hm=c(),K=s("p"),Pf=a("When using our "),Rl=s("code"),Df=a("generation_output"),qf=a(" object as a tuple, it only keeps the attributes that don\u2019t have "),Cl=s("code"),Gf=a("None"),Xf=a(` values.
Here, for instance, it has two elements, `),Nl=s("code"),Rf=a("loss"),Cf=a(" then "),Al=s("code"),Nf=a("logits"),Af=a(", so"),gm=c(),g(ps.$$.fragment),fm=c(),er=s("p"),Of=a("will return the tuple "),Ol=s("code"),Hf=a("(generation_output.sequences, generation_output.scores)"),Qf=a(" for instance."),um=c(),ee=s("p"),Yf=a("When using our "),Hl=s("code"),Kf=a("generation_output"),eu=a(" object as a dictionary, it only keeps the attributes that don\u2019t have "),Ql=s("code"),tu=a("None"),ru=a(`
values. Here, for instance, it has two keys that are `),Yl=s("code"),su=a("sequences"),nu=a(" and "),Kl=s("code"),ou=a("scores"),au=a("."),_m=c(),$a=s("p"),iu=a("We document here all output types."),bm=c(),Et=s("h3"),tr=s("a"),ed=s("span"),g(ms.$$.fragment),cu=c(),td=s("span"),lu=a("GreedySearchOutput"),ym=c(),Ft=s("div"),g(hs.$$.fragment),du=c(),rd=s("p"),pu=a("Base class for outputs of decoder-only generation models using greedy search."),vm=c(),Lt=s("div"),g(gs.$$.fragment),mu=c(),sd=s("p"),hu=a(`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),Tm=c(),we=s("div"),g(fs.$$.fragment),gu=c(),nd=s("p"),fu=a("Flax Base class for outputs of decoder-only generation models using greedy search."),uu=c(),rr=s("div"),g(us.$$.fragment),_u=c(),od=s("p"),bu=a("\u201CReturns a new object replacing the specified fields with new values."),wm=c(),zt=s("h3"),sr=s("a"),ad=s("span"),g(_s.$$.fragment),yu=c(),id=s("span"),vu=a("SampleOutput"),km=c(),Jt=s("div"),g(bs.$$.fragment),Tu=c(),cd=s("p"),wu=a("Base class for outputs of decoder-only generation models using sampling."),$m=c(),Ut=s("div"),g(ys.$$.fragment),ku=c(),ld=s("p"),$u=a(`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),Mm=c(),ke=s("div"),g(vs.$$.fragment),Mu=c(),dd=s("p"),xu=a("Flax Base class for outputs of decoder-only generation models using sampling."),ju=c(),nr=s("div"),g(Ts.$$.fragment),Eu=c(),pd=s("p"),Fu=a("\u201CReturns a new object replacing the specified fields with new values."),xm=c(),It=s("h3"),or=s("a"),md=s("span"),g(ws.$$.fragment),Lu=c(),hd=s("span"),zu=a("BeamSearchOutput"),jm=c(),Wt=s("div"),g(ks.$$.fragment),Ju=c(),gd=s("p"),Uu=a("Base class for outputs of decoder-only generation models using beam search."),Em=c(),Bt=s("div"),g($s.$$.fragment),Iu=c(),fd=s("p"),Wu=a(`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),Fm=c(),Zt=s("h3"),ar=s("a"),ud=s("span"),g(Ms.$$.fragment),Bu=c(),_d=s("span"),Zu=a("BeamSampleOutput"),Lm=c(),St=s("div"),g(xs.$$.fragment),Su=c(),bd=s("p"),Vu=a("Base class for outputs of decoder-only generation models using beam sample."),zm=c(),Vt=s("div"),g(js.$$.fragment),Pu=c(),yd=s("p"),Du=a(`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),Jm=c(),Pt=s("h2"),ir=s("a"),vd=s("span"),g(Es.$$.fragment),qu=c(),Td=s("span"),Gu=a("LogitsProcessor"),Um=c(),cr=s("p"),Xu=a("A "),Ma=s("a"),Ru=a("LogitsProcessor"),Cu=a(` can be used to modify the prediction scores of a language model head for
generation.`),Im=c(),$e=s("div"),g(Fs.$$.fragment),Nu=c(),wd=s("p"),Au=a("Abstract base class for all logit processors that can be applied during generation."),Ou=c(),xa=s("div"),g(Ls.$$.fragment),Wm=c(),Me=s("div"),g(zs.$$.fragment),Hu=c(),P=s("p"),Qu=a("This class can be used to create a list of "),ja=s("a"),Yu=a("LogitsProcessor"),Ku=a(" or "),Ea=s("a"),e_=a("LogitsWarper"),t_=a(` to subsequently process a
`),kd=s("code"),r_=a("scores"),s_=a(" input tensor. This class inherits from list and adds a specific "),$d=s("em"),Md=s("strong"),n_=a("call"),o_=a(` method to apply each
`),Fa=s("a"),a_=a("LogitsProcessor"),i_=a(" or "),La=s("a"),c_=a("LogitsWarper"),l_=a(" to the inputs."),d_=c(),za=s("div"),g(Js.$$.fragment),Bm=c(),xe=s("div"),g(Us.$$.fragment),p_=c(),xd=s("p"),m_=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),h_=c(),Ja=s("div"),g(Is.$$.fragment),Zm=c(),je=s("div"),g(Ws.$$.fragment),g_=c(),Ua=s("p"),Ia=s("a"),f_=a("LogitsProcessor"),u_=a(" enforcing a min-length by setting EOS probability to 0."),__=c(),Wa=s("div"),g(Bs.$$.fragment),Sm=c(),oe=s("div"),g(Zs.$$.fragment),b_=c(),fe=s("p"),Ba=s("a"),y_=a("LogitsProcessor"),v_=a(` enforcing a min-length of new tokens by setting EOS (End-Of-Sequence) token probability to 0.
Note that for decoder-only models, such as Llama2, `),jd=s("code"),T_=a("min_length"),w_=a(" will compute the length of "),Ed=s("code"),k_=a("prompt + newly generated tokens"),$_=a(" whereas for other models it will behave as "),Fd=s("code"),M_=a("min_new_tokens"),x_=a(`, that is, taking only into account
the newly generated ones.`),j_=c(),g(lr.$$.fragment),E_=c(),Za=s("div"),g(Ss.$$.fragment),Vm=c(),R=s("div"),g(Vs.$$.fragment),F_=c(),Sa=s("p"),Va=s("a"),L_=a("LogitsWarper"),z_=a(` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),J_=c(),g(dr.$$.fragment),U_=c(),g(pr.$$.fragment),I_=c(),Pa=s("div"),g(Ps.$$.fragment),Pm=c(),ae=s("div"),g(Ds.$$.fragment),W_=c(),mr=s("p"),Da=s("a"),B_=a("LogitsProcessor"),Z_=a(` that prevents the repetition of previous tokens through an exponential penalty. This technique
shares some similarities with coverage mechanisms and other aimed at reducing repetition. During the text
generation process, the probability distribution for the next token is determined using a formula that incorporates
token scores based on their occurrence in the generated sequence. Tokens with higher scores are less likely to be
selected. The formula can be seen in the original `),qs=s("a"),S_=a("paper"),V_=a(`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),P_=c(),g(hr.$$.fragment),D_=c(),qa=s("div"),g(Gs.$$.fragment),Dm=c(),ie=s("div"),g(Xs.$$.fragment),q_=c(),Ga=s("p"),Xa=s("a"),G_=a("LogitsWarper"),X_=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),R_=c(),g(gr.$$.fragment),C_=c(),Ra=s("div"),g(Rs.$$.fragment),qm=c(),Ee=s("div"),g(Cs.$$.fragment),N_=c(),Ca=s("p"),Na=s("a"),A_=a("LogitsWarper"),O_=a(" that performs top-k, i.e. restricting to the k highest probability elements."),H_=c(),Aa=s("div"),g(Ns.$$.fragment),Gm=c(),Fe=s("div"),g(As.$$.fragment),Q_=c(),fr=s("p"),Oa=s("a"),Y_=a("LogitsWarper"),K_=a(" that performs typical decoding. See "),Os=s("a"),eb=a(`Typical Decoding for Natural Language
Generation`),tb=a(" for more information."),rb=c(),Ha=s("div"),g(Hs.$$.fragment),Xm=c(),C=s("div"),g(Qs.$$.fragment),sb=c(),Dt=s("p"),nb=a(`N-grams are groups of \u201Cn\u201D consecutive words, characters, or tokens taken from a sequence of text. Given the
sentence: \u201CShe runs fast\u201D, the bi-grams (n=2) would be (\u201Cshe\u201D, \u201Cruns\u201D) and (\u201Cruns\u201D, \u201Cfast\u201D). In text generation,
avoiding repetitions of word sequences provides a more diverse output. This `),Qa=s("a"),ob=a("LogitsProcessor"),ab=a(` enforces no
repetition of n-grams by setting the scores of banned tokens to negative infinity which eliminates those tokens
from consideration when further processing the scores.
`),Ys=s("a"),ib=a("Fairseq"),cb=a("."),lb=c(),g(ur.$$.fragment),db=c(),g(_r.$$.fragment),pb=c(),Ya=s("div"),g(Ks.$$.fragment),Rm=c(),N=s("div"),g(en.$$.fragment),mb=c(),Ka=s("p"),ei=s("a"),hb=a("LogitsProcessor"),gb=a(` that applies an additive bias on sequences. The bias is applied to the last token of a sequence
when the next generated token can complete it. Consequently, to take the most of biasing sequences with more than
one token, consider using beam methods (to gracefully work around partially completed sequences that have a
negative bias) and applying the bias to their prefixes (to ensure the bias is applied earlier).`),fb=c(),g(br.$$.fragment),ub=c(),g(yr.$$.fragment),_b=c(),ti=s("div"),g(tn.$$.fragment),Cm=c(),A=s("div"),g(rn.$$.fragment),bb=c(),ri=s("p"),si=s("a"),yb=a("LogitsProcessor"),vb=a(" that enforces that specified sequences will never be selected."),Tb=c(),g(vr.$$.fragment),wb=c(),g(Tr.$$.fragment),kb=c(),ni=s("div"),g(sn.$$.fragment),Nm=c(),Le=s("div"),g(nn.$$.fragment),$b=c(),wr=s("p"),oi=s("a"),Mb=a("LogitsProcessor"),xb=a(` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),on=s("a"),jb=a("Autoregressive Entity Retrieval"),Eb=a(" for more information."),Fb=c(),ai=s("div"),g(an.$$.fragment),Am=c(),ze=s("div"),g(cn.$$.fragment),Lb=c(),lt=s("p"),ii=s("a"),zb=a("LogitsProcessor"),Jb=a(` that enforces diverse beam search. Note that this logits processor is only effective for
`),ci=s("a"),Ub=a("PreTrainedModel.group_beam_search()"),Ib=a(". See "),ln=s("a"),Wb=a(`Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence
Models`),Bb=a(" for more details."),Zb=c(),li=s("div"),g(dn.$$.fragment),Om=c(),Je=s("div"),g(pn.$$.fragment),Sb=c(),di=s("p"),pi=s("a"),Vb=a("LogitsProcessor"),Pb=a(" that enforces the specified token as the first generated token."),Db=c(),mi=s("div"),g(mn.$$.fragment),Hm=c(),Ue=s("div"),g(hn.$$.fragment),qb=c(),kr=s("p"),hi=s("a"),Gb=a("LogitsProcessor"),Xb=a(" that enforces the specified token as the last generated token when "),Ld=s("code"),Rb=a("max_length"),Cb=a(" is reached."),Nb=c(),gi=s("div"),g(gn.$$.fragment),Qm=c(),Ie=s("div"),g(fn.$$.fragment),Ab=c(),dt=s("p"),fi=s("a"),Ob=a("LogitsProcessor"),Hb=a(" that removes all "),zd=s("code"),Qb=a("nan"),Yb=a(" and "),Jd=s("code"),Kb=a("inf"),ey=a(` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method.`),ty=c(),ui=s("div"),g(un.$$.fragment),Ym=c(),We=s("div"),g(_n.$$.fragment),ry=c(),Ud=s("p"),sy=a("Abstract base class for all logit processors that can be applied during generation."),ny=c(),$r=s("div"),g(bn.$$.fragment),oy=c(),Id=s("p"),ay=a("TF method for processing logits."),Km=c(),Be=s("div"),g(yn.$$.fragment),iy=c(),ce=s("p"),cy=a("This class can be used to create a list of "),_i=s("a"),ly=a("TFLogitsProcessor"),dy=a(" to subsequently process a "),Wd=s("code"),py=a("scores"),my=a(` input tensor.
This class inherits from list and adds a specific `),Bd=s("em"),Zd=s("strong"),hy=a("call"),gy=a(" method to apply each "),bi=s("a"),fy=a("TFLogitsProcessor"),uy=a(` to the
inputs.`),_y=c(),yi=s("div"),g(vn.$$.fragment),eh=c(),Ze=s("div"),g(Tn.$$.fragment),by=c(),Sd=s("p"),yy=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),vy=c(),Mr=s("div"),g(wn.$$.fragment),Ty=c(),Vd=s("p"),wy=a("TF method for warping logits."),th=c(),Se=s("div"),g(kn.$$.fragment),ky=c(),vi=s("p"),Ti=s("a"),$y=a("TFLogitsWarper"),My=a(" for temperature (exponential scaling output probability distribution)."),xy=c(),wi=s("div"),g($n.$$.fragment),rh=c(),Ve=s("div"),g(Mn.$$.fragment),jy=c(),ki=s("p"),$i=s("a"),Ey=a("TFLogitsWarper"),Fy=a(" that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),Ly=c(),Mi=s("div"),g(xn.$$.fragment),sh=c(),Pe=s("div"),g(jn.$$.fragment),zy=c(),xi=s("p"),ji=s("a"),Jy=a("TFLogitsWarper"),Uy=a(" that performs top-k, i.e. restricting to the k highest probability elements."),Iy=c(),Ei=s("div"),g(En.$$.fragment),nh=c(),De=s("div"),g(Fn.$$.fragment),Wy=c(),Fi=s("p"),Li=s("a"),By=a("TFLogitsProcessor"),Zy=a(" enforcing a min-length by setting EOS probability to 0."),Sy=c(),zi=s("div"),g(Ln.$$.fragment),oh=c(),qe=s("div"),g(zn.$$.fragment),Vy=c(),Ji=s("p"),Ui=s("a"),Py=a("TFLogitsProcessor"),Dy=a(" that enforces that specified sequences will never be sampled."),qy=c(),Ii=s("div"),g(Jn.$$.fragment),ah=c(),Ge=s("div"),g(Un.$$.fragment),Gy=c(),xr=s("p"),Wi=s("a"),Xy=a("TFLogitsProcessor"),Ry=a(` that enforces no repetition of n-grams. See
`),In=s("a"),Cy=a("Fairseq"),Ny=a("."),Ay=c(),Bi=s("div"),g(Wn.$$.fragment),ih=c(),Xe=s("div"),g(Bn.$$.fragment),Oy=c(),Zi=s("p"),Si=s("a"),Hy=a("TFLogitsProcessor"),Qy=a(" enforcing an exponential penalty on repeated sequences."),Yy=c(),Vi=s("div"),g(Zn.$$.fragment),ch=c(),Re=s("div"),g(Sn.$$.fragment),Ky=c(),Pi=s("p"),Di=s("a"),ev=a("TFLogitsProcessor"),tv=a(" that enforces the specified token as the first generated token."),rv=c(),qi=s("div"),g(Vn.$$.fragment),lh=c(),Ce=s("div"),g(Pn.$$.fragment),sv=c(),jr=s("p"),Gi=s("a"),nv=a("TFLogitsProcessor"),ov=a(" that enforces the specified token as the last generated token when "),Pd=s("code"),av=a("max_length"),iv=a(" is reached."),cv=c(),Xi=s("div"),g(Dn.$$.fragment),dh=c(),Ne=s("div"),g(qn.$$.fragment),lv=c(),Dd=s("p"),dv=a("Abstract base class for all logit processors that can be applied during generation."),pv=c(),Er=s("div"),g(Gn.$$.fragment),mv=c(),qd=s("p"),hv=a("Flax method for processing logits."),ph=c(),Ae=s("div"),g(Xn.$$.fragment),gv=c(),D=s("p"),fv=a("This class can be used to create a list of "),Ri=s("a"),uv=a("FlaxLogitsProcessor"),_v=a(" or "),Ci=s("a"),bv=a("FlaxLogitsWarper"),yv=a(` to subsequently process
a `),Gd=s("code"),vv=a("scores"),Tv=a(" input tensor. This class inherits from list and adds a specific "),Xd=s("em"),Rd=s("strong"),wv=a("call"),kv=a(` method to apply each
`),Ni=s("a"),$v=a("FlaxLogitsProcessor"),Mv=a(" or "),Ai=s("a"),xv=a("FlaxLogitsWarper"),jv=a(" to the inputs."),Ev=c(),Oi=s("div"),g(Rn.$$.fragment),mh=c(),Oe=s("div"),g(Cn.$$.fragment),Fv=c(),Cd=s("p"),Lv=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),zv=c(),Fr=s("div"),g(Nn.$$.fragment),Jv=c(),Nd=s("p"),Uv=a("Flax method for warping logits."),hh=c(),He=s("div"),g(An.$$.fragment),Iv=c(),Hi=s("p"),Qi=s("a"),Wv=a("FlaxLogitsWarper"),Bv=a(" for temperature (exponential scaling output probability distribution)."),Zv=c(),Yi=s("div"),g(On.$$.fragment),gh=c(),Qe=s("div"),g(Hn.$$.fragment),Sv=c(),Ki=s("p"),ec=s("a"),Vv=a("FlaxLogitsWarper"),Pv=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),Dv=c(),tc=s("div"),g(Qn.$$.fragment),fh=c(),Ye=s("div"),g(Yn.$$.fragment),qv=c(),rc=s("p"),sc=s("a"),Gv=a("FlaxLogitsWarper"),Xv=a(" that performs top-k, i.e. restricting to the k highest probability elements."),Rv=c(),nc=s("div"),g(Kn.$$.fragment),uh=c(),Ke=s("div"),g(eo.$$.fragment),Cv=c(),oc=s("p"),ac=s("a"),Nv=a("FlaxLogitsProcessor"),Av=a(" that enforces the specified token as the first generated token."),Ov=c(),ic=s("div"),g(to.$$.fragment),_h=c(),et=s("div"),g(ro.$$.fragment),Hv=c(),Lr=s("p"),cc=s("a"),Qv=a("FlaxLogitsProcessor"),Yv=a(" that enforces the specified token as the last generated token when "),Ad=s("code"),Kv=a("max_length"),eT=a(" is reached."),tT=c(),lc=s("div"),g(so.$$.fragment),bh=c(),tt=s("div"),g(no.$$.fragment),rT=c(),dc=s("p"),pc=s("a"),sT=a("FlaxLogitsProcessor"),nT=a(" enforcing a min-length by setting EOS probability to 0."),oT=c(),mc=s("div"),g(oo.$$.fragment),yh=c(),qt=s("h2"),zr=s("a"),Od=s("span"),g(ao.$$.fragment),aT=c(),Hd=s("span"),iT=a("StoppingCriteria"),vh=c(),Jr=s("p"),cT=a("A "),hc=s("a"),lT=a("StoppingCriteria"),dT=a(" can be used to change when to stop generation (other than EOS token)."),Th=c(),rt=s("div"),g(io.$$.fragment),pT=c(),Qd=s("p"),mT=a("Abstract base class for all stopping criteria that can be applied during generation."),hT=c(),gc=s("div"),g(co.$$.fragment),wh=c(),Gt=s("div"),g(lo.$$.fragment),gT=c(),fc=s("div"),g(po.$$.fragment),kh=c(),st=s("div"),g(mo.$$.fragment),fT=c(),ho=s("p"),uT=a("This class can be used to stop generation whenever the full generated number of tokens exceeds "),Yd=s("code"),_T=a("max_length"),bT=a(`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),yT=c(),uc=s("div"),g(go.$$.fragment),$h=c(),nt=s("div"),g(fo.$$.fragment),vT=c(),uo=s("p"),TT=a(`This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
time will start being counted when you initialize this function. You can override this by passing an
`),Kd=s("code"),wT=a("initial_time"),kT=a("."),$T=c(),_c=s("div"),g(_o.$$.fragment),Mh=c(),Xt=s("h2"),Ur=s("a"),ep=s("span"),g(bo.$$.fragment),MT=c(),tp=s("span"),xT=a("Constraints"),xh=c(),Ir=s("p"),jT=a("A "),bc=s("a"),ET=a("Constraint"),FT=a(" can be used to force the generation to include specific tokens or sequences in the output."),jh=c(),L=s("div"),g(yo.$$.fragment),LT=c(),rp=s("p"),zT=a(`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),JT=c(),sp=s("p"),UT=a("All classes that inherit Constraint must follow the requirement that"),IT=c(),g(Wr.$$.fragment),WT=c(),np=s("p"),BT=a("will always terminate (halt)."),ZT=c(),Br=s("div"),g(vo.$$.fragment),ST=c(),op=s("p"),VT=a("When called, returns the token that would take this constraint one step closer to being fulfilled."),PT=c(),Zr=s("div"),g(To.$$.fragment),DT=c(),ap=s("p"),qT=a("Creates a new instance of this constraint."),GT=c(),Sr=s("div"),g(wo.$$.fragment),XT=c(),ip=s("p"),RT=a("Reads in a token and returns whether it creates progress."),CT=c(),Vr=s("div"),g(ko.$$.fragment),NT=c(),$o=s("p"),AT=a("Returns the number of remaining steps of "),cp=s("code"),OT=a("advance()"),HT=a(" in order to complete this constraint."),QT=c(),Pr=s("div"),g(Mo.$$.fragment),YT=c(),lp=s("p"),KT=a(`Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of
a constraint is abrupted by an unwanted token.`),e2=c(),Dr=s("div"),g(xo.$$.fragment),t2=c(),dp=s("p"),r2=a("Tests whether this constraint has been properly defined."),s2=c(),pt=s("div"),g(jo.$$.fragment),n2=c(),Eo=s("p"),o2=a(`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),pp=s("code"),a2=a("does_advance(self, token_id: int)"),i2=a("."),c2=c(),mp=s("p"),l2=a(`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),Eh=c(),Rt=s("div"),g(Fo.$$.fragment),d2=c(),yc=s("p"),vc=s("a"),p2=a("Constraint"),m2=a(" enforcing that an ordered sequence of tokens is included in the output."),Fh=c(),Ct=s("div"),g(Lo.$$.fragment),h2=c(),zo=s("p"),g2=a("A special "),Tc=s("a"),f2=a("Constraint"),u2=a(" that is fulfilled by fulfilling just one of several constraints."),Lh=c(),le=s("div"),g(Jo.$$.fragment),_2=c(),hp=s("p"),b2=a("A class for beam scorers to track its progress through a list of constraints."),y2=c(),G=s("div"),g(Uo.$$.fragment),v2=c(),gp=s("p"),T2=a(`The list of tokens to generate such that we can make progress.
By \u201Clist\u201D we don\u2019t mean the list of token that will fully fulfill a constraint.`),w2=c(),Nt=s("p"),k2=a("Given constraints "),fp=s("code"),$2=a("c_i = {t_ij | j == # of tokens}"),M2=a(`, If we\u2019re not in the middle of progressing through a
specific constraint `),up=s("code"),x2=a("c_i"),j2=a(", we return:"),E2=c(),_p=s("p"),bp=s("code"),F2=a("[t_k1 for k in indices of unfulfilled constraints]"),L2=c(),ot=s("p"),z2=a(`If we are in the middle of a constraint, then we return:
`),yp=s("code"),J2=a("[t_ij]"),U2=a(", where "),vp=s("code"),I2=a("i"),W2=a(" is the index of the inprogress constraint, "),Tp=s("code"),B2=a("j"),Z2=a(" is the next step for the constraint."),S2=c(),wp=s("p"),V2=a(`Though we don\u2019t care which constraint is fulfilled first, if we are in the progress of fulfilling a constraint,
that\u2019s the only one we\u2019ll return.`),P2=c(),qr=s("div"),g(Io.$$.fragment),D2=c(),kp=s("p"),q2=a("token_ids: the tokens generated thus far to reset the state of the progress through constraints."),zh=c(),At=s("h2"),Gr=s("a"),$p=s("span"),g(Wo.$$.fragment),G2=c(),Mp=s("span"),X2=a("BeamSearch"),Jh=c(),de=s("div"),g(Bo.$$.fragment),R2=c(),Ot=s("p"),C2=a("Abstract base class for all beam scorers that are used for "),wc=s("a"),N2=a("beam_search()"),A2=a(` and
`),kc=s("a"),O2=a("beam_sample()"),H2=a("."),Q2=c(),$c=s("div"),g(Zo.$$.fragment),Y2=c(),Mc=s("div"),g(So.$$.fragment),Uh=c(),q=s("div"),g(Vo.$$.fragment),K2=c(),xc=s("p"),jc=s("a"),ew=a("BeamScorer"),tw=a(" implementing standard beam search decoding."),rw=c(),Po=s("p"),sw=a("Adapted in part from "),Do=s("a"),nw=a(`Facebook\u2019s XLM beam search
code`),ow=a("."),aw=c(),Ec=s("p"),iw=a("Reference for the diverse beam search algorithm and implementation "),qo=s("a"),cw=a(`Ashwin Kalyan\u2019s DBS
implementation`),lw=c(),Fc=s("div"),g(Go.$$.fragment),dw=c(),Lc=s("div"),g(Xo.$$.fragment),Ih=c(),pe=s("div"),g(Ro.$$.fragment),pw=c(),zc=s("p"),Jc=s("a"),mw=a("BeamScorer"),hw=a(" implementing constrained beam search decoding."),gw=c(),Uc=s("div"),g(Co.$$.fragment),fw=c(),Ic=s("div"),g(No.$$.fragment),Wh=c(),Ht=s("h2"),Xr=s("a"),xp=s("span"),g(Ao.$$.fragment),uw=c(),jp=s("span"),_w=a("Utilities"),Bh=c(),at=s("div"),g(Oo.$$.fragment),bw=c(),Ep=s("p"),yw=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),vw=c(),Wc=s("p"),Tw=a("From: "),Ho=s("a"),ww=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),Zh=c(),it=s("div"),g(Qo.$$.fragment),kw=c(),Fp=s("p"),$w=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),Mw=c(),Bc=s("p"),xw=a("From: "),Yo=s("a"),jw=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),Sh=c(),Qt=s("h2"),Rr=s("a"),Lp=s("span"),g(Ko.$$.fragment),Ew=c(),zp=s("span"),Fw=a("Streamers"),Vh=c(),B=s("div"),g(ea.$$.fragment),Lw=c(),Jp=s("p"),zw=a("Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),Jw=c(),g(Cr.$$.fragment),Uw=c(),g(Nr.$$.fragment),Iw=c(),Ar=s("div"),g(ta.$$.fragment),Ww=c(),Up=s("p"),Bw=a("Flushes any remaining cache and prints a newline to stdout."),Zw=c(),Or=s("div"),g(ra.$$.fragment),Sw=c(),Ip=s("p"),Vw=a("Prints the new text to stdout. If the stream is ending, also prints a newline."),Pw=c(),Hr=s("div"),g(sa.$$.fragment),Dw=c(),Wp=s("p"),qw=a("Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),Ph=c(),O=s("div"),g(na.$$.fragment),Gw=c(),Bp=s("p"),Xw=a(`Streamer that stores print-ready text in a queue, to be used by a downstream application as an iterator. This is
useful for applications that benefit from acessing the generated text in a non-blocking way (e.g. in an interactive
Gradio demo).`),Rw=c(),g(Qr.$$.fragment),Cw=c(),g(Yr.$$.fragment),Nw=c(),Kr=s("div"),g(oa.$$.fragment),Aw=c(),Zp=s("p"),Ow=a("Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."),this.h()},l(e){const p=QM('[data-svelte="svelte-1phssyn"]',document.head);v=n(p,"META",{name:!0,content:!0}),p.forEach(r),M=l(e),k=n(e,"H1",{class:!0});var aa=o(k);w=n(aa,"A",{id:!0,class:!0,href:!0});var Sp=o(w);x=n(Sp,"SPAN",{});var Vp=o(x);f(h.$$.fragment,Vp),Vp.forEach(r),Sp.forEach(r),$=l(aa),V=n(aa,"SPAN",{});var Pp=o(V);J=i(Pp,"Utilities for Generation"),Pp.forEach(r),aa.forEach(r),U=l(e),F=n(e,"P",{});var I=o(F);Z=i(I,"This page lists all the utility functions used by "),H=n(I,"A",{href:!0});var Dp=o(H);ve=i(Dp,"generate()"),Dp.forEach(r),W=i(I,`,
`),Q=n(I,"A",{href:!0});var qp=o(Q);Te=i(qp,"greedy_search()"),qp.forEach(r),X=i(I,`,
`),j=n(I,"A",{href:!0});var Gp=o(j);kt=i(Gp,"contrastive_search()"),Gp.forEach(r),$t=i(I,`,
`),me=n(I,"A",{href:!0});var Xp=o(me);Mt=i(Xp,"sample()"),Xp.forEach(r),xt=i(I,`,
`),da=n(I,"A",{href:!0});var Rp=o(da);Bg=i(Rp,"beam_search()"),Rp.forEach(r),Zg=i(I,`,
`),pa=n(I,"A",{href:!0});var Cp=o(pa);Sg=i(Cp,"beam_sample()"),Cp.forEach(r),Vg=i(I,`,
`),ma=n(I,"A",{href:!0});var Np=o(ma);Pg=i(Np,"group_beam_search()"),Np.forEach(r),Dg=i(I,`, and
`),ha=n(I,"A",{href:!0});var Ap=o(ha);qg=i(Ap,"constrained_beam_search()"),Ap.forEach(r),Gg=i(I,"."),I.forEach(r),nm=l(e),ga=n(e,"P",{});var Op=o(ga);Xg=i(Op,"Most of those are only useful if you are studying the code of the generate methods in the library."),Op.forEach(r),om=l(e),jt=n(e,"H2",{class:!0});var ia=o(jt);Kt=n(ia,"A",{id:!0,class:!0,href:!0});var Hp=o(Kt);El=n(Hp,"SPAN",{});var Mk=o(El);f(ls.$$.fragment,Mk),Mk.forEach(r),Hp.forEach(r),Rg=l(ia),Fl=n(ia,"SPAN",{});var xk=o(Fl);Cg=i(xk,"Generate Outputs"),xk.forEach(r),ia.forEach(r),am=l(e),he=n(e,"P",{});var es=o(he);Ng=i(es,"The output of "),fa=n(es,"A",{href:!0});var jk=o(fa);Ag=i(jk,"generate()"),jk.forEach(r),Og=i(es,` is an instance of a subclass of
`),ua=n(es,"A",{href:!0});var Ek=o(ua);Hg=i(Ek,"ModelOutput"),Ek.forEach(r),Qg=i(es,`. This output is a data structure containing all the information returned
by `),_a=n(es,"A",{href:!0});var Fk=o(_a);Yg=i(Fk,"generate()"),Fk.forEach(r),Kg=i(es,", but that can also be used as tuple or dictionary."),es.forEach(r),im=l(e),ba=n(e,"P",{});var Lk=o(ba);ef=i(Lk,"Here\u2019s an example:"),Lk.forEach(r),cm=l(e),f(ds.$$.fragment,e),lm=l(e),ct=n(e,"P",{});var Zc=o(ct);tf=i(Zc,"The "),Ll=n(Zc,"CODE",{});var zk=o(Ll);rf=i(zk,"generation_output"),zk.forEach(r),sf=i(Zc," object is a "),ya=n(Zc,"A",{href:!0});var Jk=o(ya);nf=i(Jk,"GreedySearchDecoderOnlyOutput"),Jk.forEach(r),of=i(Zc,`, as we can
see in the documentation of that class below, it means it has the following attributes:`),Zc.forEach(r),dm=l(e),ge=n(e,"UL",{});var ts=o(ge);va=n(ts,"LI",{});var Hw=o(va);zl=n(Hw,"CODE",{});var Uk=o(zl);af=i(Uk,"sequences"),Uk.forEach(r),cf=i(Hw,": the generated sequences of tokens"),Hw.forEach(r),lf=l(ts),Ta=n(ts,"LI",{});var Qw=o(Ta);Jl=n(Qw,"CODE",{});var Ik=o(Jl);df=i(Ik,"scores"),Ik.forEach(r),pf=i(Qw," (optional): the prediction scores of the language modelling head, for each generation step"),Qw.forEach(r),mf=l(ts),wa=n(ts,"LI",{});var Yw=o(wa);Ul=n(Yw,"CODE",{});var Wk=o(Ul);hf=i(Wk,"hidden_states"),Wk.forEach(r),gf=i(Yw," (optional): the hidden states of the model, for each generation step"),Yw.forEach(r),ff=l(ts),ka=n(ts,"LI",{});var Kw=o(ka);Il=n(Kw,"CODE",{});var Bk=o(Il);uf=i(Bk,"attentions"),Bk.forEach(r),_f=i(Kw," (optional): the attention weights of the model, for each generation step"),Kw.forEach(r),ts.forEach(r),pm=l(e),S=n(e,"P",{});var te=o(S);bf=i(te,"Here we have the "),Wl=n(te,"CODE",{});var Zk=o(Wl);yf=i(Zk,"scores"),Zk.forEach(r),vf=i(te," since we passed along "),Bl=n(te,"CODE",{});var Sk=o(Bl);Tf=i(Sk,"output_scores=True"),Sk.forEach(r),wf=i(te,", but we don\u2019t have "),Zl=n(te,"CODE",{});var Vk=o(Zl);kf=i(Vk,"hidden_states"),Vk.forEach(r),$f=i(te,` and
`),Sl=n(te,"CODE",{});var Pk=o(Sl);Mf=i(Pk,"attentions"),Pk.forEach(r),xf=i(te," because we didn\u2019t pass "),Vl=n(te,"CODE",{});var Dk=o(Vl);jf=i(Dk,"output_hidden_states=True"),Dk.forEach(r),Ef=i(te," or "),Pl=n(te,"CODE",{});var qk=o(Pl);Ff=i(qk,"output_attentions=True"),qk.forEach(r),Lf=i(te,"."),te.forEach(r),mm=l(e),Y=n(e,"P",{});var mt=o(Y);zf=i(mt,`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),Dl=n(mt,"CODE",{});var Gk=o(Dl);Jf=i(Gk,"None"),Gk.forEach(r),Uf=i(mt,". Here for instance "),ql=n(mt,"CODE",{});var Xk=o(ql);If=i(Xk,"generation_output.scores"),Xk.forEach(r),Wf=i(mt,` are all the generated prediction scores of the
language modeling head, and `),Gl=n(mt,"CODE",{});var Rk=o(Gl);Bf=i(Rk,"generation_output.attentions"),Rk.forEach(r),Zf=i(mt," is "),Xl=n(mt,"CODE",{});var Ck=o(Xl);Sf=i(Ck,"None"),Ck.forEach(r),Vf=i(mt,"."),mt.forEach(r),hm=l(e),K=n(e,"P",{});var ht=o(K);Pf=i(ht,"When using our "),Rl=n(ht,"CODE",{});var Nk=o(Rl);Df=i(Nk,"generation_output"),Nk.forEach(r),qf=i(ht," object as a tuple, it only keeps the attributes that don\u2019t have "),Cl=n(ht,"CODE",{});var Ak=o(Cl);Gf=i(Ak,"None"),Ak.forEach(r),Xf=i(ht,` values.
Here, for instance, it has two elements, `),Nl=n(ht,"CODE",{});var Ok=o(Nl);Rf=i(Ok,"loss"),Ok.forEach(r),Cf=i(ht," then "),Al=n(ht,"CODE",{});var Hk=o(Al);Nf=i(Hk,"logits"),Hk.forEach(r),Af=i(ht,", so"),ht.forEach(r),gm=l(e),f(ps.$$.fragment,e),fm=l(e),er=n(e,"P",{});var qh=o(er);Of=i(qh,"will return the tuple "),Ol=n(qh,"CODE",{});var Qk=o(Ol);Hf=i(Qk,"(generation_output.sequences, generation_output.scores)"),Qk.forEach(r),Qf=i(qh," for instance."),qh.forEach(r),um=l(e),ee=n(e,"P",{});var gt=o(ee);Yf=i(gt,"When using our "),Hl=n(gt,"CODE",{});var Yk=o(Hl);Kf=i(Yk,"generation_output"),Yk.forEach(r),eu=i(gt," object as a dictionary, it only keeps the attributes that don\u2019t have "),Ql=n(gt,"CODE",{});var Kk=o(Ql);tu=i(Kk,"None"),Kk.forEach(r),ru=i(gt,`
values. Here, for instance, it has two keys that are `),Yl=n(gt,"CODE",{});var e$=o(Yl);su=i(e$,"sequences"),e$.forEach(r),nu=i(gt," and "),Kl=n(gt,"CODE",{});var t$=o(Kl);ou=i(t$,"scores"),t$.forEach(r),au=i(gt,"."),gt.forEach(r),_m=l(e),$a=n(e,"P",{});var r$=o($a);iu=i(r$,"We document here all output types."),r$.forEach(r),bm=l(e),Et=n(e,"H3",{class:!0});var Gh=o(Et);tr=n(Gh,"A",{id:!0,class:!0,href:!0});var s$=o(tr);ed=n(s$,"SPAN",{});var n$=o(ed);f(ms.$$.fragment,n$),n$.forEach(r),s$.forEach(r),cu=l(Gh),td=n(Gh,"SPAN",{});var o$=o(td);lu=i(o$,"GreedySearchOutput"),o$.forEach(r),Gh.forEach(r),ym=l(e),Ft=n(e,"DIV",{class:!0});var Xh=o(Ft);f(hs.$$.fragment,Xh),du=l(Xh),rd=n(Xh,"P",{});var a$=o(rd);pu=i(a$,"Base class for outputs of decoder-only generation models using greedy search."),a$.forEach(r),Xh.forEach(r),vm=l(e),Lt=n(e,"DIV",{class:!0});var Rh=o(Lt);f(gs.$$.fragment,Rh),mu=l(Rh),sd=n(Rh,"P",{});var i$=o(sd);hu=i(i$,`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),i$.forEach(r),Rh.forEach(r),Tm=l(e),we=n(e,"DIV",{class:!0});var Sc=o(we);f(fs.$$.fragment,Sc),gu=l(Sc),nd=n(Sc,"P",{});var c$=o(nd);fu=i(c$,"Flax Base class for outputs of decoder-only generation models using greedy search."),c$.forEach(r),uu=l(Sc),rr=n(Sc,"DIV",{class:!0});var Ch=o(rr);f(us.$$.fragment,Ch),_u=l(Ch),od=n(Ch,"P",{});var l$=o(od);bu=i(l$,"\u201CReturns a new object replacing the specified fields with new values."),l$.forEach(r),Ch.forEach(r),Sc.forEach(r),wm=l(e),zt=n(e,"H3",{class:!0});var Nh=o(zt);sr=n(Nh,"A",{id:!0,class:!0,href:!0});var d$=o(sr);ad=n(d$,"SPAN",{});var p$=o(ad);f(_s.$$.fragment,p$),p$.forEach(r),d$.forEach(r),yu=l(Nh),id=n(Nh,"SPAN",{});var m$=o(id);vu=i(m$,"SampleOutput"),m$.forEach(r),Nh.forEach(r),km=l(e),Jt=n(e,"DIV",{class:!0});var Ah=o(Jt);f(bs.$$.fragment,Ah),Tu=l(Ah),cd=n(Ah,"P",{});var h$=o(cd);wu=i(h$,"Base class for outputs of decoder-only generation models using sampling."),h$.forEach(r),Ah.forEach(r),$m=l(e),Ut=n(e,"DIV",{class:!0});var Oh=o(Ut);f(ys.$$.fragment,Oh),ku=l(Oh),ld=n(Oh,"P",{});var g$=o(ld);$u=i(g$,`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),g$.forEach(r),Oh.forEach(r),Mm=l(e),ke=n(e,"DIV",{class:!0});var Vc=o(ke);f(vs.$$.fragment,Vc),Mu=l(Vc),dd=n(Vc,"P",{});var f$=o(dd);xu=i(f$,"Flax Base class for outputs of decoder-only generation models using sampling."),f$.forEach(r),ju=l(Vc),nr=n(Vc,"DIV",{class:!0});var Hh=o(nr);f(Ts.$$.fragment,Hh),Eu=l(Hh),pd=n(Hh,"P",{});var u$=o(pd);Fu=i(u$,"\u201CReturns a new object replacing the specified fields with new values."),u$.forEach(r),Hh.forEach(r),Vc.forEach(r),xm=l(e),It=n(e,"H3",{class:!0});var Qh=o(It);or=n(Qh,"A",{id:!0,class:!0,href:!0});var _$=o(or);md=n(_$,"SPAN",{});var b$=o(md);f(ws.$$.fragment,b$),b$.forEach(r),_$.forEach(r),Lu=l(Qh),hd=n(Qh,"SPAN",{});var y$=o(hd);zu=i(y$,"BeamSearchOutput"),y$.forEach(r),Qh.forEach(r),jm=l(e),Wt=n(e,"DIV",{class:!0});var Yh=o(Wt);f(ks.$$.fragment,Yh),Ju=l(Yh),gd=n(Yh,"P",{});var v$=o(gd);Uu=i(v$,"Base class for outputs of decoder-only generation models using beam search."),v$.forEach(r),Yh.forEach(r),Em=l(e),Bt=n(e,"DIV",{class:!0});var Kh=o(Bt);f($s.$$.fragment,Kh),Iu=l(Kh),fd=n(Kh,"P",{});var T$=o(fd);Wu=i(T$,`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),T$.forEach(r),Kh.forEach(r),Fm=l(e),Zt=n(e,"H3",{class:!0});var eg=o(Zt);ar=n(eg,"A",{id:!0,class:!0,href:!0});var w$=o(ar);ud=n(w$,"SPAN",{});var k$=o(ud);f(Ms.$$.fragment,k$),k$.forEach(r),w$.forEach(r),Bu=l(eg),_d=n(eg,"SPAN",{});var $$=o(_d);Zu=i($$,"BeamSampleOutput"),$$.forEach(r),eg.forEach(r),Lm=l(e),St=n(e,"DIV",{class:!0});var tg=o(St);f(xs.$$.fragment,tg),Su=l(tg),bd=n(tg,"P",{});var M$=o(bd);Vu=i(M$,"Base class for outputs of decoder-only generation models using beam sample."),M$.forEach(r),tg.forEach(r),zm=l(e),Vt=n(e,"DIV",{class:!0});var rg=o(Vt);f(js.$$.fragment,rg),Pu=l(rg),yd=n(rg,"P",{});var x$=o(yd);Du=i(x$,`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),x$.forEach(r),rg.forEach(r),Jm=l(e),Pt=n(e,"H2",{class:!0});var sg=o(Pt);ir=n(sg,"A",{id:!0,class:!0,href:!0});var j$=o(ir);vd=n(j$,"SPAN",{});var E$=o(vd);f(Es.$$.fragment,E$),E$.forEach(r),j$.forEach(r),qu=l(sg),Td=n(sg,"SPAN",{});var F$=o(Td);Gu=i(F$,"LogitsProcessor"),F$.forEach(r),sg.forEach(r),Um=l(e),cr=n(e,"P",{});var ng=o(cr);Xu=i(ng,"A "),Ma=n(ng,"A",{href:!0});var L$=o(Ma);Ru=i(L$,"LogitsProcessor"),L$.forEach(r),Cu=i(ng,` can be used to modify the prediction scores of a language model head for
generation.`),ng.forEach(r),Im=l(e),$e=n(e,"DIV",{class:!0});var Pc=o($e);f(Fs.$$.fragment,Pc),Nu=l(Pc),wd=n(Pc,"P",{});var z$=o(wd);Au=i(z$,"Abstract base class for all logit processors that can be applied during generation."),z$.forEach(r),Ou=l(Pc),xa=n(Pc,"DIV",{class:!0});var J$=o(xa);f(Ls.$$.fragment,J$),J$.forEach(r),Pc.forEach(r),Wm=l(e),Me=n(e,"DIV",{class:!0});var Dc=o(Me);f(zs.$$.fragment,Dc),Hu=l(Dc),P=n(Dc,"P",{});var re=o(P);Qu=i(re,"This class can be used to create a list of "),ja=n(re,"A",{href:!0});var U$=o(ja);Yu=i(U$,"LogitsProcessor"),U$.forEach(r),Ku=i(re," or "),Ea=n(re,"A",{href:!0});var I$=o(Ea);e_=i(I$,"LogitsWarper"),I$.forEach(r),t_=i(re,` to subsequently process a
`),kd=n(re,"CODE",{});var W$=o(kd);r_=i(W$,"scores"),W$.forEach(r),s_=i(re," input tensor. This class inherits from list and adds a specific "),$d=n(re,"EM",{});var B$=o($d);Md=n(B$,"STRONG",{});var Z$=o(Md);n_=i(Z$,"call"),Z$.forEach(r),B$.forEach(r),o_=i(re,` method to apply each
`),Fa=n(re,"A",{href:!0});var S$=o(Fa);a_=i(S$,"LogitsProcessor"),S$.forEach(r),i_=i(re," or "),La=n(re,"A",{href:!0});var V$=o(La);c_=i(V$,"LogitsWarper"),V$.forEach(r),l_=i(re," to the inputs."),re.forEach(r),d_=l(Dc),za=n(Dc,"DIV",{class:!0});var P$=o(za);f(Js.$$.fragment,P$),P$.forEach(r),Dc.forEach(r),Bm=l(e),xe=n(e,"DIV",{class:!0});var qc=o(xe);f(Us.$$.fragment,qc),p_=l(qc),xd=n(qc,"P",{});var D$=o(xd);m_=i(D$,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),D$.forEach(r),h_=l(qc),Ja=n(qc,"DIV",{class:!0});var q$=o(Ja);f(Is.$$.fragment,q$),q$.forEach(r),qc.forEach(r),Zm=l(e),je=n(e,"DIV",{class:!0});var Gc=o(je);f(Ws.$$.fragment,Gc),g_=l(Gc),Ua=n(Gc,"P",{});var ek=o(Ua);Ia=n(ek,"A",{href:!0});var G$=o(Ia);f_=i(G$,"LogitsProcessor"),G$.forEach(r),u_=i(ek," enforcing a min-length by setting EOS probability to 0."),ek.forEach(r),__=l(Gc),Wa=n(Gc,"DIV",{class:!0});var X$=o(Wa);f(Bs.$$.fragment,X$),X$.forEach(r),Gc.forEach(r),Sm=l(e),oe=n(e,"DIV",{class:!0});var rs=o(oe);f(Zs.$$.fragment,rs),b_=l(rs),fe=n(rs,"P",{});var Yt=o(fe);Ba=n(Yt,"A",{href:!0});var R$=o(Ba);y_=i(R$,"LogitsProcessor"),R$.forEach(r),v_=i(Yt,` enforcing a min-length of new tokens by setting EOS (End-Of-Sequence) token probability to 0.
Note that for decoder-only models, such as Llama2, `),jd=n(Yt,"CODE",{});var C$=o(jd);T_=i(C$,"min_length"),C$.forEach(r),w_=i(Yt," will compute the length of "),Ed=n(Yt,"CODE",{});var N$=o(Ed);k_=i(N$,"prompt + newly generated tokens"),N$.forEach(r),$_=i(Yt," whereas for other models it will behave as "),Fd=n(Yt,"CODE",{});var A$=o(Fd);M_=i(A$,"min_new_tokens"),A$.forEach(r),x_=i(Yt,`, that is, taking only into account
the newly generated ones.`),Yt.forEach(r),j_=l(rs),f(lr.$$.fragment,rs),E_=l(rs),Za=n(rs,"DIV",{class:!0});var O$=o(Za);f(Ss.$$.fragment,O$),O$.forEach(r),rs.forEach(r),Vm=l(e),R=n(e,"DIV",{class:!0});var ft=o(R);f(Vs.$$.fragment,ft),F_=l(ft),Sa=n(ft,"P",{});var tk=o(Sa);Va=n(tk,"A",{href:!0});var H$=o(Va);L_=i(H$,"LogitsWarper"),H$.forEach(r),z_=i(tk,` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),tk.forEach(r),J_=l(ft),f(dr.$$.fragment,ft),U_=l(ft),f(pr.$$.fragment,ft),I_=l(ft),Pa=n(ft,"DIV",{class:!0});var Q$=o(Pa);f(Ps.$$.fragment,Q$),Q$.forEach(r),ft.forEach(r),Pm=l(e),ae=n(e,"DIV",{class:!0});var ss=o(ae);f(Ds.$$.fragment,ss),W_=l(ss),mr=n(ss,"P",{});var Qp=o(mr);Da=n(Qp,"A",{href:!0});var Y$=o(Da);B_=i(Y$,"LogitsProcessor"),Y$.forEach(r),Z_=i(Qp,` that prevents the repetition of previous tokens through an exponential penalty. This technique
shares some similarities with coverage mechanisms and other aimed at reducing repetition. During the text
generation process, the probability distribution for the next token is determined using a formula that incorporates
token scores based on their occurrence in the generated sequence. Tokens with higher scores are less likely to be
selected. The formula can be seen in the original `),qs=n(Qp,"A",{href:!0,rel:!0});var K$=o(qs);S_=i(K$,"paper"),K$.forEach(r),V_=i(Qp,`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),Qp.forEach(r),P_=l(ss),f(hr.$$.fragment,ss),D_=l(ss),qa=n(ss,"DIV",{class:!0});var e1=o(qa);f(Gs.$$.fragment,e1),e1.forEach(r),ss.forEach(r),Dm=l(e),ie=n(e,"DIV",{class:!0});var ns=o(ie);f(Xs.$$.fragment,ns),q_=l(ns),Ga=n(ns,"P",{});var rk=o(Ga);Xa=n(rk,"A",{href:!0});var t1=o(Xa);G_=i(t1,"LogitsWarper"),t1.forEach(r),X_=i(rk," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),rk.forEach(r),R_=l(ns),f(gr.$$.fragment,ns),C_=l(ns),Ra=n(ns,"DIV",{class:!0});var r1=o(Ra);f(Rs.$$.fragment,r1),r1.forEach(r),ns.forEach(r),qm=l(e),Ee=n(e,"DIV",{class:!0});var Xc=o(Ee);f(Cs.$$.fragment,Xc),N_=l(Xc),Ca=n(Xc,"P",{});var sk=o(Ca);Na=n(sk,"A",{href:!0});var s1=o(Na);A_=i(s1,"LogitsWarper"),s1.forEach(r),O_=i(sk," that performs top-k, i.e. restricting to the k highest probability elements."),sk.forEach(r),H_=l(Xc),Aa=n(Xc,"DIV",{class:!0});var n1=o(Aa);f(Ns.$$.fragment,n1),n1.forEach(r),Xc.forEach(r),Gm=l(e),Fe=n(e,"DIV",{class:!0});var Rc=o(Fe);f(As.$$.fragment,Rc),Q_=l(Rc),fr=n(Rc,"P",{});var Yp=o(fr);Oa=n(Yp,"A",{href:!0});var o1=o(Oa);Y_=i(o1,"LogitsWarper"),o1.forEach(r),K_=i(Yp," that performs typical decoding. See "),Os=n(Yp,"A",{href:!0,rel:!0});var a1=o(Os);eb=i(a1,`Typical Decoding for Natural Language
Generation`),a1.forEach(r),tb=i(Yp," for more information."),Yp.forEach(r),rb=l(Rc),Ha=n(Rc,"DIV",{class:!0});var i1=o(Ha);f(Hs.$$.fragment,i1),i1.forEach(r),Rc.forEach(r),Xm=l(e),C=n(e,"DIV",{class:!0});var ut=o(C);f(Qs.$$.fragment,ut),sb=l(ut),Dt=n(ut,"P",{});var Cc=o(Dt);nb=i(Cc,`N-grams are groups of \u201Cn\u201D consecutive words, characters, or tokens taken from a sequence of text. Given the
sentence: \u201CShe runs fast\u201D, the bi-grams (n=2) would be (\u201Cshe\u201D, \u201Cruns\u201D) and (\u201Cruns\u201D, \u201Cfast\u201D). In text generation,
avoiding repetitions of word sequences provides a more diverse output. This `),Qa=n(Cc,"A",{href:!0});var c1=o(Qa);ob=i(c1,"LogitsProcessor"),c1.forEach(r),ab=i(Cc,` enforces no
repetition of n-grams by setting the scores of banned tokens to negative infinity which eliminates those tokens
from consideration when further processing the scores.
`),Ys=n(Cc,"A",{href:!0,rel:!0});var l1=o(Ys);ib=i(l1,"Fairseq"),l1.forEach(r),cb=i(Cc,"."),Cc.forEach(r),lb=l(ut),f(ur.$$.fragment,ut),db=l(ut),f(_r.$$.fragment,ut),pb=l(ut),Ya=n(ut,"DIV",{class:!0});var d1=o(Ya);f(Ks.$$.fragment,d1),d1.forEach(r),ut.forEach(r),Rm=l(e),N=n(e,"DIV",{class:!0});var _t=o(N);f(en.$$.fragment,_t),mb=l(_t),Ka=n(_t,"P",{});var nk=o(Ka);ei=n(nk,"A",{href:!0});var p1=o(ei);hb=i(p1,"LogitsProcessor"),p1.forEach(r),gb=i(nk,` that applies an additive bias on sequences. The bias is applied to the last token of a sequence
when the next generated token can complete it. Consequently, to take the most of biasing sequences with more than
one token, consider using beam methods (to gracefully work around partially completed sequences that have a
negative bias) and applying the bias to their prefixes (to ensure the bias is applied earlier).`),nk.forEach(r),fb=l(_t),f(br.$$.fragment,_t),ub=l(_t),f(yr.$$.fragment,_t),_b=l(_t),ti=n(_t,"DIV",{class:!0});var m1=o(ti);f(tn.$$.fragment,m1),m1.forEach(r),_t.forEach(r),Cm=l(e),A=n(e,"DIV",{class:!0});var bt=o(A);f(rn.$$.fragment,bt),bb=l(bt),ri=n(bt,"P",{});var ok=o(ri);si=n(ok,"A",{href:!0});var h1=o(si);yb=i(h1,"LogitsProcessor"),h1.forEach(r),vb=i(ok," that enforces that specified sequences will never be selected."),ok.forEach(r),Tb=l(bt),f(vr.$$.fragment,bt),wb=l(bt),f(Tr.$$.fragment,bt),kb=l(bt),ni=n(bt,"DIV",{class:!0});var g1=o(ni);f(sn.$$.fragment,g1),g1.forEach(r),bt.forEach(r),Nm=l(e),Le=n(e,"DIV",{class:!0});var Nc=o(Le);f(nn.$$.fragment,Nc),$b=l(Nc),wr=n(Nc,"P",{});var Kp=o(wr);oi=n(Kp,"A",{href:!0});var f1=o(oi);Mb=i(f1,"LogitsProcessor"),f1.forEach(r),xb=i(Kp,` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),on=n(Kp,"A",{href:!0,rel:!0});var u1=o(on);jb=i(u1,"Autoregressive Entity Retrieval"),u1.forEach(r),Eb=i(Kp," for more information."),Kp.forEach(r),Fb=l(Nc),ai=n(Nc,"DIV",{class:!0});var _1=o(ai);f(an.$$.fragment,_1),_1.forEach(r),Nc.forEach(r),Am=l(e),ze=n(e,"DIV",{class:!0});var Ac=o(ze);f(cn.$$.fragment,Ac),Lb=l(Ac),lt=n(Ac,"P",{});var ca=o(lt);ii=n(ca,"A",{href:!0});var b1=o(ii);zb=i(b1,"LogitsProcessor"),b1.forEach(r),Jb=i(ca,` that enforces diverse beam search. Note that this logits processor is only effective for
`),ci=n(ca,"A",{href:!0});var y1=o(ci);Ub=i(y1,"PreTrainedModel.group_beam_search()"),y1.forEach(r),Ib=i(ca,". See "),ln=n(ca,"A",{href:!0,rel:!0});var v1=o(ln);Wb=i(v1,`Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence
Models`),v1.forEach(r),Bb=i(ca," for more details."),ca.forEach(r),Zb=l(Ac),li=n(Ac,"DIV",{class:!0});var T1=o(li);f(dn.$$.fragment,T1),T1.forEach(r),Ac.forEach(r),Om=l(e),Je=n(e,"DIV",{class:!0});var Oc=o(Je);f(pn.$$.fragment,Oc),Sb=l(Oc),di=n(Oc,"P",{});var ak=o(di);pi=n(ak,"A",{href:!0});var w1=o(pi);Vb=i(w1,"LogitsProcessor"),w1.forEach(r),Pb=i(ak," that enforces the specified token as the first generated token."),ak.forEach(r),Db=l(Oc),mi=n(Oc,"DIV",{class:!0});var k1=o(mi);f(mn.$$.fragment,k1),k1.forEach(r),Oc.forEach(r),Hm=l(e),Ue=n(e,"DIV",{class:!0});var Hc=o(Ue);f(hn.$$.fragment,Hc),qb=l(Hc),kr=n(Hc,"P",{});var em=o(kr);hi=n(em,"A",{href:!0});var $1=o(hi);Gb=i($1,"LogitsProcessor"),$1.forEach(r),Xb=i(em," that enforces the specified token as the last generated token when "),Ld=n(em,"CODE",{});var M1=o(Ld);Rb=i(M1,"max_length"),M1.forEach(r),Cb=i(em," is reached."),em.forEach(r),Nb=l(Hc),gi=n(Hc,"DIV",{class:!0});var x1=o(gi);f(gn.$$.fragment,x1),x1.forEach(r),Hc.forEach(r),Qm=l(e),Ie=n(e,"DIV",{class:!0});var Qc=o(Ie);f(fn.$$.fragment,Qc),Ab=l(Qc),dt=n(Qc,"P",{});var la=o(dt);fi=n(la,"A",{href:!0});var j1=o(fi);Ob=i(j1,"LogitsProcessor"),j1.forEach(r),Hb=i(la," that removes all "),zd=n(la,"CODE",{});var E1=o(zd);Qb=i(E1,"nan"),E1.forEach(r),Yb=i(la," and "),Jd=n(la,"CODE",{});var F1=o(Jd);Kb=i(F1,"inf"),F1.forEach(r),ey=i(la,` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method.`),la.forEach(r),ty=l(Qc),ui=n(Qc,"DIV",{class:!0});var L1=o(ui);f(un.$$.fragment,L1),L1.forEach(r),Qc.forEach(r),Ym=l(e),We=n(e,"DIV",{class:!0});var Yc=o(We);f(_n.$$.fragment,Yc),ry=l(Yc),Ud=n(Yc,"P",{});var z1=o(Ud);sy=i(z1,"Abstract base class for all logit processors that can be applied during generation."),z1.forEach(r),ny=l(Yc),$r=n(Yc,"DIV",{class:!0});var og=o($r);f(bn.$$.fragment,og),oy=l(og),Id=n(og,"P",{});var J1=o(Id);ay=i(J1,"TF method for processing logits."),J1.forEach(r),og.forEach(r),Yc.forEach(r),Km=l(e),Be=n(e,"DIV",{class:!0});var Kc=o(Be);f(yn.$$.fragment,Kc),iy=l(Kc),ce=n(Kc,"P",{});var yt=o(ce);cy=i(yt,"This class can be used to create a list of "),_i=n(yt,"A",{href:!0});var U1=o(_i);ly=i(U1,"TFLogitsProcessor"),U1.forEach(r),dy=i(yt," to subsequently process a "),Wd=n(yt,"CODE",{});var I1=o(Wd);py=i(I1,"scores"),I1.forEach(r),my=i(yt,` input tensor.
This class inherits from list and adds a specific `),Bd=n(yt,"EM",{});var W1=o(Bd);Zd=n(W1,"STRONG",{});var B1=o(Zd);hy=i(B1,"call"),B1.forEach(r),W1.forEach(r),gy=i(yt," method to apply each "),bi=n(yt,"A",{href:!0});var Z1=o(bi);fy=i(Z1,"TFLogitsProcessor"),Z1.forEach(r),uy=i(yt,` to the
inputs.`),yt.forEach(r),_y=l(Kc),yi=n(Kc,"DIV",{class:!0});var S1=o(yi);f(vn.$$.fragment,S1),S1.forEach(r),Kc.forEach(r),eh=l(e),Ze=n(e,"DIV",{class:!0});var el=o(Ze);f(Tn.$$.fragment,el),by=l(el),Sd=n(el,"P",{});var V1=o(Sd);yy=i(V1,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),V1.forEach(r),vy=l(el),Mr=n(el,"DIV",{class:!0});var ag=o(Mr);f(wn.$$.fragment,ag),Ty=l(ag),Vd=n(ag,"P",{});var P1=o(Vd);wy=i(P1,"TF method for warping logits."),P1.forEach(r),ag.forEach(r),el.forEach(r),th=l(e),Se=n(e,"DIV",{class:!0});var tl=o(Se);f(kn.$$.fragment,tl),ky=l(tl),vi=n(tl,"P",{});var ik=o(vi);Ti=n(ik,"A",{href:!0});var D1=o(Ti);$y=i(D1,"TFLogitsWarper"),D1.forEach(r),My=i(ik," for temperature (exponential scaling output probability distribution)."),ik.forEach(r),xy=l(tl),wi=n(tl,"DIV",{class:!0});var q1=o(wi);f($n.$$.fragment,q1),q1.forEach(r),tl.forEach(r),rh=l(e),Ve=n(e,"DIV",{class:!0});var rl=o(Ve);f(Mn.$$.fragment,rl),jy=l(rl),ki=n(rl,"P",{});var ck=o(ki);$i=n(ck,"A",{href:!0});var G1=o($i);Ey=i(G1,"TFLogitsWarper"),G1.forEach(r),Fy=i(ck," that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),ck.forEach(r),Ly=l(rl),Mi=n(rl,"DIV",{class:!0});var X1=o(Mi);f(xn.$$.fragment,X1),X1.forEach(r),rl.forEach(r),sh=l(e),Pe=n(e,"DIV",{class:!0});var sl=o(Pe);f(jn.$$.fragment,sl),zy=l(sl),xi=n(sl,"P",{});var lk=o(xi);ji=n(lk,"A",{href:!0});var R1=o(ji);Jy=i(R1,"TFLogitsWarper"),R1.forEach(r),Uy=i(lk," that performs top-k, i.e. restricting to the k highest probability elements."),lk.forEach(r),Iy=l(sl),Ei=n(sl,"DIV",{class:!0});var C1=o(Ei);f(En.$$.fragment,C1),C1.forEach(r),sl.forEach(r),nh=l(e),De=n(e,"DIV",{class:!0});var nl=o(De);f(Fn.$$.fragment,nl),Wy=l(nl),Fi=n(nl,"P",{});var dk=o(Fi);Li=n(dk,"A",{href:!0});var N1=o(Li);By=i(N1,"TFLogitsProcessor"),N1.forEach(r),Zy=i(dk," enforcing a min-length by setting EOS probability to 0."),dk.forEach(r),Sy=l(nl),zi=n(nl,"DIV",{class:!0});var A1=o(zi);f(Ln.$$.fragment,A1),A1.forEach(r),nl.forEach(r),oh=l(e),qe=n(e,"DIV",{class:!0});var ol=o(qe);f(zn.$$.fragment,ol),Vy=l(ol),Ji=n(ol,"P",{});var pk=o(Ji);Ui=n(pk,"A",{href:!0});var O1=o(Ui);Py=i(O1,"TFLogitsProcessor"),O1.forEach(r),Dy=i(pk," that enforces that specified sequences will never be sampled."),pk.forEach(r),qy=l(ol),Ii=n(ol,"DIV",{class:!0});var H1=o(Ii);f(Jn.$$.fragment,H1),H1.forEach(r),ol.forEach(r),ah=l(e),Ge=n(e,"DIV",{class:!0});var al=o(Ge);f(Un.$$.fragment,al),Gy=l(al),xr=n(al,"P",{});var tm=o(xr);Wi=n(tm,"A",{href:!0});var Q1=o(Wi);Xy=i(Q1,"TFLogitsProcessor"),Q1.forEach(r),Ry=i(tm,` that enforces no repetition of n-grams. See
`),In=n(tm,"A",{href:!0,rel:!0});var Y1=o(In);Cy=i(Y1,"Fairseq"),Y1.forEach(r),Ny=i(tm,"."),tm.forEach(r),Ay=l(al),Bi=n(al,"DIV",{class:!0});var K1=o(Bi);f(Wn.$$.fragment,K1),K1.forEach(r),al.forEach(r),ih=l(e),Xe=n(e,"DIV",{class:!0});var il=o(Xe);f(Bn.$$.fragment,il),Oy=l(il),Zi=n(il,"P",{});var mk=o(Zi);Si=n(mk,"A",{href:!0});var e0=o(Si);Hy=i(e0,"TFLogitsProcessor"),e0.forEach(r),Qy=i(mk," enforcing an exponential penalty on repeated sequences."),mk.forEach(r),Yy=l(il),Vi=n(il,"DIV",{class:!0});var t0=o(Vi);f(Zn.$$.fragment,t0),t0.forEach(r),il.forEach(r),ch=l(e),Re=n(e,"DIV",{class:!0});var cl=o(Re);f(Sn.$$.fragment,cl),Ky=l(cl),Pi=n(cl,"P",{});var hk=o(Pi);Di=n(hk,"A",{href:!0});var r0=o(Di);ev=i(r0,"TFLogitsProcessor"),r0.forEach(r),tv=i(hk," that enforces the specified token as the first generated token."),hk.forEach(r),rv=l(cl),qi=n(cl,"DIV",{class:!0});var s0=o(qi);f(Vn.$$.fragment,s0),s0.forEach(r),cl.forEach(r),lh=l(e),Ce=n(e,"DIV",{class:!0});var ll=o(Ce);f(Pn.$$.fragment,ll),sv=l(ll),jr=n(ll,"P",{});var rm=o(jr);Gi=n(rm,"A",{href:!0});var n0=o(Gi);nv=i(n0,"TFLogitsProcessor"),n0.forEach(r),ov=i(rm," that enforces the specified token as the last generated token when "),Pd=n(rm,"CODE",{});var o0=o(Pd);av=i(o0,"max_length"),o0.forEach(r),iv=i(rm," is reached."),rm.forEach(r),cv=l(ll),Xi=n(ll,"DIV",{class:!0});var a0=o(Xi);f(Dn.$$.fragment,a0),a0.forEach(r),ll.forEach(r),dh=l(e),Ne=n(e,"DIV",{class:!0});var dl=o(Ne);f(qn.$$.fragment,dl),lv=l(dl),Dd=n(dl,"P",{});var i0=o(Dd);dv=i(i0,"Abstract base class for all logit processors that can be applied during generation."),i0.forEach(r),pv=l(dl),Er=n(dl,"DIV",{class:!0});var ig=o(Er);f(Gn.$$.fragment,ig),mv=l(ig),qd=n(ig,"P",{});var c0=o(qd);hv=i(c0,"Flax method for processing logits."),c0.forEach(r),ig.forEach(r),dl.forEach(r),ph=l(e),Ae=n(e,"DIV",{class:!0});var pl=o(Ae);f(Xn.$$.fragment,pl),gv=l(pl),D=n(pl,"P",{});var se=o(D);fv=i(se,"This class can be used to create a list of "),Ri=n(se,"A",{href:!0});var l0=o(Ri);uv=i(l0,"FlaxLogitsProcessor"),l0.forEach(r),_v=i(se," or "),Ci=n(se,"A",{href:!0});var d0=o(Ci);bv=i(d0,"FlaxLogitsWarper"),d0.forEach(r),yv=i(se,` to subsequently process
a `),Gd=n(se,"CODE",{});var p0=o(Gd);vv=i(p0,"scores"),p0.forEach(r),Tv=i(se," input tensor. This class inherits from list and adds a specific "),Xd=n(se,"EM",{});var m0=o(Xd);Rd=n(m0,"STRONG",{});var h0=o(Rd);wv=i(h0,"call"),h0.forEach(r),m0.forEach(r),kv=i(se,` method to apply each
`),Ni=n(se,"A",{href:!0});var g0=o(Ni);$v=i(g0,"FlaxLogitsProcessor"),g0.forEach(r),Mv=i(se," or "),Ai=n(se,"A",{href:!0});var f0=o(Ai);xv=i(f0,"FlaxLogitsWarper"),f0.forEach(r),jv=i(se," to the inputs."),se.forEach(r),Ev=l(pl),Oi=n(pl,"DIV",{class:!0});var u0=o(Oi);f(Rn.$$.fragment,u0),u0.forEach(r),pl.forEach(r),mh=l(e),Oe=n(e,"DIV",{class:!0});var ml=o(Oe);f(Cn.$$.fragment,ml),Fv=l(ml),Cd=n(ml,"P",{});var _0=o(Cd);Lv=i(_0,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),_0.forEach(r),zv=l(ml),Fr=n(ml,"DIV",{class:!0});var cg=o(Fr);f(Nn.$$.fragment,cg),Jv=l(cg),Nd=n(cg,"P",{});var b0=o(Nd);Uv=i(b0,"Flax method for warping logits."),b0.forEach(r),cg.forEach(r),ml.forEach(r),hh=l(e),He=n(e,"DIV",{class:!0});var hl=o(He);f(An.$$.fragment,hl),Iv=l(hl),Hi=n(hl,"P",{});var gk=o(Hi);Qi=n(gk,"A",{href:!0});var y0=o(Qi);Wv=i(y0,"FlaxLogitsWarper"),y0.forEach(r),Bv=i(gk," for temperature (exponential scaling output probability distribution)."),gk.forEach(r),Zv=l(hl),Yi=n(hl,"DIV",{class:!0});var v0=o(Yi);f(On.$$.fragment,v0),v0.forEach(r),hl.forEach(r),gh=l(e),Qe=n(e,"DIV",{class:!0});var gl=o(Qe);f(Hn.$$.fragment,gl),Sv=l(gl),Ki=n(gl,"P",{});var fk=o(Ki);ec=n(fk,"A",{href:!0});var T0=o(ec);Vv=i(T0,"FlaxLogitsWarper"),T0.forEach(r),Pv=i(fk," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),fk.forEach(r),Dv=l(gl),tc=n(gl,"DIV",{class:!0});var w0=o(tc);f(Qn.$$.fragment,w0),w0.forEach(r),gl.forEach(r),fh=l(e),Ye=n(e,"DIV",{class:!0});var fl=o(Ye);f(Yn.$$.fragment,fl),qv=l(fl),rc=n(fl,"P",{});var uk=o(rc);sc=n(uk,"A",{href:!0});var k0=o(sc);Gv=i(k0,"FlaxLogitsWarper"),k0.forEach(r),Xv=i(uk," that performs top-k, i.e. restricting to the k highest probability elements."),uk.forEach(r),Rv=l(fl),nc=n(fl,"DIV",{class:!0});var $0=o(nc);f(Kn.$$.fragment,$0),$0.forEach(r),fl.forEach(r),uh=l(e),Ke=n(e,"DIV",{class:!0});var ul=o(Ke);f(eo.$$.fragment,ul),Cv=l(ul),oc=n(ul,"P",{});var _k=o(oc);ac=n(_k,"A",{href:!0});var M0=o(ac);Nv=i(M0,"FlaxLogitsProcessor"),M0.forEach(r),Av=i(_k," that enforces the specified token as the first generated token."),_k.forEach(r),Ov=l(ul),ic=n(ul,"DIV",{class:!0});var x0=o(ic);f(to.$$.fragment,x0),x0.forEach(r),ul.forEach(r),_h=l(e),et=n(e,"DIV",{class:!0});var _l=o(et);f(ro.$$.fragment,_l),Hv=l(_l),Lr=n(_l,"P",{});var sm=o(Lr);cc=n(sm,"A",{href:!0});var j0=o(cc);Qv=i(j0,"FlaxLogitsProcessor"),j0.forEach(r),Yv=i(sm," that enforces the specified token as the last generated token when "),Ad=n(sm,"CODE",{});var E0=o(Ad);Kv=i(E0,"max_length"),E0.forEach(r),eT=i(sm," is reached."),sm.forEach(r),tT=l(_l),lc=n(_l,"DIV",{class:!0});var F0=o(lc);f(so.$$.fragment,F0),F0.forEach(r),_l.forEach(r),bh=l(e),tt=n(e,"DIV",{class:!0});var bl=o(tt);f(no.$$.fragment,bl),rT=l(bl),dc=n(bl,"P",{});var bk=o(dc);pc=n(bk,"A",{href:!0});var L0=o(pc);sT=i(L0,"FlaxLogitsProcessor"),L0.forEach(r),nT=i(bk," enforcing a min-length by setting EOS probability to 0."),bk.forEach(r),oT=l(bl),mc=n(bl,"DIV",{class:!0});var z0=o(mc);f(oo.$$.fragment,z0),z0.forEach(r),bl.forEach(r),yh=l(e),qt=n(e,"H2",{class:!0});var lg=o(qt);zr=n(lg,"A",{id:!0,class:!0,href:!0});var J0=o(zr);Od=n(J0,"SPAN",{});var U0=o(Od);f(ao.$$.fragment,U0),U0.forEach(r),J0.forEach(r),aT=l(lg),Hd=n(lg,"SPAN",{});var I0=o(Hd);iT=i(I0,"StoppingCriteria"),I0.forEach(r),lg.forEach(r),vh=l(e),Jr=n(e,"P",{});var dg=o(Jr);cT=i(dg,"A "),hc=n(dg,"A",{href:!0});var W0=o(hc);lT=i(W0,"StoppingCriteria"),W0.forEach(r),dT=i(dg," can be used to change when to stop generation (other than EOS token)."),dg.forEach(r),Th=l(e),rt=n(e,"DIV",{class:!0});var yl=o(rt);f(io.$$.fragment,yl),pT=l(yl),Qd=n(yl,"P",{});var B0=o(Qd);mT=i(B0,"Abstract base class for all stopping criteria that can be applied during generation."),B0.forEach(r),hT=l(yl),gc=n(yl,"DIV",{class:!0});var Z0=o(gc);f(co.$$.fragment,Z0),Z0.forEach(r),yl.forEach(r),wh=l(e),Gt=n(e,"DIV",{class:!0});var pg=o(Gt);f(lo.$$.fragment,pg),gT=l(pg),fc=n(pg,"DIV",{class:!0});var S0=o(fc);f(po.$$.fragment,S0),S0.forEach(r),pg.forEach(r),kh=l(e),st=n(e,"DIV",{class:!0});var vl=o(st);f(mo.$$.fragment,vl),fT=l(vl),ho=n(vl,"P",{});var mg=o(ho);uT=i(mg,"This class can be used to stop generation whenever the full generated number of tokens exceeds "),Yd=n(mg,"CODE",{});var V0=o(Yd);_T=i(V0,"max_length"),V0.forEach(r),bT=i(mg,`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),mg.forEach(r),yT=l(vl),uc=n(vl,"DIV",{class:!0});var P0=o(uc);f(go.$$.fragment,P0),P0.forEach(r),vl.forEach(r),$h=l(e),nt=n(e,"DIV",{class:!0});var Tl=o(nt);f(fo.$$.fragment,Tl),vT=l(Tl),uo=n(Tl,"P",{});var hg=o(uo);TT=i(hg,`This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
time will start being counted when you initialize this function. You can override this by passing an
`),Kd=n(hg,"CODE",{});var D0=o(Kd);wT=i(D0,"initial_time"),D0.forEach(r),kT=i(hg,"."),hg.forEach(r),$T=l(Tl),_c=n(Tl,"DIV",{class:!0});var q0=o(_c);f(_o.$$.fragment,q0),q0.forEach(r),Tl.forEach(r),Mh=l(e),Xt=n(e,"H2",{class:!0});var gg=o(Xt);Ur=n(gg,"A",{id:!0,class:!0,href:!0});var G0=o(Ur);ep=n(G0,"SPAN",{});var X0=o(ep);f(bo.$$.fragment,X0),X0.forEach(r),G0.forEach(r),MT=l(gg),tp=n(gg,"SPAN",{});var R0=o(tp);xT=i(R0,"Constraints"),R0.forEach(r),gg.forEach(r),xh=l(e),Ir=n(e,"P",{});var fg=o(Ir);jT=i(fg,"A "),bc=n(fg,"A",{href:!0});var C0=o(bc);ET=i(C0,"Constraint"),C0.forEach(r),FT=i(fg," can be used to force the generation to include specific tokens or sequences in the output."),fg.forEach(r),jh=l(e),L=n(e,"DIV",{class:!0});var z=o(L);f(yo.$$.fragment,z),LT=l(z),rp=n(z,"P",{});var N0=o(rp);zT=i(N0,`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),N0.forEach(r),JT=l(z),sp=n(z,"P",{});var A0=o(sp);UT=i(A0,"All classes that inherit Constraint must follow the requirement that"),A0.forEach(r),IT=l(z),f(Wr.$$.fragment,z),WT=l(z),np=n(z,"P",{});var O0=o(np);BT=i(O0,"will always terminate (halt)."),O0.forEach(r),ZT=l(z),Br=n(z,"DIV",{class:!0});var ug=o(Br);f(vo.$$.fragment,ug),ST=l(ug),op=n(ug,"P",{});var H0=o(op);VT=i(H0,"When called, returns the token that would take this constraint one step closer to being fulfilled."),H0.forEach(r),ug.forEach(r),PT=l(z),Zr=n(z,"DIV",{class:!0});var _g=o(Zr);f(To.$$.fragment,_g),DT=l(_g),ap=n(_g,"P",{});var Q0=o(ap);qT=i(Q0,"Creates a new instance of this constraint."),Q0.forEach(r),_g.forEach(r),GT=l(z),Sr=n(z,"DIV",{class:!0});var bg=o(Sr);f(wo.$$.fragment,bg),XT=l(bg),ip=n(bg,"P",{});var Y0=o(ip);RT=i(Y0,"Reads in a token and returns whether it creates progress."),Y0.forEach(r),bg.forEach(r),CT=l(z),Vr=n(z,"DIV",{class:!0});var yg=o(Vr);f(ko.$$.fragment,yg),NT=l(yg),$o=n(yg,"P",{});var vg=o($o);AT=i(vg,"Returns the number of remaining steps of "),cp=n(vg,"CODE",{});var K0=o(cp);OT=i(K0,"advance()"),K0.forEach(r),HT=i(vg," in order to complete this constraint."),vg.forEach(r),yg.forEach(r),QT=l(z),Pr=n(z,"DIV",{class:!0});var Tg=o(Pr);f(Mo.$$.fragment,Tg),YT=l(Tg),lp=n(Tg,"P",{});var eM=o(lp);KT=i(eM,`Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of
a constraint is abrupted by an unwanted token.`),eM.forEach(r),Tg.forEach(r),e2=l(z),Dr=n(z,"DIV",{class:!0});var wg=o(Dr);f(xo.$$.fragment,wg),t2=l(wg),dp=n(wg,"P",{});var tM=o(dp);r2=i(tM,"Tests whether this constraint has been properly defined."),tM.forEach(r),wg.forEach(r),s2=l(z),pt=n(z,"DIV",{class:!0});var wl=o(pt);f(jo.$$.fragment,wl),n2=l(wl),Eo=n(wl,"P",{});var kg=o(Eo);o2=i(kg,`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),pp=n(kg,"CODE",{});var rM=o(pp);a2=i(rM,"does_advance(self, token_id: int)"),rM.forEach(r),i2=i(kg,"."),kg.forEach(r),c2=l(wl),mp=n(wl,"P",{});var sM=o(mp);l2=i(sM,`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),sM.forEach(r),wl.forEach(r),z.forEach(r),Eh=l(e),Rt=n(e,"DIV",{class:!0});var $g=o(Rt);f(Fo.$$.fragment,$g),d2=l($g),yc=n($g,"P",{});var yk=o(yc);vc=n(yk,"A",{href:!0});var nM=o(vc);p2=i(nM,"Constraint"),nM.forEach(r),m2=i(yk," enforcing that an ordered sequence of tokens is included in the output."),yk.forEach(r),$g.forEach(r),Fh=l(e),Ct=n(e,"DIV",{class:!0});var Mg=o(Ct);f(Lo.$$.fragment,Mg),h2=l(Mg),zo=n(Mg,"P",{});var xg=o(zo);g2=i(xg,"A special "),Tc=n(xg,"A",{href:!0});var oM=o(Tc);f2=i(oM,"Constraint"),oM.forEach(r),u2=i(xg," that is fulfilled by fulfilling just one of several constraints."),xg.forEach(r),Mg.forEach(r),Lh=l(e),le=n(e,"DIV",{class:!0});var os=o(le);f(Jo.$$.fragment,os),_2=l(os),hp=n(os,"P",{});var aM=o(hp);b2=i(aM,"A class for beam scorers to track its progress through a list of constraints."),aM.forEach(r),y2=l(os),G=n(os,"DIV",{class:!0});var ue=o(G);f(Uo.$$.fragment,ue),v2=l(ue),gp=n(ue,"P",{});var iM=o(gp);T2=i(iM,`The list of tokens to generate such that we can make progress.
By \u201Clist\u201D we don\u2019t mean the list of token that will fully fulfill a constraint.`),iM.forEach(r),w2=l(ue),Nt=n(ue,"P",{});var kl=o(Nt);k2=i(kl,"Given constraints "),fp=n(kl,"CODE",{});var cM=o(fp);$2=i(cM,"c_i = {t_ij | j == # of tokens}"),cM.forEach(r),M2=i(kl,`, If we\u2019re not in the middle of progressing through a
specific constraint `),up=n(kl,"CODE",{});var lM=o(up);x2=i(lM,"c_i"),lM.forEach(r),j2=i(kl,", we return:"),kl.forEach(r),E2=l(ue),_p=n(ue,"P",{});var dM=o(_p);bp=n(dM,"CODE",{});var pM=o(bp);F2=i(pM,"[t_k1 for k in indices of unfulfilled constraints]"),pM.forEach(r),dM.forEach(r),L2=l(ue),ot=n(ue,"P",{});var as=o(ot);z2=i(as,`If we are in the middle of a constraint, then we return:
`),yp=n(as,"CODE",{});var mM=o(yp);J2=i(mM,"[t_ij]"),mM.forEach(r),U2=i(as,", where "),vp=n(as,"CODE",{});var hM=o(vp);I2=i(hM,"i"),hM.forEach(r),W2=i(as," is the index of the inprogress constraint, "),Tp=n(as,"CODE",{});var gM=o(Tp);B2=i(gM,"j"),gM.forEach(r),Z2=i(as," is the next step for the constraint."),as.forEach(r),S2=l(ue),wp=n(ue,"P",{});var fM=o(wp);V2=i(fM,`Though we don\u2019t care which constraint is fulfilled first, if we are in the progress of fulfilling a constraint,
that\u2019s the only one we\u2019ll return.`),fM.forEach(r),ue.forEach(r),P2=l(os),qr=n(os,"DIV",{class:!0});var jg=o(qr);f(Io.$$.fragment,jg),D2=l(jg),kp=n(jg,"P",{});var uM=o(kp);q2=i(uM,"token_ids: the tokens generated thus far to reset the state of the progress through constraints."),uM.forEach(r),jg.forEach(r),os.forEach(r),zh=l(e),At=n(e,"H2",{class:!0});var Eg=o(At);Gr=n(Eg,"A",{id:!0,class:!0,href:!0});var _M=o(Gr);$p=n(_M,"SPAN",{});var bM=o($p);f(Wo.$$.fragment,bM),bM.forEach(r),_M.forEach(r),G2=l(Eg),Mp=n(Eg,"SPAN",{});var yM=o(Mp);X2=i(yM,"BeamSearch"),yM.forEach(r),Eg.forEach(r),Jh=l(e),de=n(e,"DIV",{class:!0});var is=o(de);f(Bo.$$.fragment,is),R2=l(is),Ot=n(is,"P",{});var $l=o(Ot);C2=i($l,"Abstract base class for all beam scorers that are used for "),wc=n($l,"A",{href:!0});var vM=o(wc);N2=i(vM,"beam_search()"),vM.forEach(r),A2=i($l,` and
`),kc=n($l,"A",{href:!0});var TM=o(kc);O2=i(TM,"beam_sample()"),TM.forEach(r),H2=i($l,"."),$l.forEach(r),Q2=l(is),$c=n(is,"DIV",{class:!0});var wM=o($c);f(Zo.$$.fragment,wM),wM.forEach(r),Y2=l(is),Mc=n(is,"DIV",{class:!0});var kM=o(Mc);f(So.$$.fragment,kM),kM.forEach(r),is.forEach(r),Uh=l(e),q=n(e,"DIV",{class:!0});var _e=o(q);f(Vo.$$.fragment,_e),K2=l(_e),xc=n(_e,"P",{});var vk=o(xc);jc=n(vk,"A",{href:!0});var $M=o(jc);ew=i($M,"BeamScorer"),$M.forEach(r),tw=i(vk," implementing standard beam search decoding."),vk.forEach(r),rw=l(_e),Po=n(_e,"P",{});var Fg=o(Po);sw=i(Fg,"Adapted in part from "),Do=n(Fg,"A",{href:!0,rel:!0});var MM=o(Do);nw=i(MM,`Facebook\u2019s XLM beam search
code`),MM.forEach(r),ow=i(Fg,"."),Fg.forEach(r),aw=l(_e),Ec=n(_e,"P",{});var Tk=o(Ec);iw=i(Tk,"Reference for the diverse beam search algorithm and implementation "),qo=n(Tk,"A",{href:!0,rel:!0});var xM=o(qo);cw=i(xM,`Ashwin Kalyan\u2019s DBS
implementation`),xM.forEach(r),Tk.forEach(r),lw=l(_e),Fc=n(_e,"DIV",{class:!0});var jM=o(Fc);f(Go.$$.fragment,jM),jM.forEach(r),dw=l(_e),Lc=n(_e,"DIV",{class:!0});var EM=o(Lc);f(Xo.$$.fragment,EM),EM.forEach(r),_e.forEach(r),Ih=l(e),pe=n(e,"DIV",{class:!0});var cs=o(pe);f(Ro.$$.fragment,cs),pw=l(cs),zc=n(cs,"P",{});var wk=o(zc);Jc=n(wk,"A",{href:!0});var FM=o(Jc);mw=i(FM,"BeamScorer"),FM.forEach(r),hw=i(wk," implementing constrained beam search decoding."),wk.forEach(r),gw=l(cs),Uc=n(cs,"DIV",{class:!0});var LM=o(Uc);f(Co.$$.fragment,LM),LM.forEach(r),fw=l(cs),Ic=n(cs,"DIV",{class:!0});var zM=o(Ic);f(No.$$.fragment,zM),zM.forEach(r),cs.forEach(r),Wh=l(e),Ht=n(e,"H2",{class:!0});var Lg=o(Ht);Xr=n(Lg,"A",{id:!0,class:!0,href:!0});var JM=o(Xr);xp=n(JM,"SPAN",{});var UM=o(xp);f(Ao.$$.fragment,UM),UM.forEach(r),JM.forEach(r),uw=l(Lg),jp=n(Lg,"SPAN",{});var IM=o(jp);_w=i(IM,"Utilities"),IM.forEach(r),Lg.forEach(r),Bh=l(e),at=n(e,"DIV",{class:!0});var Ml=o(at);f(Oo.$$.fragment,Ml),bw=l(Ml),Ep=n(Ml,"P",{});var WM=o(Ep);yw=i(WM,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),WM.forEach(r),vw=l(Ml),Wc=n(Ml,"P",{});var kk=o(Wc);Tw=i(kk,"From: "),Ho=n(kk,"A",{href:!0,rel:!0});var BM=o(Ho);ww=i(BM,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),BM.forEach(r),kk.forEach(r),Ml.forEach(r),Zh=l(e),it=n(e,"DIV",{class:!0});var xl=o(it);f(Qo.$$.fragment,xl),kw=l(xl),Fp=n(xl,"P",{});var ZM=o(Fp);$w=i(ZM,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),ZM.forEach(r),Mw=l(xl),Bc=n(xl,"P",{});var $k=o(Bc);xw=i($k,"From: "),Yo=n($k,"A",{href:!0,rel:!0});var SM=o(Yo);jw=i(SM,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),SM.forEach(r),$k.forEach(r),xl.forEach(r),Sh=l(e),Qt=n(e,"H2",{class:!0});var zg=o(Qt);Rr=n(zg,"A",{id:!0,class:!0,href:!0});var VM=o(Rr);Lp=n(VM,"SPAN",{});var PM=o(Lp);f(Ko.$$.fragment,PM),PM.forEach(r),VM.forEach(r),Ew=l(zg),zp=n(zg,"SPAN",{});var DM=o(zp);Fw=i(DM,"Streamers"),DM.forEach(r),zg.forEach(r),Vh=l(e),B=n(e,"DIV",{class:!0});var ne=o(B);f(ea.$$.fragment,ne),Lw=l(ne),Jp=n(ne,"P",{});var qM=o(Jp);zw=i(qM,"Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),qM.forEach(r),Jw=l(ne),f(Cr.$$.fragment,ne),Uw=l(ne),f(Nr.$$.fragment,ne),Iw=l(ne),Ar=n(ne,"DIV",{class:!0});var Jg=o(Ar);f(ta.$$.fragment,Jg),Ww=l(Jg),Up=n(Jg,"P",{});var GM=o(Up);Bw=i(GM,"Flushes any remaining cache and prints a newline to stdout."),GM.forEach(r),Jg.forEach(r),Zw=l(ne),Or=n(ne,"DIV",{class:!0});var Ug=o(Or);f(ra.$$.fragment,Ug),Sw=l(Ug),Ip=n(Ug,"P",{});var XM=o(Ip);Vw=i(XM,"Prints the new text to stdout. If the stream is ending, also prints a newline."),XM.forEach(r),Ug.forEach(r),Pw=l(ne),Hr=n(ne,"DIV",{class:!0});var Ig=o(Hr);f(sa.$$.fragment,Ig),Dw=l(Ig),Wp=n(Ig,"P",{});var RM=o(Wp);qw=i(RM,"Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),RM.forEach(r),Ig.forEach(r),ne.forEach(r),Ph=l(e),O=n(e,"DIV",{class:!0});var vt=o(O);f(na.$$.fragment,vt),Gw=l(vt),Bp=n(vt,"P",{});var CM=o(Bp);Xw=i(CM,`Streamer that stores print-ready text in a queue, to be used by a downstream application as an iterator. This is
useful for applications that benefit from acessing the generated text in a non-blocking way (e.g. in an interactive
Gradio demo).`),CM.forEach(r),Rw=l(vt),f(Qr.$$.fragment,vt),Cw=l(vt),f(Yr.$$.fragment,vt),Nw=l(vt),Kr=n(vt,"DIV",{class:!0});var Wg=o(Kr);f(oa.$$.fragment,Wg),Aw=l(Wg),Zp=n(Wg,"P",{});var NM=o(Zp);Ow=i(NM,"Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."),NM.forEach(r),Wg.forEach(r),vt.forEach(r),this.h()},h(){d(v,"name","hf:doc:metadata"),d(v,"content",JSON.stringify(ux)),d(w,"id","utilities-for-generation"),d(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(w,"href","#utilities-for-generation"),d(k,"class","relative group"),d(H,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(Q,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.greedy_search"),d(j,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.contrastive_search"),d(me,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.sample"),d(da,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(pa,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(ma,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(ha,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.constrained_beam_search"),d(Kt,"id","generate-outputs"),d(Kt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Kt,"href","#generate-outputs"),d(jt,"class","relative group"),d(fa,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(ua,"href","/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"),d(_a,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(ya,"href","/docs/transformers/main/en/internal/generation_utils#transformers.generation.GreedySearchDecoderOnlyOutput"),d(tr,"id","transformers.generation.GreedySearchDecoderOnlyOutput"),d(tr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(tr,"href","#transformers.generation.GreedySearchDecoderOnlyOutput"),d(Et,"class","relative group"),d(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(sr,"id","transformers.generation.SampleDecoderOnlyOutput"),d(sr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(sr,"href","#transformers.generation.SampleDecoderOnlyOutput"),d(zt,"class","relative group"),d(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(or,"id","transformers.generation.BeamSearchDecoderOnlyOutput"),d(or,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(or,"href","#transformers.generation.BeamSearchDecoderOnlyOutput"),d(It,"class","relative group"),d(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ar,"id","transformers.generation.BeamSampleDecoderOnlyOutput"),d(ar,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ar,"href","#transformers.generation.BeamSampleDecoderOnlyOutput"),d(Zt,"class","relative group"),d(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ir,"id","transformers.LogitsProcessor"),d(ir,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ir,"href","#transformers.LogitsProcessor"),d(Pt,"class","relative group"),d(Ma,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(xa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ja,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Ea,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Fa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(La,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(za,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ja,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ia,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Wa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ba,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Za,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Va,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Pa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Da,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(qs,"href","https://arxiv.org/pdf/1909.05858.pdf"),d(qs,"rel","nofollow"),d(qa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Na,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Oa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Os,"href","https://arxiv.org/abs/2202.00666"),d(Os,"rel","nofollow"),d(Ha,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qa,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Ys,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(Ys,"rel","nofollow"),d(Ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ei,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ti,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(si,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ni,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(on,"href","https://arxiv.org/abs/2010.00904"),d(on,"rel","nofollow"),d(ai,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ii,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ci,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(ln,"href","https://arxiv.org/pdf/1610.02424.pdf"),d(ln,"rel","nofollow"),d(li,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(mi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(hi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(gi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ui,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_i,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(bi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(yi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ti,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(wi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($i,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(Mi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ji,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(Ei,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Li,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(zi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ui,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Ii,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Wi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(In,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(In,"rel","nofollow"),d(Bi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Si,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Vi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Di,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(qi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Xi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Er,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ri,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(Ci,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Ni,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(Ai,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Oi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qi,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Yi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ec,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(tc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(sc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(nc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ac,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(ic,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(lc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(mc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zr,"id","transformers.StoppingCriteria"),d(zr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(zr,"href","#transformers.StoppingCriteria"),d(qt,"class","relative group"),d(hc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.StoppingCriteria"),d(gc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(uc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ur,"id","transformers.Constraint"),d(Ur,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ur,"href","#transformers.Constraint"),d(Xt,"class","relative group"),d(bc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Br,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Vr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Dr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gr,"id","transformers.BeamScorer"),d(Gr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Gr,"href","#transformers.BeamScorer"),d(At,"class","relative group"),d(wc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(kc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d($c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(Do,"href","https://github.com/facebookresearch/XLM/blob/9e6f6814d17be4fe5b15f2e6c43eb2b2d76daeb4/src/model/transformer.py#L529"),d(Do,"rel","nofollow"),d(qo,"href","https://github.com/ashwinkalyan/dbs/blob/master/dbs/beam_utils.lua"),d(qo,"rel","nofollow"),d(Fc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Lc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(Uc,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ic,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xr,"id","transformers.top_k_top_p_filtering"),d(Xr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Xr,"href","#transformers.top_k_top_p_filtering"),d(Ht,"class","relative group"),d(Ho,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Ho,"rel","nofollow"),d(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Yo,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Yo,"rel","nofollow"),d(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Rr,"id","transformers.TextStreamer"),d(Rr,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Rr,"href","#transformers.TextStreamer"),d(Qt,"class","relative group"),d(Ar,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Or,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Hr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"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,p){t(document.head,v),m(e,M,p),m(e,k,p),t(k,w),t(w,x),u(h,x,null),t(k,$),t(k,V),t(V,J),m(e,U,p),m(e,F,p),t(F,Z),t(F,H),t(H,ve),t(F,W),t(F,Q),t(Q,Te),t(F,X),t(F,j),t(j,kt),t(F,$t),t(F,me),t(me,Mt),t(F,xt),t(F,da),t(da,Bg),t(F,Zg),t(F,pa),t(pa,Sg),t(F,Vg),t(F,ma),t(ma,Pg),t(F,Dg),t(F,ha),t(ha,qg),t(F,Gg),m(e,nm,p),m(e,ga,p),t(ga,Xg),m(e,om,p),m(e,jt,p),t(jt,Kt),t(Kt,El),u(ls,El,null),t(jt,Rg),t(jt,Fl),t(Fl,Cg),m(e,am,p),m(e,he,p),t(he,Ng),t(he,fa),t(fa,Ag),t(he,Og),t(he,ua),t(ua,Hg),t(he,Qg),t(he,_a),t(_a,Yg),t(he,Kg),m(e,im,p),m(e,ba,p),t(ba,ef),m(e,cm,p),u(ds,e,p),m(e,lm,p),m(e,ct,p),t(ct,tf),t(ct,Ll),t(Ll,rf),t(ct,sf),t(ct,ya),t(ya,nf),t(ct,of),m(e,dm,p),m(e,ge,p),t(ge,va),t(va,zl),t(zl,af),t(va,cf),t(ge,lf),t(ge,Ta),t(Ta,Jl),t(Jl,df),t(Ta,pf),t(ge,mf),t(ge,wa),t(wa,Ul),t(Ul,hf),t(wa,gf),t(ge,ff),t(ge,ka),t(ka,Il),t(Il,uf),t(ka,_f),m(e,pm,p),m(e,S,p),t(S,bf),t(S,Wl),t(Wl,yf),t(S,vf),t(S,Bl),t(Bl,Tf),t(S,wf),t(S,Zl),t(Zl,kf),t(S,$f),t(S,Sl),t(Sl,Mf),t(S,xf),t(S,Vl),t(Vl,jf),t(S,Ef),t(S,Pl),t(Pl,Ff),t(S,Lf),m(e,mm,p),m(e,Y,p),t(Y,zf),t(Y,Dl),t(Dl,Jf),t(Y,Uf),t(Y,ql),t(ql,If),t(Y,Wf),t(Y,Gl),t(Gl,Bf),t(Y,Zf),t(Y,Xl),t(Xl,Sf),t(Y,Vf),m(e,hm,p),m(e,K,p),t(K,Pf),t(K,Rl),t(Rl,Df),t(K,qf),t(K,Cl),t(Cl,Gf),t(K,Xf),t(K,Nl),t(Nl,Rf),t(K,Cf),t(K,Al),t(Al,Nf),t(K,Af),m(e,gm,p),u(ps,e,p),m(e,fm,p),m(e,er,p),t(er,Of),t(er,Ol),t(Ol,Hf),t(er,Qf),m(e,um,p),m(e,ee,p),t(ee,Yf),t(ee,Hl),t(Hl,Kf),t(ee,eu),t(ee,Ql),t(Ql,tu),t(ee,ru),t(ee,Yl),t(Yl,su),t(ee,nu),t(ee,Kl),t(Kl,ou),t(ee,au),m(e,_m,p),m(e,$a,p),t($a,iu),m(e,bm,p),m(e,Et,p),t(Et,tr),t(tr,ed),u(ms,ed,null),t(Et,cu),t(Et,td),t(td,lu),m(e,ym,p),m(e,Ft,p),u(hs,Ft,null),t(Ft,du),t(Ft,rd),t(rd,pu),m(e,vm,p),m(e,Lt,p),u(gs,Lt,null),t(Lt,mu),t(Lt,sd),t(sd,hu),m(e,Tm,p),m(e,we,p),u(fs,we,null),t(we,gu),t(we,nd),t(nd,fu),t(we,uu),t(we,rr),u(us,rr,null),t(rr,_u),t(rr,od),t(od,bu),m(e,wm,p),m(e,zt,p),t(zt,sr),t(sr,ad),u(_s,ad,null),t(zt,yu),t(zt,id),t(id,vu),m(e,km,p),m(e,Jt,p),u(bs,Jt,null),t(Jt,Tu),t(Jt,cd),t(cd,wu),m(e,$m,p),m(e,Ut,p),u(ys,Ut,null),t(Ut,ku),t(Ut,ld),t(ld,$u),m(e,Mm,p),m(e,ke,p),u(vs,ke,null),t(ke,Mu),t(ke,dd),t(dd,xu),t(ke,ju),t(ke,nr),u(Ts,nr,null),t(nr,Eu),t(nr,pd),t(pd,Fu),m(e,xm,p),m(e,It,p),t(It,or),t(or,md),u(ws,md,null),t(It,Lu),t(It,hd),t(hd,zu),m(e,jm,p),m(e,Wt,p),u(ks,Wt,null),t(Wt,Ju),t(Wt,gd),t(gd,Uu),m(e,Em,p),m(e,Bt,p),u($s,Bt,null),t(Bt,Iu),t(Bt,fd),t(fd,Wu),m(e,Fm,p),m(e,Zt,p),t(Zt,ar),t(ar,ud),u(Ms,ud,null),t(Zt,Bu),t(Zt,_d),t(_d,Zu),m(e,Lm,p),m(e,St,p),u(xs,St,null),t(St,Su),t(St,bd),t(bd,Vu),m(e,zm,p),m(e,Vt,p),u(js,Vt,null),t(Vt,Pu),t(Vt,yd),t(yd,Du),m(e,Jm,p),m(e,Pt,p),t(Pt,ir),t(ir,vd),u(Es,vd,null),t(Pt,qu),t(Pt,Td),t(Td,Gu),m(e,Um,p),m(e,cr,p),t(cr,Xu),t(cr,Ma),t(Ma,Ru),t(cr,Cu),m(e,Im,p),m(e,$e,p),u(Fs,$e,null),t($e,Nu),t($e,wd),t(wd,Au),t($e,Ou),t($e,xa),u(Ls,xa,null),m(e,Wm,p),m(e,Me,p),u(zs,Me,null),t(Me,Hu),t(Me,P),t(P,Qu),t(P,ja),t(ja,Yu),t(P,Ku),t(P,Ea),t(Ea,e_),t(P,t_),t(P,kd),t(kd,r_),t(P,s_),t(P,$d),t($d,Md),t(Md,n_),t(P,o_),t(P,Fa),t(Fa,a_),t(P,i_),t(P,La),t(La,c_),t(P,l_),t(Me,d_),t(Me,za),u(Js,za,null),m(e,Bm,p),m(e,xe,p),u(Us,xe,null),t(xe,p_),t(xe,xd),t(xd,m_),t(xe,h_),t(xe,Ja),u(Is,Ja,null),m(e,Zm,p),m(e,je,p),u(Ws,je,null),t(je,g_),t(je,Ua),t(Ua,Ia),t(Ia,f_),t(Ua,u_),t(je,__),t(je,Wa),u(Bs,Wa,null),m(e,Sm,p),m(e,oe,p),u(Zs,oe,null),t(oe,b_),t(oe,fe),t(fe,Ba),t(Ba,y_),t(fe,v_),t(fe,jd),t(jd,T_),t(fe,w_),t(fe,Ed),t(Ed,k_),t(fe,$_),t(fe,Fd),t(Fd,M_),t(fe,x_),t(oe,j_),u(lr,oe,null),t(oe,E_),t(oe,Za),u(Ss,Za,null),m(e,Vm,p),m(e,R,p),u(Vs,R,null),t(R,F_),t(R,Sa),t(Sa,Va),t(Va,L_),t(Sa,z_),t(R,J_),u(dr,R,null),t(R,U_),u(pr,R,null),t(R,I_),t(R,Pa),u(Ps,Pa,null),m(e,Pm,p),m(e,ae,p),u(Ds,ae,null),t(ae,W_),t(ae,mr),t(mr,Da),t(Da,B_),t(mr,Z_),t(mr,qs),t(qs,S_),t(mr,V_),t(ae,P_),u(hr,ae,null),t(ae,D_),t(ae,qa),u(Gs,qa,null),m(e,Dm,p),m(e,ie,p),u(Xs,ie,null),t(ie,q_),t(ie,Ga),t(Ga,Xa),t(Xa,G_),t(Ga,X_),t(ie,R_),u(gr,ie,null),t(ie,C_),t(ie,Ra),u(Rs,Ra,null),m(e,qm,p),m(e,Ee,p),u(Cs,Ee,null),t(Ee,N_),t(Ee,Ca),t(Ca,Na),t(Na,A_),t(Ca,O_),t(Ee,H_),t(Ee,Aa),u(Ns,Aa,null),m(e,Gm,p),m(e,Fe,p),u(As,Fe,null),t(Fe,Q_),t(Fe,fr),t(fr,Oa),t(Oa,Y_),t(fr,K_),t(fr,Os),t(Os,eb),t(fr,tb),t(Fe,rb),t(Fe,Ha),u(Hs,Ha,null),m(e,Xm,p),m(e,C,p),u(Qs,C,null),t(C,sb),t(C,Dt),t(Dt,nb),t(Dt,Qa),t(Qa,ob),t(Dt,ab),t(Dt,Ys),t(Ys,ib),t(Dt,cb),t(C,lb),u(ur,C,null),t(C,db),u(_r,C,null),t(C,pb),t(C,Ya),u(Ks,Ya,null),m(e,Rm,p),m(e,N,p),u(en,N,null),t(N,mb),t(N,Ka),t(Ka,ei),t(ei,hb),t(Ka,gb),t(N,fb),u(br,N,null),t(N,ub),u(yr,N,null),t(N,_b),t(N,ti),u(tn,ti,null),m(e,Cm,p),m(e,A,p),u(rn,A,null),t(A,bb),t(A,ri),t(ri,si),t(si,yb),t(ri,vb),t(A,Tb),u(vr,A,null),t(A,wb),u(Tr,A,null),t(A,kb),t(A,ni),u(sn,ni,null),m(e,Nm,p),m(e,Le,p),u(nn,Le,null),t(Le,$b),t(Le,wr),t(wr,oi),t(oi,Mb),t(wr,xb),t(wr,on),t(on,jb),t(wr,Eb),t(Le,Fb),t(Le,ai),u(an,ai,null),m(e,Am,p),m(e,ze,p),u(cn,ze,null),t(ze,Lb),t(ze,lt),t(lt,ii),t(ii,zb),t(lt,Jb),t(lt,ci),t(ci,Ub),t(lt,Ib),t(lt,ln),t(ln,Wb),t(lt,Bb),t(ze,Zb),t(ze,li),u(dn,li,null),m(e,Om,p),m(e,Je,p),u(pn,Je,null),t(Je,Sb),t(Je,di),t(di,pi),t(pi,Vb),t(di,Pb),t(Je,Db),t(Je,mi),u(mn,mi,null),m(e,Hm,p),m(e,Ue,p),u(hn,Ue,null),t(Ue,qb),t(Ue,kr),t(kr,hi),t(hi,Gb),t(kr,Xb),t(kr,Ld),t(Ld,Rb),t(kr,Cb),t(Ue,Nb),t(Ue,gi),u(gn,gi,null),m(e,Qm,p),m(e,Ie,p),u(fn,Ie,null),t(Ie,Ab),t(Ie,dt),t(dt,fi),t(fi,Ob),t(dt,Hb),t(dt,zd),t(zd,Qb),t(dt,Yb),t(dt,Jd),t(Jd,Kb),t(dt,ey),t(Ie,ty),t(Ie,ui),u(un,ui,null),m(e,Ym,p),m(e,We,p),u(_n,We,null),t(We,ry),t(We,Ud),t(Ud,sy),t(We,ny),t(We,$r),u(bn,$r,null),t($r,oy),t($r,Id),t(Id,ay),m(e,Km,p),m(e,Be,p),u(yn,Be,null),t(Be,iy),t(Be,ce),t(ce,cy),t(ce,_i),t(_i,ly),t(ce,dy),t(ce,Wd),t(Wd,py),t(ce,my),t(ce,Bd),t(Bd,Zd),t(Zd,hy),t(ce,gy),t(ce,bi),t(bi,fy),t(ce,uy),t(Be,_y),t(Be,yi),u(vn,yi,null),m(e,eh,p),m(e,Ze,p),u(Tn,Ze,null),t(Ze,by),t(Ze,Sd),t(Sd,yy),t(Ze,vy),t(Ze,Mr),u(wn,Mr,null),t(Mr,Ty),t(Mr,Vd),t(Vd,wy),m(e,th,p),m(e,Se,p),u(kn,Se,null),t(Se,ky),t(Se,vi),t(vi,Ti),t(Ti,$y),t(vi,My),t(Se,xy),t(Se,wi),u($n,wi,null),m(e,rh,p),m(e,Ve,p),u(Mn,Ve,null),t(Ve,jy),t(Ve,ki),t(ki,$i),t($i,Ey),t(ki,Fy),t(Ve,Ly),t(Ve,Mi),u(xn,Mi,null),m(e,sh,p),m(e,Pe,p),u(jn,Pe,null),t(Pe,zy),t(Pe,xi),t(xi,ji),t(ji,Jy),t(xi,Uy),t(Pe,Iy),t(Pe,Ei),u(En,Ei,null),m(e,nh,p),m(e,De,p),u(Fn,De,null),t(De,Wy),t(De,Fi),t(Fi,Li),t(Li,By),t(Fi,Zy),t(De,Sy),t(De,zi),u(Ln,zi,null),m(e,oh,p),m(e,qe,p),u(zn,qe,null),t(qe,Vy),t(qe,Ji),t(Ji,Ui),t(Ui,Py),t(Ji,Dy),t(qe,qy),t(qe,Ii),u(Jn,Ii,null),m(e,ah,p),m(e,Ge,p),u(Un,Ge,null),t(Ge,Gy),t(Ge,xr),t(xr,Wi),t(Wi,Xy),t(xr,Ry),t(xr,In),t(In,Cy),t(xr,Ny),t(Ge,Ay),t(Ge,Bi),u(Wn,Bi,null),m(e,ih,p),m(e,Xe,p),u(Bn,Xe,null),t(Xe,Oy),t(Xe,Zi),t(Zi,Si),t(Si,Hy),t(Zi,Qy),t(Xe,Yy),t(Xe,Vi),u(Zn,Vi,null),m(e,ch,p),m(e,Re,p),u(Sn,Re,null),t(Re,Ky),t(Re,Pi),t(Pi,Di),t(Di,ev),t(Pi,tv),t(Re,rv),t(Re,qi),u(Vn,qi,null),m(e,lh,p),m(e,Ce,p),u(Pn,Ce,null),t(Ce,sv),t(Ce,jr),t(jr,Gi),t(Gi,nv),t(jr,ov),t(jr,Pd),t(Pd,av),t(jr,iv),t(Ce,cv),t(Ce,Xi),u(Dn,Xi,null),m(e,dh,p),m(e,Ne,p),u(qn,Ne,null),t(Ne,lv),t(Ne,Dd),t(Dd,dv),t(Ne,pv),t(Ne,Er),u(Gn,Er,null),t(Er,mv),t(Er,qd),t(qd,hv),m(e,ph,p),m(e,Ae,p),u(Xn,Ae,null),t(Ae,gv),t(Ae,D),t(D,fv),t(D,Ri),t(Ri,uv),t(D,_v),t(D,Ci),t(Ci,bv),t(D,yv),t(D,Gd),t(Gd,vv),t(D,Tv),t(D,Xd),t(Xd,Rd),t(Rd,wv),t(D,kv),t(D,Ni),t(Ni,$v),t(D,Mv),t(D,Ai),t(Ai,xv),t(D,jv),t(Ae,Ev),t(Ae,Oi),u(Rn,Oi,null),m(e,mh,p),m(e,Oe,p),u(Cn,Oe,null),t(Oe,Fv),t(Oe,Cd),t(Cd,Lv),t(Oe,zv),t(Oe,Fr),u(Nn,Fr,null),t(Fr,Jv),t(Fr,Nd),t(Nd,Uv),m(e,hh,p),m(e,He,p),u(An,He,null),t(He,Iv),t(He,Hi),t(Hi,Qi),t(Qi,Wv),t(Hi,Bv),t(He,Zv),t(He,Yi),u(On,Yi,null),m(e,gh,p),m(e,Qe,p),u(Hn,Qe,null),t(Qe,Sv),t(Qe,Ki),t(Ki,ec),t(ec,Vv),t(Ki,Pv),t(Qe,Dv),t(Qe,tc),u(Qn,tc,null),m(e,fh,p),m(e,Ye,p),u(Yn,Ye,null),t(Ye,qv),t(Ye,rc),t(rc,sc),t(sc,Gv),t(rc,Xv),t(Ye,Rv),t(Ye,nc),u(Kn,nc,null),m(e,uh,p),m(e,Ke,p),u(eo,Ke,null),t(Ke,Cv),t(Ke,oc),t(oc,ac),t(ac,Nv),t(oc,Av),t(Ke,Ov),t(Ke,ic),u(to,ic,null),m(e,_h,p),m(e,et,p),u(ro,et,null),t(et,Hv),t(et,Lr),t(Lr,cc),t(cc,Qv),t(Lr,Yv),t(Lr,Ad),t(Ad,Kv),t(Lr,eT),t(et,tT),t(et,lc),u(so,lc,null),m(e,bh,p),m(e,tt,p),u(no,tt,null),t(tt,rT),t(tt,dc),t(dc,pc),t(pc,sT),t(dc,nT),t(tt,oT),t(tt,mc),u(oo,mc,null),m(e,yh,p),m(e,qt,p),t(qt,zr),t(zr,Od),u(ao,Od,null),t(qt,aT),t(qt,Hd),t(Hd,iT),m(e,vh,p),m(e,Jr,p),t(Jr,cT),t(Jr,hc),t(hc,lT),t(Jr,dT),m(e,Th,p),m(e,rt,p),u(io,rt,null),t(rt,pT),t(rt,Qd),t(Qd,mT),t(rt,hT),t(rt,gc),u(co,gc,null),m(e,wh,p),m(e,Gt,p),u(lo,Gt,null),t(Gt,gT),t(Gt,fc),u(po,fc,null),m(e,kh,p),m(e,st,p),u(mo,st,null),t(st,fT),t(st,ho),t(ho,uT),t(ho,Yd),t(Yd,_T),t(ho,bT),t(st,yT),t(st,uc),u(go,uc,null),m(e,$h,p),m(e,nt,p),u(fo,nt,null),t(nt,vT),t(nt,uo),t(uo,TT),t(uo,Kd),t(Kd,wT),t(uo,kT),t(nt,$T),t(nt,_c),u(_o,_c,null),m(e,Mh,p),m(e,Xt,p),t(Xt,Ur),t(Ur,ep),u(bo,ep,null),t(Xt,MT),t(Xt,tp),t(tp,xT),m(e,xh,p),m(e,Ir,p),t(Ir,jT),t(Ir,bc),t(bc,ET),t(Ir,FT),m(e,jh,p),m(e,L,p),u(yo,L,null),t(L,LT),t(L,rp),t(rp,zT),t(L,JT),t(L,sp),t(sp,UT),t(L,IT),u(Wr,L,null),t(L,WT),t(L,np),t(np,BT),t(L,ZT),t(L,Br),u(vo,Br,null),t(Br,ST),t(Br,op),t(op,VT),t(L,PT),t(L,Zr),u(To,Zr,null),t(Zr,DT),t(Zr,ap),t(ap,qT),t(L,GT),t(L,Sr),u(wo,Sr,null),t(Sr,XT),t(Sr,ip),t(ip,RT),t(L,CT),t(L,Vr),u(ko,Vr,null),t(Vr,NT),t(Vr,$o),t($o,AT),t($o,cp),t(cp,OT),t($o,HT),t(L,QT),t(L,Pr),u(Mo,Pr,null),t(Pr,YT),t(Pr,lp),t(lp,KT),t(L,e2),t(L,Dr),u(xo,Dr,null),t(Dr,t2),t(Dr,dp),t(dp,r2),t(L,s2),t(L,pt),u(jo,pt,null),t(pt,n2),t(pt,Eo),t(Eo,o2),t(Eo,pp),t(pp,a2),t(Eo,i2),t(pt,c2),t(pt,mp),t(mp,l2),m(e,Eh,p),m(e,Rt,p),u(Fo,Rt,null),t(Rt,d2),t(Rt,yc),t(yc,vc),t(vc,p2),t(yc,m2),m(e,Fh,p),m(e,Ct,p),u(Lo,Ct,null),t(Ct,h2),t(Ct,zo),t(zo,g2),t(zo,Tc),t(Tc,f2),t(zo,u2),m(e,Lh,p),m(e,le,p),u(Jo,le,null),t(le,_2),t(le,hp),t(hp,b2),t(le,y2),t(le,G),u(Uo,G,null),t(G,v2),t(G,gp),t(gp,T2),t(G,w2),t(G,Nt),t(Nt,k2),t(Nt,fp),t(fp,$2),t(Nt,M2),t(Nt,up),t(up,x2),t(Nt,j2),t(G,E2),t(G,_p),t(_p,bp),t(bp,F2),t(G,L2),t(G,ot),t(ot,z2),t(ot,yp),t(yp,J2),t(ot,U2),t(ot,vp),t(vp,I2),t(ot,W2),t(ot,Tp),t(Tp,B2),t(ot,Z2),t(G,S2),t(G,wp),t(wp,V2),t(le,P2),t(le,qr),u(Io,qr,null),t(qr,D2),t(qr,kp),t(kp,q2),m(e,zh,p),m(e,At,p),t(At,Gr),t(Gr,$p),u(Wo,$p,null),t(At,G2),t(At,Mp),t(Mp,X2),m(e,Jh,p),m(e,de,p),u(Bo,de,null),t(de,R2),t(de,Ot),t(Ot,C2),t(Ot,wc),t(wc,N2),t(Ot,A2),t(Ot,kc),t(kc,O2),t(Ot,H2),t(de,Q2),t(de,$c),u(Zo,$c,null),t(de,Y2),t(de,Mc),u(So,Mc,null),m(e,Uh,p),m(e,q,p),u(Vo,q,null),t(q,K2),t(q,xc),t(xc,jc),t(jc,ew),t(xc,tw),t(q,rw),t(q,Po),t(Po,sw),t(Po,Do),t(Do,nw),t(Po,ow),t(q,aw),t(q,Ec),t(Ec,iw),t(Ec,qo),t(qo,cw),t(q,lw),t(q,Fc),u(Go,Fc,null),t(q,dw),t(q,Lc),u(Xo,Lc,null),m(e,Ih,p),m(e,pe,p),u(Ro,pe,null),t(pe,pw),t(pe,zc),t(zc,Jc),t(Jc,mw),t(zc,hw),t(pe,gw),t(pe,Uc),u(Co,Uc,null),t(pe,fw),t(pe,Ic),u(No,Ic,null),m(e,Wh,p),m(e,Ht,p),t(Ht,Xr),t(Xr,xp),u(Ao,xp,null),t(Ht,uw),t(Ht,jp),t(jp,_w),m(e,Bh,p),m(e,at,p),u(Oo,at,null),t(at,bw),t(at,Ep),t(Ep,yw),t(at,vw),t(at,Wc),t(Wc,Tw),t(Wc,Ho),t(Ho,ww),m(e,Zh,p),m(e,it,p),u(Qo,it,null),t(it,kw),t(it,Fp),t(Fp,$w),t(it,Mw),t(it,Bc),t(Bc,xw),t(Bc,Yo),t(Yo,jw),m(e,Sh,p),m(e,Qt,p),t(Qt,Rr),t(Rr,Lp),u(Ko,Lp,null),t(Qt,Ew),t(Qt,zp),t(zp,Fw),m(e,Vh,p),m(e,B,p),u(ea,B,null),t(B,Lw),t(B,Jp),t(Jp,zw),t(B,Jw),u(Cr,B,null),t(B,Uw),u(Nr,B,null),t(B,Iw),t(B,Ar),u(ta,Ar,null),t(Ar,Ww),t(Ar,Up),t(Up,Bw),t(B,Zw),t(B,Or),u(ra,Or,null),t(Or,Sw),t(Or,Ip),t(Ip,Vw),t(B,Pw),t(B,Hr),u(sa,Hr,null),t(Hr,Dw),t(Hr,Wp),t(Wp,qw),m(e,Ph,p),m(e,O,p),u(na,O,null),t(O,Gw),t(O,Bp),t(Bp,Xw),t(O,Rw),u(Qr,O,null),t(O,Cw),u(Yr,O,null),t(O,Nw),t(O,Kr),u(oa,Kr,null),t(Kr,Aw),t(Kr,Zp),t(Zp,Ow),Dh=!0},p(e,[p]){const aa={};p&2&&(aa.$$scope={dirty:p,ctx:e}),lr.$set(aa);const Sp={};p&2&&(Sp.$$scope={dirty:p,ctx:e}),dr.$set(Sp);const Vp={};p&2&&(Vp.$$scope={dirty:p,ctx:e}),pr.$set(Vp);const Pp={};p&2&&(Pp.$$scope={dirty:p,ctx:e}),hr.$set(Pp);const I={};p&2&&(I.$$scope={dirty:p,ctx:e}),gr.$set(I);const Dp={};p&2&&(Dp.$$scope={dirty:p,ctx:e}),ur.$set(Dp);const qp={};p&2&&(qp.$$scope={dirty:p,ctx:e}),_r.$set(qp);const Gp={};p&2&&(Gp.$$scope={dirty:p,ctx:e}),br.$set(Gp);const Xp={};p&2&&(Xp.$$scope={dirty:p,ctx:e}),yr.$set(Xp);const Rp={};p&2&&(Rp.$$scope={dirty:p,ctx:e}),vr.$set(Rp);const Cp={};p&2&&(Cp.$$scope={dirty:p,ctx:e}),Tr.$set(Cp);const Np={};p&2&&(Np.$$scope={dirty:p,ctx:e}),Wr.$set(Np);const Ap={};p&2&&(Ap.$$scope={dirty:p,ctx:e}),Cr.$set(Ap);const Op={};p&2&&(Op.$$scope={dirty:p,ctx:e}),Nr.$set(Op);const ia={};p&2&&(ia.$$scope={dirty:p,ctx:e}),Qr.$set(ia);const Hp={};p&2&&(Hp.$$scope={dirty:p,ctx:e}),Yr.$set(Hp)},i(e){Dh||(_(h.$$.fragment,e),_(ls.$$.fragment,e),_(ds.$$.fragment,e),_(ps.$$.fragment,e),_(ms.$$.fragment,e),_(hs.$$.fragment,e),_(gs.$$.fragment,e),_(fs.$$.fragment,e),_(us.$$.fragment,e),_(_s.$$.fragment,e),_(bs.$$.fragment,e),_(ys.$$.fragment,e),_(vs.$$.fragment,e),_(Ts.$$.fragment,e),_(ws.$$.fragment,e),_(ks.$$.fragment,e),_($s.$$.fragment,e),_(Ms.$$.fragment,e),_(xs.$$.fragment,e),_(js.$$.fragment,e),_(Es.$$.fragment,e),_(Fs.$$.fragment,e),_(Ls.$$.fragment,e),_(zs.$$.fragment,e),_(Js.$$.fragment,e),_(Us.$$.fragment,e),_(Is.$$.fragment,e),_(Ws.$$.fragment,e),_(Bs.$$.fragment,e),_(Zs.$$.fragment,e),_(lr.$$.fragment,e),_(Ss.$$.fragment,e),_(Vs.$$.fragment,e),_(dr.$$.fragment,e),_(pr.$$.fragment,e),_(Ps.$$.fragment,e),_(Ds.$$.fragment,e),_(hr.$$.fragment,e),_(Gs.$$.fragment,e),_(Xs.$$.fragment,e),_(gr.$$.fragment,e),_(Rs.$$.fragment,e),_(Cs.$$.fragment,e),_(Ns.$$.fragment,e),_(As.$$.fragment,e),_(Hs.$$.fragment,e),_(Qs.$$.fragment,e),_(ur.$$.fragment,e),_(_r.$$.fragment,e),_(Ks.$$.fragment,e),_(en.$$.fragment,e),_(br.$$.fragment,e),_(yr.$$.fragment,e),_(tn.$$.fragment,e),_(rn.$$.fragment,e),_(vr.$$.fragment,e),_(Tr.$$.fragment,e),_(sn.$$.fragment,e),_(nn.$$.fragment,e),_(an.$$.fragment,e),_(cn.$$.fragment,e),_(dn.$$.fragment,e),_(pn.$$.fragment,e),_(mn.$$.fragment,e),_(hn.$$.fragment,e),_(gn.$$.fragment,e),_(fn.$$.fragment,e),_(un.$$.fragment,e),_(_n.$$.fragment,e),_(bn.$$.fragment,e),_(yn.$$.fragment,e),_(vn.$$.fragment,e),_(Tn.$$.fragment,e),_(wn.$$.fragment,e),_(kn.$$.fragment,e),_($n.$$.fragment,e),_(Mn.$$.fragment,e),_(xn.$$.fragment,e),_(jn.$$.fragment,e),_(En.$$.fragment,e),_(Fn.$$.fragment,e),_(Ln.$$.fragment,e),_(zn.$$.fragment,e),_(Jn.$$.fragment,e),_(Un.$$.fragment,e),_(Wn.$$.fragment,e),_(Bn.$$.fragment,e),_(Zn.$$.fragment,e),_(Sn.$$.fragment,e),_(Vn.$$.fragment,e),_(Pn.$$.fragment,e),_(Dn.$$.fragment,e),_(qn.$$.fragment,e),_(Gn.$$.fragment,e),_(Xn.$$.fragment,e),_(Rn.$$.fragment,e),_(Cn.$$.fragment,e),_(Nn.$$.fragment,e),_(An.$$.fragment,e),_(On.$$.fragment,e),_(Hn.$$.fragment,e),_(Qn.$$.fragment,e),_(Yn.$$.fragment,e),_(Kn.$$.fragment,e),_(eo.$$.fragment,e),_(to.$$.fragment,e),_(ro.$$.fragment,e),_(so.$$.fragment,e),_(no.$$.fragment,e),_(oo.$$.fragment,e),_(ao.$$.fragment,e),_(io.$$.fragment,e),_(co.$$.fragment,e),_(lo.$$.fragment,e),_(po.$$.fragment,e),_(mo.$$.fragment,e),_(go.$$.fragment,e),_(fo.$$.fragment,e),_(_o.$$.fragment,e),_(bo.$$.fragment,e),_(yo.$$.fragment,e),_(Wr.$$.fragment,e),_(vo.$$.fragment,e),_(To.$$.fragment,e),_(wo.$$.fragment,e),_(ko.$$.fragment,e),_(Mo.$$.fragment,e),_(xo.$$.fragment,e),_(jo.$$.fragment,e),_(Fo.$$.fragment,e),_(Lo.$$.fragment,e),_(Jo.$$.fragment,e),_(Uo.$$.fragment,e),_(Io.$$.fragment,e),_(Wo.$$.fragment,e),_(Bo.$$.fragment,e),_(Zo.$$.fragment,e),_(So.$$.fragment,e),_(Vo.$$.fragment,e),_(Go.$$.fragment,e),_(Xo.$$.fragment,e),_(Ro.$$.fragment,e),_(Co.$$.fragment,e),_(No.$$.fragment,e),_(Ao.$$.fragment,e),_(Oo.$$.fragment,e),_(Qo.$$.fragment,e),_(Ko.$$.fragment,e),_(ea.$$.fragment,e),_(Cr.$$.fragment,e),_(Nr.$$.fragment,e),_(ta.$$.fragment,e),_(ra.$$.fragment,e),_(sa.$$.fragment,e),_(na.$$.fragment,e),_(Qr.$$.fragment,e),_(Yr.$$.fragment,e),_(oa.$$.fragment,e),Dh=!0)},o(e){b(h.$$.fragment,e),b(ls.$$.fragment,e),b(ds.$$.fragment,e),b(ps.$$.fragment,e),b(ms.$$.fragment,e),b(hs.$$.fragment,e),b(gs.$$.fragment,e),b(fs.$$.fragment,e),b(us.$$.fragment,e),b(_s.$$.fragment,e),b(bs.$$.fragment,e),b(ys.$$.fragment,e),b(vs.$$.fragment,e),b(Ts.$$.fragment,e),b(ws.$$.fragment,e),b(ks.$$.fragment,e),b($s.$$.fragment,e),b(Ms.$$.fragment,e),b(xs.$$.fragment,e),b(js.$$.fragment,e),b(Es.$$.fragment,e),b(Fs.$$.fragment,e),b(Ls.$$.fragment,e),b(zs.$$.fragment,e),b(Js.$$.fragment,e),b(Us.$$.fragment,e),b(Is.$$.fragment,e),b(Ws.$$.fragment,e),b(Bs.$$.fragment,e),b(Zs.$$.fragment,e),b(lr.$$.fragment,e),b(Ss.$$.fragment,e),b(Vs.$$.fragment,e),b(dr.$$.fragment,e),b(pr.$$.fragment,e),b(Ps.$$.fragment,e),b(Ds.$$.fragment,e),b(hr.$$.fragment,e),b(Gs.$$.fragment,e),b(Xs.$$.fragment,e),b(gr.$$.fragment,e),b(Rs.$$.fragment,e),b(Cs.$$.fragment,e),b(Ns.$$.fragment,e),b(As.$$.fragment,e),b(Hs.$$.fragment,e),b(Qs.$$.fragment,e),b(ur.$$.fragment,e),b(_r.$$.fragment,e),b(Ks.$$.fragment,e),b(en.$$.fragment,e),b(br.$$.fragment,e),b(yr.$$.fragment,e),b(tn.$$.fragment,e),b(rn.$$.fragment,e),b(vr.$$.fragment,e),b(Tr.$$.fragment,e),b(sn.$$.fragment,e),b(nn.$$.fragment,e),b(an.$$.fragment,e),b(cn.$$.fragment,e),b(dn.$$.fragment,e),b(pn.$$.fragment,e),b(mn.$$.fragment,e),b(hn.$$.fragment,e),b(gn.$$.fragment,e),b(fn.$$.fragment,e),b(un.$$.fragment,e),b(_n.$$.fragment,e),b(bn.$$.fragment,e),b(yn.$$.fragment,e),b(vn.$$.fragment,e),b(Tn.$$.fragment,e),b(wn.$$.fragment,e),b(kn.$$.fragment,e),b($n.$$.fragment,e),b(Mn.$$.fragment,e),b(xn.$$.fragment,e),b(jn.$$.fragment,e),b(En.$$.fragment,e),b(Fn.$$.fragment,e),b(Ln.$$.fragment,e),b(zn.$$.fragment,e),b(Jn.$$.fragment,e),b(Un.$$.fragment,e),b(Wn.$$.fragment,e),b(Bn.$$.fragment,e),b(Zn.$$.fragment,e),b(Sn.$$.fragment,e),b(Vn.$$.fragment,e),b(Pn.$$.fragment,e),b(Dn.$$.fragment,e),b(qn.$$.fragment,e),b(Gn.$$.fragment,e),b(Xn.$$.fragment,e),b(Rn.$$.fragment,e),b(Cn.$$.fragment,e),b(Nn.$$.fragment,e),b(An.$$.fragment,e),b(On.$$.fragment,e),b(Hn.$$.fragment,e),b(Qn.$$.fragment,e),b(Yn.$$.fragment,e),b(Kn.$$.fragment,e),b(eo.$$.fragment,e),b(to.$$.fragment,e),b(ro.$$.fragment,e),b(so.$$.fragment,e),b(no.$$.fragment,e),b(oo.$$.fragment,e),b(ao.$$.fragment,e),b(io.$$.fragment,e),b(co.$$.fragment,e),b(lo.$$.fragment,e),b(po.$$.fragment,e),b(mo.$$.fragment,e),b(go.$$.fragment,e),b(fo.$$.fragment,e),b(_o.$$.fragment,e),b(bo.$$.fragment,e),b(yo.$$.fragment,e),b(Wr.$$.fragment,e),b(vo.$$.fragment,e),b(To.$$.fragment,e),b(wo.$$.fragment,e),b(ko.$$.fragment,e),b(Mo.$$.fragment,e),b(xo.$$.fragment,e),b(jo.$$.fragment,e),b(Fo.$$.fragment,e),b(Lo.$$.fragment,e),b(Jo.$$.fragment,e),b(Uo.$$.fragment,e),b(Io.$$.fragment,e),b(Wo.$$.fragment,e),b(Bo.$$.fragment,e),b(Zo.$$.fragment,e),b(So.$$.fragment,e),b(Vo.$$.fragment,e),b(Go.$$.fragment,e),b(Xo.$$.fragment,e),b(Ro.$$.fragment,e),b(Co.$$.fragment,e),b(No.$$.fragment,e),b(Ao.$$.fragment,e),b(Oo.$$.fragment,e),b(Qo.$$.fragment,e),b(Ko.$$.fragment,e),b(ea.$$.fragment,e),b(Cr.$$.fragment,e),b(Nr.$$.fragment,e),b(ta.$$.fragment,e),b(ra.$$.fragment,e),b(sa.$$.fragment,e),b(na.$$.fragment,e),b(Qr.$$.fragment,e),b(Yr.$$.fragment,e),b(oa.$$.fragment,e),Dh=!1},d(e){r(v),e&&r(M),e&&r(k),y(h),e&&r(U),e&&r(F),e&&r(nm),e&&r(ga),e&&r(om),e&&r(jt),y(ls),e&&r(am),e&&r(he),e&&r(im),e&&r(ba),e&&r(cm),y(ds,e),e&&r(lm),e&&r(ct),e&&r(dm),e&&r(ge),e&&r(pm),e&&r(S),e&&r(mm),e&&r(Y),e&&r(hm),e&&r(K),e&&r(gm),y(ps,e),e&&r(fm),e&&r(er),e&&r(um),e&&r(ee),e&&r(_m),e&&r($a),e&&r(bm),e&&r(Et),y(ms),e&&r(ym),e&&r(Ft),y(hs),e&&r(vm),e&&r(Lt),y(gs),e&&r(Tm),e&&r(we),y(fs),y(us),e&&r(wm),e&&r(zt),y(_s),e&&r(km),e&&r(Jt),y(bs),e&&r($m),e&&r(Ut),y(ys),e&&r(Mm),e&&r(ke),y(vs),y(Ts),e&&r(xm),e&&r(It),y(ws),e&&r(jm),e&&r(Wt),y(ks),e&&r(Em),e&&r(Bt),y($s),e&&r(Fm),e&&r(Zt),y(Ms),e&&r(Lm),e&&r(St),y(xs),e&&r(zm),e&&r(Vt),y(js),e&&r(Jm),e&&r(Pt),y(Es),e&&r(Um),e&&r(cr),e&&r(Im),e&&r($e),y(Fs),y(Ls),e&&r(Wm),e&&r(Me),y(zs),y(Js),e&&r(Bm),e&&r(xe),y(Us),y(Is),e&&r(Zm),e&&r(je),y(Ws),y(Bs),e&&r(Sm),e&&r(oe),y(Zs),y(lr),y(Ss),e&&r(Vm),e&&r(R),y(Vs),y(dr),y(pr),y(Ps),e&&r(Pm),e&&r(ae),y(Ds),y(hr),y(Gs),e&&r(Dm),e&&r(ie),y(Xs),y(gr),y(Rs),e&&r(qm),e&&r(Ee),y(Cs),y(Ns),e&&r(Gm),e&&r(Fe),y(As),y(Hs),e&&r(Xm),e&&r(C),y(Qs),y(ur),y(_r),y(Ks),e&&r(Rm),e&&r(N),y(en),y(br),y(yr),y(tn),e&&r(Cm),e&&r(A),y(rn),y(vr),y(Tr),y(sn),e&&r(Nm),e&&r(Le),y(nn),y(an),e&&r(Am),e&&r(ze),y(cn),y(dn),e&&r(Om),e&&r(Je),y(pn),y(mn),e&&r(Hm),e&&r(Ue),y(hn),y(gn),e&&r(Qm),e&&r(Ie),y(fn),y(un),e&&r(Ym),e&&r(We),y(_n),y(bn),e&&r(Km),e&&r(Be),y(yn),y(vn),e&&r(eh),e&&r(Ze),y(Tn),y(wn),e&&r(th),e&&r(Se),y(kn),y($n),e&&r(rh),e&&r(Ve),y(Mn),y(xn),e&&r(sh),e&&r(Pe),y(jn),y(En),e&&r(nh),e&&r(De),y(Fn),y(Ln),e&&r(oh),e&&r(qe),y(zn),y(Jn),e&&r(ah),e&&r(Ge),y(Un),y(Wn),e&&r(ih),e&&r(Xe),y(Bn),y(Zn),e&&r(ch),e&&r(Re),y(Sn),y(Vn),e&&r(lh),e&&r(Ce),y(Pn),y(Dn),e&&r(dh),e&&r(Ne),y(qn),y(Gn),e&&r(ph),e&&r(Ae),y(Xn),y(Rn),e&&r(mh),e&&r(Oe),y(Cn),y(Nn),e&&r(hh),e&&r(He),y(An),y(On),e&&r(gh),e&&r(Qe),y(Hn),y(Qn),e&&r(fh),e&&r(Ye),y(Yn),y(Kn),e&&r(uh),e&&r(Ke),y(eo),y(to),e&&r(_h),e&&r(et),y(ro),y(so),e&&r(bh),e&&r(tt),y(no),y(oo),e&&r(yh),e&&r(qt),y(ao),e&&r(vh),e&&r(Jr),e&&r(Th),e&&r(rt),y(io),y(co),e&&r(wh),e&&r(Gt),y(lo),y(po),e&&r(kh),e&&r(st),y(mo),y(go),e&&r($h),e&&r(nt),y(fo),y(_o),e&&r(Mh),e&&r(Xt),y(bo),e&&r(xh),e&&r(Ir),e&&r(jh),e&&r(L),y(yo),y(Wr),y(vo),y(To),y(wo),y(ko),y(Mo),y(xo),y(jo),e&&r(Eh),e&&r(Rt),y(Fo),e&&r(Fh),e&&r(Ct),y(Lo),e&&r(Lh),e&&r(le),y(Jo),y(Uo),y(Io),e&&r(zh),e&&r(At),y(Wo),e&&r(Jh),e&&r(de),y(Bo),y(Zo),y(So),e&&r(Uh),e&&r(q),y(Vo),y(Go),y(Xo),e&&r(Ih),e&&r(pe),y(Ro),y(Co),y(No),e&&r(Wh),e&&r(Ht),y(Ao),e&&r(Bh),e&&r(at),y(Oo),e&&r(Zh),e&&r(it),y(Qo),e&&r(Sh),e&&r(Qt),y(Ko),e&&r(Vh),e&&r(B),y(ea),y(Cr),y(Nr),y(ta),y(ra),y(sa),e&&r(Ph),e&&r(O),y(na),y(Qr),y(Yr),y(oa)}}}const ux={local:"utilities-for-generation",sections:[{local:"generate-outputs",sections:[{local:"transformers.generation.GreedySearchDecoderOnlyOutput",title:"GreedySearchOutput"},{local:"transformers.generation.SampleDecoderOnlyOutput",title:"SampleOutput"},{local:"transformers.generation.BeamSearchDecoderOnlyOutput",title:"BeamSearchOutput"},{local:"transformers.generation.BeamSampleDecoderOnlyOutput",title:"BeamSampleOutput"}],title:"Generate Outputs"},{local:"transformers.LogitsProcessor",title:"LogitsProcessor"},{local:"transformers.StoppingCriteria",title:"StoppingCriteria"},{local:"transformers.Constraint",title:"Constraints"},{local:"transformers.BeamScorer",title:"BeamSearch"},{local:"transformers.top_k_top_p_filtering",title:"Utilities"},{local:"transformers.TextStreamer",title:"Streamers"}],title:"Utilities for Generation"};function _x(E){return YM(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $x extends AM{constructor(v){super();OM(this,v,_x,fx,HM,{})}}export{$x as default,ux as metadata};
