import{s as O,o as D,n as ee}from"../chunks/scheduler.9bc65507.js";import{S as te,i as le,g as r,s,r as X,A as ae,h as p,f as l,c as o,j as Q,u as S,x as b,k as Y,y as ne,a,v as z,d as G,t as N,w as A}from"../chunks/index.707bf1b6.js";import{T as se}from"../chunks/Tip.c2ecdbf4.js";import{C as oe}from"../chunks/CodeBlock.54a9f38d.js";import{H as K}from"../chunks/Heading.342b1fa6.js";function ie(J){let n,m='Refer to <a href="t5">T5’s documentation page</a> for all API reference, code examples and notebooks. For more details regarding training and evaluation of the FLAN-T5, refer to the model card.';return{c(){n=r("p"),n.innerHTML=m},l(i){n=p(i,"P",{"data-svelte-h":!0}),b(n)!=="svelte-1nt6z6l"&&(n.innerHTML=m)},m(i,y){a(i,n,y)},p:ee,d(i){i&&l(n)}}}function re(J){let n,m,i,y,c,_,g,x,u,E='FLAN-T5 was released in the paper <a href="https://arxiv.org/pdf/2210.11416.pdf" rel="nofollow">Scaling Instruction-Finetuned Language Models</a> - it is an enhanced version of T5 that has been finetuned in a mixture of tasks.',U,h,W="One can directly use FLAN-T5 weights without finetuning the model:",C,d,L,T,q='FLAN-T5 includes the same improvements as T5 version 1.1 (see <a href="https://huggingface.co/docs/transformers/model_doc/t5v1.1" rel="nofollow">here</a> for the full details of the model’s improvements.)',Z,M,I="Google has released the following variants:",j,v,P='<li><p><a href="https://huggingface.co/google/flan-t5-small" rel="nofollow">google/flan-t5-small</a></p></li> <li><p><a href="https://huggingface.co/google/flan-t5-base" rel="nofollow">google/flan-t5-base</a></p></li> <li><p><a href="https://huggingface.co/google/flan-t5-large" rel="nofollow">google/flan-t5-large</a></p></li> <li><p><a href="https://huggingface.co/google/flan-t5-xl" rel="nofollow">google/flan-t5-xl</a></p></li> <li><p><a href="https://huggingface.co/google/flan-t5-xxl" rel="nofollow">google/flan-t5-xxl</a>.</p></li>',F,w,V='The original checkpoints can be found <a href="https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints" rel="nofollow">here</a>.',R,f,k,$,H;return c=new K({props:{title:"FLAN-T5",local:"flan-t5",headingTag:"h1"}}),g=new K({props:{title:"Overview",local:"overview",headingTag:"h2"}}),d=new oe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUyQyUyMEF1dG9Ub2tlbml6ZXIlMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZmxhbi10NS1zbWFsbCUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZmbGFuLXQ1LXNtYWxsJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJBJTIwc3RlcCUyMGJ5JTIwc3RlcCUyMHJlY2lwZSUyMHRvJTIwbWFrZSUyMGJvbG9nbmVzZSUyMHBhc3RhJTNBJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;google/flan-t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/flan-t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;A step by step recipe to make bolognese pasta:&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs)
<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-string">&#x27;Pour a cup of bolognese into a large bowl and add the pasta&#x27;</span>]`,wrap:!1}}),f=new se({props:{$$slots:{default:[ie]},$$scope:{ctx:J}}}),{c(){n=r("meta"),m=s(),i=r("p"),y=s(),X(c.$$.fragment),_=s(),X(g.$$.fragment),x=s(),u=r("p"),u.innerHTML=E,U=s(),h=r("p"),h.textContent=W,C=s(),X(d.$$.fragment),L=s(),T=r("p"),T.innerHTML=q,Z=s(),M=r("p"),M.textContent=I,j=s(),v=r("ul"),v.innerHTML=P,F=s(),w=r("p"),w.innerHTML=V,R=s(),X(f.$$.fragment),k=s(),$=r("p"),this.h()},l(e){const t=ae("svelte-u9bgzb",document.head);n=p(t,"META",{name:!0,content:!0}),t.forEach(l),m=o(e),i=p(e,"P",{}),Q(i).forEach(l),y=o(e),S(c.$$.fragment,e),_=o(e),S(g.$$.fragment,e),x=o(e),u=p(e,"P",{"data-svelte-h":!0}),b(u)!=="svelte-7w66g2"&&(u.innerHTML=E),U=o(e),h=p(e,"P",{"data-svelte-h":!0}),b(h)!=="svelte-1d2rojm"&&(h.textContent=W),C=o(e),S(d.$$.fragment,e),L=o(e),T=p(e,"P",{"data-svelte-h":!0}),b(T)!=="svelte-1ex43ys"&&(T.innerHTML=q),Z=o(e),M=p(e,"P",{"data-svelte-h":!0}),b(M)!=="svelte-1p0jqca"&&(M.textContent=I),j=o(e),v=p(e,"UL",{"data-svelte-h":!0}),b(v)!=="svelte-1i34rzv"&&(v.innerHTML=P),F=o(e),w=p(e,"P",{"data-svelte-h":!0}),b(w)!=="svelte-1u9gfp2"&&(w.innerHTML=V),R=o(e),S(f.$$.fragment,e),k=o(e),$=p(e,"P",{}),Q($).forEach(l),this.h()},h(){Y(n,"name","hf:doc:metadata"),Y(n,"content",pe)},m(e,t){ne(document.head,n),a(e,m,t),a(e,i,t),a(e,y,t),z(c,e,t),a(e,_,t),z(g,e,t),a(e,x,t),a(e,u,t),a(e,U,t),a(e,h,t),a(e,C,t),z(d,e,t),a(e,L,t),a(e,T,t),a(e,Z,t),a(e,M,t),a(e,j,t),a(e,v,t),a(e,F,t),a(e,w,t),a(e,R,t),z(f,e,t),a(e,k,t),a(e,$,t),H=!0},p(e,[t]){const B={};t&2&&(B.$$scope={dirty:t,ctx:e}),f.$set(B)},i(e){H||(G(c.$$.fragment,e),G(g.$$.fragment,e),G(d.$$.fragment,e),G(f.$$.fragment,e),H=!0)},o(e){N(c.$$.fragment,e),N(g.$$.fragment,e),N(d.$$.fragment,e),N(f.$$.fragment,e),H=!1},d(e){e&&(l(m),l(i),l(y),l(_),l(x),l(u),l(U),l(h),l(C),l(L),l(T),l(Z),l(M),l(j),l(v),l(F),l(w),l(R),l(k),l($)),l(n),A(c,e),A(g,e),A(d,e),A(f,e)}}}const pe='{"title":"FLAN-T5","local":"flan-t5","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2}],"depth":1}';function fe(J){return D(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class de extends te{constructor(n){super(),le(this,n,fe,re,O,{})}}export{de as component};
