import{s as ae,o as ne,n as oe}from"../chunks/scheduler.9bc65507.js";import{S as ie,i as se,g as r,s as o,r as k,A as re,h as p,f as l,c as i,j as te,u as M,x as m,k as le,y as pe,a,v as L,d as H,t as P,w as U}from"../chunks/index.707bf1b6.js";import{T as fe}from"../chunks/Tip.c2ecdbf4.js";import{C as me}from"../chunks/CodeBlock.54a9f38d.js";import{H as A}from"../chunks/Heading.342b1fa6.js";function ge(j){let n,g='Refer to <a href="t5">T5’s documentation page</a> for all API reference, tips, code examples and notebooks.';return{c(){n=r("p"),n.innerHTML=g},l(s){n=p(s,"P",{"data-svelte-h":!0}),m(n)!=="svelte-10ysmkr"&&(n.innerHTML=g)},m(s,b){a(s,n,b)},p:oe,d(s){s&&l(n)}}}function de(j){let n,g,s,b,d,G,u,Z,h,V=`T5v1.1 was released in the <a href="https://github.com/google-research/text-to-text-transfer-transformer/blob/main/released_checkpoints.md#t511" rel="nofollow">google-research/text-to-text-transfer-transformer</a>
repository by Colin Raffel et al. It’s an improved version of the original T5 model.
This model was contributed by <a href="https://huggingface.co/patrickvonplaten" rel="nofollow">patrickvonplaten</a>. The original code can be
found <a href="https://github.com/google-research/text-to-text-transfer-transformer/blob/main/released_checkpoints.md#t511" rel="nofollow">here</a>.`,W,c,B,v,X="One can directly plug in the weights of T5v1.1 into a T5 model, like so:",R,$,J,_,Y="T5 Version 1.1 includes the following improvements compared to the original T5 model:",S,w,z=`<li><p>GEGLU activation in the feed-forward hidden layer, rather than ReLU. See <a href="https://arxiv.org/abs/2002.05202" rel="nofollow">this paper</a>.</p></li> <li><p>Dropout was turned off in pre-training (quality win). Dropout should be re-enabled during fine-tuning.</p></li> <li><p>Pre-trained on C4 only without mixing in the downstream tasks.</p></li> <li><p>No parameter sharing between the embedding and classifier layer.</p></li> <li><p>“xl” and “xxl” replace “3B” and “11B”. The model shapes are a bit different - larger <code>d_model</code> and smaller
<code>num_heads</code> and <code>d_ff</code>.</p></li>`,F,x,D=`Note: T5 Version 1.1 was only pre-trained on <a href="https://huggingface.co/datasets/c4" rel="nofollow">C4</a> excluding any supervised
training. Therefore, this model has to be fine-tuned before it is usable on a downstream task, unlike the original T5
model. Since t5v1.1 was pre-trained unsupervisedly, there’s no real advantage to using a task prefix during single-task
fine-tuning. If you are doing multi-task fine-tuning, you should use a prefix.`,q,T,O="Google has released the following variants:",E,y,K='<li><p><a href="https://huggingface.co/google/t5-v1_1-small" rel="nofollow">google/t5-v1_1-small</a></p></li> <li><p><a href="https://huggingface.co/google/t5-v1_1-base" rel="nofollow">google/t5-v1_1-base</a></p></li> <li><p><a href="https://huggingface.co/google/t5-v1_1-large" rel="nofollow">google/t5-v1_1-large</a></p></li> <li><p><a href="https://huggingface.co/google/t5-v1_1-xl" rel="nofollow">google/t5-v1_1-xl</a></p></li> <li><p><a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a>.</p></li>',I,f,N,C,Q;return d=new A({props:{title:"T5v1.1",local:"t5v11",headingTag:"h1"}}),u=new A({props:{title:"Overview",local:"overview",headingTag:"h2"}}),c=new A({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),$=new me({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBUNUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGdDUtdjFfMS1iYXNlJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5ForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = T5ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;google/t5-v1_1-base&quot;</span>)`,wrap:!1}}),f=new fe({props:{$$slots:{default:[ge]},$$scope:{ctx:j}}}),{c(){n=r("meta"),g=o(),s=r("p"),b=o(),k(d.$$.fragment),G=o(),k(u.$$.fragment),Z=o(),h=r("p"),h.innerHTML=V,W=o(),k(c.$$.fragment),B=o(),v=r("p"),v.textContent=X,R=o(),k($.$$.fragment),J=o(),_=r("p"),_.textContent=Y,S=o(),w=r("ul"),w.innerHTML=z,F=o(),x=r("p"),x.innerHTML=D,q=o(),T=r("p"),T.textContent=O,E=o(),y=r("ul"),y.innerHTML=K,I=o(),k(f.$$.fragment),N=o(),C=r("p"),this.h()},l(e){const t=re("svelte-u9bgzb",document.head);n=p(t,"META",{name:!0,content:!0}),t.forEach(l),g=i(e),s=p(e,"P",{}),te(s).forEach(l),b=i(e),M(d.$$.fragment,e),G=i(e),M(u.$$.fragment,e),Z=i(e),h=p(e,"P",{"data-svelte-h":!0}),m(h)!=="svelte-1s19v3y"&&(h.innerHTML=V),W=i(e),M(c.$$.fragment,e),B=i(e),v=p(e,"P",{"data-svelte-h":!0}),m(v)!=="svelte-vf87kd"&&(v.textContent=X),R=i(e),M($.$$.fragment,e),J=i(e),_=p(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-x07s8t"&&(_.textContent=Y),S=i(e),w=p(e,"UL",{"data-svelte-h":!0}),m(w)!=="svelte-195t2dj"&&(w.innerHTML=z),F=i(e),x=p(e,"P",{"data-svelte-h":!0}),m(x)!=="svelte-7k8pn0"&&(x.innerHTML=D),q=i(e),T=p(e,"P",{"data-svelte-h":!0}),m(T)!=="svelte-1p0jqca"&&(T.textContent=O),E=i(e),y=p(e,"UL",{"data-svelte-h":!0}),m(y)!=="svelte-1rz8hcf"&&(y.innerHTML=K),I=i(e),M(f.$$.fragment,e),N=i(e),C=p(e,"P",{}),te(C).forEach(l),this.h()},h(){le(n,"name","hf:doc:metadata"),le(n,"content",ue)},m(e,t){pe(document.head,n),a(e,g,t),a(e,s,t),a(e,b,t),L(d,e,t),a(e,G,t),L(u,e,t),a(e,Z,t),a(e,h,t),a(e,W,t),L(c,e,t),a(e,B,t),a(e,v,t),a(e,R,t),L($,e,t),a(e,J,t),a(e,_,t),a(e,S,t),a(e,w,t),a(e,F,t),a(e,x,t),a(e,q,t),a(e,T,t),a(e,E,t),a(e,y,t),a(e,I,t),L(f,e,t),a(e,N,t),a(e,C,t),Q=!0},p(e,[t]){const ee={};t&2&&(ee.$$scope={dirty:t,ctx:e}),f.$set(ee)},i(e){Q||(H(d.$$.fragment,e),H(u.$$.fragment,e),H(c.$$.fragment,e),H($.$$.fragment,e),H(f.$$.fragment,e),Q=!0)},o(e){P(d.$$.fragment,e),P(u.$$.fragment,e),P(c.$$.fragment,e),P($.$$.fragment,e),P(f.$$.fragment,e),Q=!1},d(e){e&&(l(g),l(s),l(b),l(G),l(Z),l(h),l(W),l(B),l(v),l(R),l(J),l(_),l(S),l(w),l(F),l(x),l(q),l(T),l(E),l(y),l(I),l(N),l(C)),l(n),U(d,e),U(u,e),U(c,e),U($,e),U(f,e)}}}const ue='{"title":"T5v1.1","local":"t5v11","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2}],"depth":1}';function he(j){return ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xe extends ie{constructor(n){super(),se(this,n,he,de,ae,{})}}export{xe as component};
