import{s as I,n as J,o as Q}from"../chunks/scheduler.37c15a92.js";import{S as V,i as W,g as r,s as a,r as A,A as X,h as i,f as n,c as o,j as O,u as j,x as v,k as D,y as Z,a as s,v as k,d as z,t as R,w as B}from"../chunks/index.2bf4358c.js";import{Y as ee}from"../chunks/Youtube.1e50a667.js";import{C as te}from"../chunks/CourseFloatingBanner.15ba07e6.js";import{H as ne,E as se}from"../chunks/EditOnGithub.8916dc7c.js";function ae(F){let l,w,_,q,m,x,c,T,u,C,f,U="Encoder-decoder models (also called <em>sequence-to-sequence models</em>) use both parts of the Transformer architecture. At each stage, the attention layers of the encoder can access all the words in the initial sentence, whereas the attention layers of the decoder can only access the words positioned before a given word in the input.",y,p,Y='The pretraining of these models can be done using the objectives of encoder or decoder models, but usually involves something a bit more complex. For instance, <a href="https://huggingface.co/t5-base" rel="nofollow">T5</a> is pretrained by replacing random spans of text (that can contain several words) with a single mask special word, and the objective is then to predict the text that this mask word replaces.',P,d,G="Sequence-to-sequence models are best suited for tasks revolving around generating new sentences depending on a given input, such as summarization, translation, or generative question answering.",E,h,K="Representatives of this family of models include:",M,g,N='<li><a href="https://huggingface.co/transformers/model_doc/bart" rel="nofollow">BART</a></li> <li><a href="https://huggingface.co/transformers/model_doc/mbart" rel="nofollow">mBART</a></li> <li><a href="https://huggingface.co/transformers/model_doc/marian" rel="nofollow">Marian</a></li> <li><a href="https://huggingface.co/transformers/model_doc/t5" rel="nofollow">T5</a></li>',H,$,L,b,S;return m=new ne({props:{title:"Sequence-to-sequence models sequence-to-sequence-models",local:"sequence-to-sequence-models-sequence-to-sequence-models",headingTag:"h1"}}),c=new te({props:{chapter:1,classNames:"absolute z-10 right-0 top-0"}}),u=new ee({props:{id:"0_4KEb08xrE"}}),$=new se({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter1/7.mdx"}}),{c(){l=r("meta"),w=a(),_=r("p"),q=a(),A(m.$$.fragment),x=a(),A(c.$$.fragment),T=a(),A(u.$$.fragment),C=a(),f=r("p"),f.innerHTML=U,y=a(),p=r("p"),p.innerHTML=Y,P=a(),d=r("p"),d.textContent=G,E=a(),h=r("p"),h.textContent=K,M=a(),g=r("ul"),g.innerHTML=N,H=a(),A($.$$.fragment),L=a(),b=r("p"),this.h()},l(e){const t=X("svelte-u9bgzb",document.head);l=i(t,"META",{name:!0,content:!0}),t.forEach(n),w=o(e),_=i(e,"P",{}),O(_).forEach(n),q=o(e),j(m.$$.fragment,e),x=o(e),j(c.$$.fragment,e),T=o(e),j(u.$$.fragment,e),C=o(e),f=i(e,"P",{"data-svelte-h":!0}),v(f)!=="svelte-jlh9xs"&&(f.innerHTML=U),y=o(e),p=i(e,"P",{"data-svelte-h":!0}),v(p)!=="svelte-14c390x"&&(p.innerHTML=Y),P=o(e),d=i(e,"P",{"data-svelte-h":!0}),v(d)!=="svelte-pfbuhi"&&(d.textContent=G),E=o(e),h=i(e,"P",{"data-svelte-h":!0}),v(h)!=="svelte-s27rrg"&&(h.textContent=K),M=o(e),g=i(e,"UL",{"data-svelte-h":!0}),v(g)!=="svelte-cz4hgg"&&(g.innerHTML=N),H=o(e),j($.$$.fragment,e),L=o(e),b=i(e,"P",{}),O(b).forEach(n),this.h()},h(){D(l,"name","hf:doc:metadata"),D(l,"content",oe)},m(e,t){Z(document.head,l),s(e,w,t),s(e,_,t),s(e,q,t),k(m,e,t),s(e,x,t),k(c,e,t),s(e,T,t),k(u,e,t),s(e,C,t),s(e,f,t),s(e,y,t),s(e,p,t),s(e,P,t),s(e,d,t),s(e,E,t),s(e,h,t),s(e,M,t),s(e,g,t),s(e,H,t),k($,e,t),s(e,L,t),s(e,b,t),S=!0},p:J,i(e){S||(z(m.$$.fragment,e),z(c.$$.fragment,e),z(u.$$.fragment,e),z($.$$.fragment,e),S=!0)},o(e){R(m.$$.fragment,e),R(c.$$.fragment,e),R(u.$$.fragment,e),R($.$$.fragment,e),S=!1},d(e){e&&(n(w),n(_),n(q),n(x),n(T),n(C),n(f),n(y),n(p),n(P),n(d),n(E),n(h),n(M),n(g),n(H),n(L),n(b)),n(l),B(m,e),B(c,e),B(u,e),B($,e)}}}const oe='{"title":"Sequence-to-sequence models sequence-to-sequence-models","local":"sequence-to-sequence-models-sequence-to-sequence-models","sections":[],"depth":1}';function le(F){return Q(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fe extends V{constructor(l){super(),W(this,l,le,ae,I,{})}}export{fe as component};
