import{s as oe,o as ie,n as se}from"../chunks/scheduler.25b97de1.js";import{S as re,i as pe,g as r,s as o,r as k,A as fe,h as p,f as l,c as i,j as ne,u as M,x as m,k as ae,y as me,a as n,v as L,d as H,t as P,w as U}from"../chunks/index.d9030fc9.js";import{T as ge}from"../chunks/Tip.baa67368.js";import{C as de}from"../chunks/CodeBlock.e6cd0d95.js";import{H as V,E as ue}from"../chunks/EditOnGithub.91d95064.js";function he(j){let a,g='Refer to <a href="t5">T5’s documentation page</a> for all API reference, tips, code examples and notebooks.';return{c(){a=r("p"),a.innerHTML=g},l(s){a=p(s,"P",{"data-svelte-h":!0}),m(a)!=="svelte-10ysmkr"&&(a.innerHTML=g)},m(s,C){n(s,a,C)},p:se,d(s){s&&l(a)}}}function ce(j){let a,g,s,C,d,Z,u,W,h,X=`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>.`,B,c,R,v,Y="One can directly plug in the weights of T5v1.1 into a T5 model, like so:",J,$,E,_,z="T5 Version 1.1 includes the following improvements compared to the original T5 model:",S,w,D=`<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,K=`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,ee="Google has released the following variants:",I,b,te='<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>',N,f,Q,y,A,G,O;return d=new V({props:{title:"T5v1.1",local:"t5v11",headingTag:"h1"}}),u=new V({props:{title:"Overview",local:"overview",headingTag:"h2"}}),c=new V({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),$=new de({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 ge({props:{$$slots:{default:[he]},$$scope:{ctx:j}}}),y=new ue({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/t5v1.1.md"}}),{c(){a=r("meta"),g=o(),s=r("p"),C=o(),k(d.$$.fragment),Z=o(),k(u.$$.fragment),W=o(),h=r("p"),h.innerHTML=X,B=o(),k(c.$$.fragment),R=o(),v=r("p"),v.textContent=Y,J=o(),k($.$$.fragment),E=o(),_=r("p"),_.textContent=z,S=o(),w=r("ul"),w.innerHTML=D,F=o(),x=r("p"),x.innerHTML=K,q=o(),T=r("p"),T.textContent=ee,I=o(),b=r("ul"),b.innerHTML=te,N=o(),k(f.$$.fragment),Q=o(),k(y.$$.fragment),A=o(),G=r("p"),this.h()},l(e){const t=fe("svelte-u9bgzb",document.head);a=p(t,"META",{name:!0,content:!0}),t.forEach(l),g=i(e),s=p(e,"P",{}),ne(s).forEach(l),C=i(e),M(d.$$.fragment,e),Z=i(e),M(u.$$.fragment,e),W=i(e),h=p(e,"P",{"data-svelte-h":!0}),m(h)!=="svelte-1s19v3y"&&(h.innerHTML=X),B=i(e),M(c.$$.fragment,e),R=i(e),v=p(e,"P",{"data-svelte-h":!0}),m(v)!=="svelte-vf87kd"&&(v.textContent=Y),J=i(e),M($.$$.fragment,e),E=i(e),_=p(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-x07s8t"&&(_.textContent=z),S=i(e),w=p(e,"UL",{"data-svelte-h":!0}),m(w)!=="svelte-195t2dj"&&(w.innerHTML=D),F=i(e),x=p(e,"P",{"data-svelte-h":!0}),m(x)!=="svelte-7k8pn0"&&(x.innerHTML=K),q=i(e),T=p(e,"P",{"data-svelte-h":!0}),m(T)!=="svelte-1p0jqca"&&(T.textContent=ee),I=i(e),b=p(e,"UL",{"data-svelte-h":!0}),m(b)!=="svelte-1rz8hcf"&&(b.innerHTML=te),N=i(e),M(f.$$.fragment,e),Q=i(e),M(y.$$.fragment,e),A=i(e),G=p(e,"P",{}),ne(G).forEach(l),this.h()},h(){ae(a,"name","hf:doc:metadata"),ae(a,"content",ve)},m(e,t){me(document.head,a),n(e,g,t),n(e,s,t),n(e,C,t),L(d,e,t),n(e,Z,t),L(u,e,t),n(e,W,t),n(e,h,t),n(e,B,t),L(c,e,t),n(e,R,t),n(e,v,t),n(e,J,t),L($,e,t),n(e,E,t),n(e,_,t),n(e,S,t),n(e,w,t),n(e,F,t),n(e,x,t),n(e,q,t),n(e,T,t),n(e,I,t),n(e,b,t),n(e,N,t),L(f,e,t),n(e,Q,t),L(y,e,t),n(e,A,t),n(e,G,t),O=!0},p(e,[t]){const le={};t&2&&(le.$$scope={dirty:t,ctx:e}),f.$set(le)},i(e){O||(H(d.$$.fragment,e),H(u.$$.fragment,e),H(c.$$.fragment,e),H($.$$.fragment,e),H(f.$$.fragment,e),H(y.$$.fragment,e),O=!0)},o(e){P(d.$$.fragment,e),P(u.$$.fragment,e),P(c.$$.fragment,e),P($.$$.fragment,e),P(f.$$.fragment,e),P(y.$$.fragment,e),O=!1},d(e){e&&(l(g),l(s),l(C),l(Z),l(W),l(h),l(B),l(R),l(v),l(J),l(E),l(_),l(S),l(w),l(F),l(x),l(q),l(T),l(I),l(b),l(N),l(Q),l(A),l(G)),l(a),U(d,e),U(u,e),U(c,e),U($,e),U(f,e),U(y,e)}}}const ve='{"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 $e(j){return ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ye extends re{constructor(a){super(),pe(this,a,$e,ce,oe,{})}}export{ye as component};
