import{S as kt,i as $t,s as Ct,e as l,k as T,w as at,t as c,M as At,c as o,d as h,m as w,x as lt,a as s,h as a,b as A,G as t,g as k,y as ot,q as it,o as st,B as ut,v as Pt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Tt}from"../../chunks/Tip-hf-doc-builder.js";import{I as wt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{F as qt}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";function It(B){let e,g,i,v,b,u,q,$,y,I,G,d,E,x,_,P,O;return{c(){e=l("p"),g=c("\u0110\u1EC3 l\xE0m \u0111\u01B0\u1EE3c \u0111i\u1EC1u n\xE0y, b\u1EA1n s\u1EBD c\u1EA7n t\u1EADn d\u1EE5ng m\u1ECDi th\u1EE9 b\u1EA1n \u0111\xE3 h\u1ECDc v\u1EC1 c\xE1c m\xF4 h\xECnh hu\u1EA5n luy\u1EC7n v\u1EDBi API Keras [trong "),i=l("a"),v=c("Ch\u01B0\u01A1ng 3"),b=c(", th\u01B0 vi\u1EC7n \u{1F917} Datasets trong "),u=l("a"),q=c("Chapter 5"),$=c(", v\xE0 th\u01B0 vi\u1EC7n \u{1F917} Tokenizers trong "),y=l("a"),I=c("Ch\u01B0\u01A1ng 6"),G=c(". Ch\xFAng ta c\u0169ng s\u1EBD t\u1EA3i k\u1EBFt qu\u1EA3 c\u1EE7a m\xECnh l\xEAn Model Hub, gi\u1ED1ng nh\u01B0 \u0111\xE3 l\xE0m trong "),d=l("a"),E=c("Ch\u01B0\u01A1ng 4"),x=c(", v\xEC v\u1EADy \u0111\xE2y th\u1EF1c s\u1EF1 l\xE0 ch\u01B0\u01A1ng m\xE0 m\u1ECDi th\u1EE9 k\u1EBFt h\u1EE3p v\u1EDBi nhau!"),_=T(),P=l("p"),O=c("M\u1ED7i ph\u1EA7n c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c \u0111\u1ECDc \u0111\u1ED9c l\u1EADp."),this.h()},l(p){e=o(p,"P",{});var r=s(e);g=a(r,"\u0110\u1EC3 l\xE0m \u0111\u01B0\u1EE3c \u0111i\u1EC1u n\xE0y, b\u1EA1n s\u1EBD c\u1EA7n t\u1EADn d\u1EE5ng m\u1ECDi th\u1EE9 b\u1EA1n \u0111\xE3 h\u1ECDc v\u1EC1 c\xE1c m\xF4 h\xECnh hu\u1EA5n luy\u1EC7n v\u1EDBi API Keras [trong "),i=o(r,"A",{href:!0});var L=s(i);v=a(L,"Ch\u01B0\u01A1ng 3"),L.forEach(h),b=a(r,", th\u01B0 vi\u1EC7n \u{1F917} Datasets trong "),u=o(r,"A",{href:!0});var D=s(u);q=a(D,"Chapter 5"),D.forEach(h),$=a(r,", v\xE0 th\u01B0 vi\u1EC7n \u{1F917} Tokenizers trong "),y=o(r,"A",{href:!0});var V=s(y);I=a(V,"Ch\u01B0\u01A1ng 6"),V.forEach(h),G=a(r,". Ch\xFAng ta c\u0169ng s\u1EBD t\u1EA3i k\u1EBFt qu\u1EA3 c\u1EE7a m\xECnh l\xEAn Model Hub, gi\u1ED1ng nh\u01B0 \u0111\xE3 l\xE0m trong "),d=o(r,"A",{href:!0});var N=s(d);E=a(N,"Ch\u01B0\u01A1ng 4"),N.forEach(h),x=a(r,", v\xEC v\u1EADy \u0111\xE2y th\u1EF1c s\u1EF1 l\xE0 ch\u01B0\u01A1ng m\xE0 m\u1ECDi th\u1EE9 k\u1EBFt h\u1EE3p v\u1EDBi nhau!"),r.forEach(h),_=w(p),P=o(p,"P",{});var H=s(P);O=a(H,"M\u1ED7i ph\u1EA7n c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c \u0111\u1ECDc \u0111\u1ED9c l\u1EADp."),H.forEach(h),this.h()},h(){A(i,"href","/course/chapter3"),A(u,"href","/course/chapter5"),A(y,"href","/course/chap6"),A(d,"href","/course/chap4")},m(p,r){k(p,e,r),t(e,g),t(e,i),t(i,v),t(e,b),t(e,u),t(u,q),t(e,$),t(e,y),t(y,I),t(e,G),t(e,d),t(d,E),t(e,x),k(p,_,r),k(p,P,r),t(P,O)},d(p){p&&h(e),p&&h(_),p&&h(P)}}}function Mt(B){let e,g,i,v,b,u,q,$,y,I,G,d,E,x,_,P,O,p,r,L,D,V,N,H,W,R,F,X,K;return{c(){e=l("p"),g=c("\u0110\u1EC3 l\xE0m \u0111\u01B0\u1EE3c \u0111i\u1EC1u n\xE0y, b\u1EA1n s\u1EBD c\u1EA7n t\u1EADn d\u1EE5ng m\u1ECDi th\u1EE9 b\u1EA1n \u0111\xE3 h\u1ECDc v\u1EC1 API "),i=l("code"),v=c("Trainer"),b=c(" v\xE0 th\u01B0 vi\u1EC7n \u{1F917} Accelerate trong "),u=l("a"),q=c("Ch\u01B0\u01A1ng 3"),$=c(", th\u01B0 vi\u1EC7n \u{1F917} Datasets trong "),y=l("a"),I=c("Chapter 5"),G=c(", v\xE0 th\u01B0 vi\u1EC7n \u{1F917} Tokenizers trong "),d=l("a"),E=c("Ch\u01B0\u01A1ng 6"),x=c(". Ch\xFAng ta c\u0169ng s\u1EBD t\u1EA3i k\u1EBFt qu\u1EA3 c\u1EE7a m\xECnh l\xEAn Model Hub, gi\u1ED1ng nh\u01B0 \u0111\xE3 l\xE0m trong "),_=l("a"),P=c("Ch\u01B0\u01A1ng 4"),O=c(", v\xEC v\u1EADy \u0111\xE2y th\u1EF1c s\u1EF1 l\xE0 ch\u01B0\u01A1ng m\xE0 m\u1ECDi th\u1EE9 k\u1EBFt h\u1EE3p v\u1EDBi nhau!"),p=T(),r=l("p"),L=c("M\u1ED7i ph\u1EA7n c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c \u0111\u1ECDc \u0111\u1ED9c l\u1EADp v\xE0 s\u1EBD ch\u1EC9 cho b\u1EA1n c\xE1ch hu\u1EA5n luy\u1EC7n m\u1ED9t m\xF4 h\xECnh b\u1EB1ng API "),D=l("code"),V=c("Trainer"),N=c(" ho\u1EB7c v\u1EDBi v\xF2ng hu\u1EA5n luy\u1EC7n c\u1EE7a ri\xEAng b\u1EA1n, s\u1EED d\u1EE5ng \u{1F917} Accelerate. Vui l\xF2ng b\u1ECF qua m\u1ED9t trong hai ph\u1EA7n v\xE0 t\u1EADp trung v\xE0o ph\u1EA7n m\xE0 b\u1EA1n quan t\xE2m nh\u1EA5t: API "),H=l("code"),W=c("Trainer"),R=c(" r\u1EA5t tuy\u1EC7t v\u1EDDi \u0111\u1EC3 tinh ch\u1EC9nh ho\u1EB7c hu\u1EA5n luy\u1EC7n m\xF4 h\xECnh c\u1EE7a b\u1EA1n m\xE0 kh\xF4ng c\u1EA7n lo l\u1EAFng v\u1EC1 nh\u1EEFng g\xEC \u0111ang di\u1EC5n ra \u1EDF ph\xEDa sau, trong khi v\xF2ng hu\u1EA5n luy\u1EC7n v\u1EDBi "),F=l("code"),X=c("Accelerate"),K=c(" s\u1EBD cho ph\xE9p b\u1EA1n t\xF9y ch\u1EC9nh b\u1EA5t k\u1EF3 ph\u1EA7n n\xE0o b\u1EA1n mu\u1ED1n d\u1EC5 d\xE0ng h\u01A1n."),this.h()},l(C){e=o(C,"P",{});var m=s(e);g=a(m,"\u0110\u1EC3 l\xE0m \u0111\u01B0\u1EE3c \u0111i\u1EC1u n\xE0y, b\u1EA1n s\u1EBD c\u1EA7n t\u1EADn d\u1EE5ng m\u1ECDi th\u1EE9 b\u1EA1n \u0111\xE3 h\u1ECDc v\u1EC1 API "),i=o(m,"CODE",{});var j=s(i);v=a(j,"Trainer"),j.forEach(h),b=a(m," v\xE0 th\u01B0 vi\u1EC7n \u{1F917} Accelerate trong "),u=o(m,"A",{href:!0});var tt=s(u);q=a(tt,"Ch\u01B0\u01A1ng 3"),tt.forEach(h),$=a(m,", th\u01B0 vi\u1EC7n \u{1F917} Datasets trong "),y=o(m,"A",{href:!0});var nt=s(y);I=a(nt,"Chapter 5"),nt.forEach(h),G=a(m,", v\xE0 th\u01B0 vi\u1EC7n \u{1F917} Tokenizers trong "),d=o(m,"A",{href:!0});var Q=s(d);E=a(Q,"Ch\u01B0\u01A1ng 6"),Q.forEach(h),x=a(m,". Ch\xFAng ta c\u0169ng s\u1EBD t\u1EA3i k\u1EBFt qu\u1EA3 c\u1EE7a m\xECnh l\xEAn Model Hub, gi\u1ED1ng nh\u01B0 \u0111\xE3 l\xE0m trong "),_=o(m,"A",{href:!0});var et=s(_);P=a(et,"Ch\u01B0\u01A1ng 4"),et.forEach(h),O=a(m,", v\xEC v\u1EADy \u0111\xE2y th\u1EF1c s\u1EF1 l\xE0 ch\u01B0\u01A1ng m\xE0 m\u1ECDi th\u1EE9 k\u1EBFt h\u1EE3p v\u1EDBi nhau!"),m.forEach(h),p=w(C),r=o(C,"P",{});var M=s(r);L=a(M,"M\u1ED7i ph\u1EA7n c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c \u0111\u1ECDc \u0111\u1ED9c l\u1EADp v\xE0 s\u1EBD ch\u1EC9 cho b\u1EA1n c\xE1ch hu\u1EA5n luy\u1EC7n m\u1ED9t m\xF4 h\xECnh b\u1EB1ng API "),D=o(M,"CODE",{});var U=s(D);V=a(U,"Trainer"),U.forEach(h),N=a(M," ho\u1EB7c v\u1EDBi v\xF2ng hu\u1EA5n luy\u1EC7n c\u1EE7a ri\xEAng b\u1EA1n, s\u1EED d\u1EE5ng \u{1F917} Accelerate. Vui l\xF2ng b\u1ECF qua m\u1ED9t trong hai ph\u1EA7n v\xE0 t\u1EADp trung v\xE0o ph\u1EA7n m\xE0 b\u1EA1n quan t\xE2m nh\u1EA5t: API "),H=o(M,"CODE",{});var z=s(H);W=a(z,"Trainer"),z.forEach(h),R=a(M," r\u1EA5t tuy\u1EC7t v\u1EDDi \u0111\u1EC3 tinh ch\u1EC9nh ho\u1EB7c hu\u1EA5n luy\u1EC7n m\xF4 h\xECnh c\u1EE7a b\u1EA1n m\xE0 kh\xF4ng c\u1EA7n lo l\u1EAFng v\u1EC1 nh\u1EEFng g\xEC \u0111ang di\u1EC5n ra \u1EDF ph\xEDa sau, trong khi v\xF2ng hu\u1EA5n luy\u1EC7n v\u1EDBi "),F=o(M,"CODE",{});var Y=s(F);X=a(Y,"Accelerate"),Y.forEach(h),K=a(M," s\u1EBD cho ph\xE9p b\u1EA1n t\xF9y ch\u1EC9nh b\u1EA5t k\u1EF3 ph\u1EA7n n\xE0o b\u1EA1n mu\u1ED1n d\u1EC5 d\xE0ng h\u01A1n."),M.forEach(h),this.h()},h(){A(u,"href","/course/chapter3"),A(y,"href","/course/chapter5"),A(d,"href","/course/chap6"),A(_,"href","/course/chap4")},m(C,m){k(C,e,m),t(e,g),t(e,i),t(i,v),t(e,b),t(e,u),t(u,q),t(e,$),t(e,y),t(y,I),t(e,G),t(e,d),t(d,E),t(e,x),t(e,_),t(_,P),t(e,O),k(C,p,m),k(C,r,m),t(r,L),t(r,D),t(D,V),t(r,N),t(r,H),t(H,W),t(r,R),t(r,F),t(F,X),t(r,K)},d(C){C&&h(e),C&&h(p),C&&h(r)}}}function Lt(B){let e,g;return{c(){e=l("p"),g=c("N\u1EBFu b\u1EA1n \u0111\u1ECDc c\xE1c ph\u1EA7n theo tr\xECnh t\u1EF1, b\u1EA1n s\u1EBD nh\u1EADn th\u1EA5y r\u1EB1ng ch\xFAng c\xF3 kh\xE1 nhi\u1EC1u \u0111i\u1EC3m chung v\u1EC1 \u0111o\u1EA1n m\xE3 v\xE0 v\u0103n xu\xF4i m\xF4 t\u1EA3. Vi\u1EC7c l\u1EB7p l\u1EA1i l\xE0 c\xF3 ch\u1EE7 \u0111\xEDch, \u0111\u1EC3 cho ph\xE9p b\u1EA1n nh\xFAng tay v\xE0o (ho\u1EB7c quay l\u1EA1i sau) b\u1EA5t k\u1EF3 t\xE1c v\u1EE5 n\xE0o m\xE0 b\u1EA1n quan t\xE2m v\xE0 t\xECm th\u1EA5y m\u1ED9t v\xED d\u1EE5 ho\u1EA1t \u0111\u1ED9ng ho\xE0n ch\u1EC9nh.")},l(i){e=o(i,"P",{});var v=s(e);g=a(v,"N\u1EBFu b\u1EA1n \u0111\u1ECDc c\xE1c ph\u1EA7n theo tr\xECnh t\u1EF1, b\u1EA1n s\u1EBD nh\u1EADn th\u1EA5y r\u1EB1ng ch\xFAng c\xF3 kh\xE1 nhi\u1EC1u \u0111i\u1EC3m chung v\u1EC1 \u0111o\u1EA1n m\xE3 v\xE0 v\u0103n xu\xF4i m\xF4 t\u1EA3. Vi\u1EC7c l\u1EB7p l\u1EA1i l\xE0 c\xF3 ch\u1EE7 \u0111\xEDch, \u0111\u1EC3 cho ph\xE9p b\u1EA1n nh\xFAng tay v\xE0o (ho\u1EB7c quay l\u1EA1i sau) b\u1EA5t k\u1EF3 t\xE1c v\u1EE5 n\xE0o m\xE0 b\u1EA1n quan t\xE2m v\xE0 t\xECm th\u1EA5y m\u1ED9t v\xED d\u1EE5 ho\u1EA1t \u0111\u1ED9ng ho\xE0n ch\u1EC9nh."),v.forEach(h)},m(i,v){k(i,e,v),t(e,g)},d(i){i&&h(e)}}}function Dt(B){let e,g,i,v,b,u,q,$,y,I,G,d,E,x,_,P,O,p,r,L,D,V,N,H,W,R,F,X,K,C,m,j,tt,nt,Q,et,M,U,z,Y;i=new qt({props:{fw:B[0]}}),$=new wt({});function pt(n,f){return n[0]==="pt"?Mt:It}let rt=pt(B),J=rt(B);return z=new Tt({props:{$$slots:{default:[Lt]},$$scope:{ctx:B}}}),{c(){e=l("meta"),g=T(),at(i.$$.fragment),v=T(),b=l("h1"),u=l("a"),q=l("span"),at($.$$.fragment),y=T(),I=l("span"),G=c("Gi\u1EDBi thi\u1EC7u"),d=T(),E=l("p"),x=c("Trong "),_=l("a"),P=c("Ch\u01B0\u01A1ng 3"),O=c(", b\u1EA1n \u0111\xE3 th\u1EA5y c\xE1ch tinh ch\u1EC9nh m\u1ED9t m\xF4 h\xECnh \u0111\u1EC3 ph\xE2n lo\u1EA1i v\u0103n b\u1EA3n. Trong ch\u01B0\u01A1ng n\xE0y, ch\xFAng ta s\u1EBD gi\u1EA3i quy\u1EBFt c\xE1c t\xE1c v\u1EE5 NLP ph\u1ED5 bi\u1EBFn sau:"),p=T(),r=l("ul"),L=l("li"),D=c("Ph\u1EA7n lo\u1EA1i token"),V=T(),N=l("li"),H=c("M\xF4 h\xECnh ng\xF4n ng\u1EEF b\u1ECB \u1EA9n \u0111i (nh\u01B0 BERT)"),W=T(),R=l("li"),F=c("T\xF3m t\u1EAFt"),X=T(),K=l("li"),C=c("D\u1ECBch m\xE1y"),m=T(),j=l("li"),tt=c("M\xF4 h\xECnh ng\xF4n ng\u1EEF nh\xE2n qu\u1EA3 hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc (nh\u01B0 GPT-2)"),nt=T(),Q=l("li"),et=c("H\u1ECFi \u0111\xE1p"),M=T(),J.c(),U=T(),at(z.$$.fragment),this.h()},l(n){const f=At('[data-svelte="svelte-1phssyn"]',document.head);e=o(f,"META",{name:!0,content:!0}),f.forEach(h),g=w(n),lt(i.$$.fragment,n),v=w(n),b=o(n,"H1",{class:!0});var Z=s(b);u=o(Z,"A",{id:!0,class:!0,href:!0});var ht=s(u);q=o(ht,"SPAN",{});var mt=s(q);lt($.$$.fragment,mt),mt.forEach(h),ht.forEach(h),y=w(Z),I=o(Z,"SPAN",{});var ft=s(I);G=a(ft,"Gi\u1EDBi thi\u1EC7u"),ft.forEach(h),Z.forEach(h),d=w(n),E=o(n,"P",{});var ct=s(E);x=a(ct,"Trong "),_=o(ct,"A",{href:!0});var vt=s(_);P=a(vt,"Ch\u01B0\u01A1ng 3"),vt.forEach(h),O=a(ct,", b\u1EA1n \u0111\xE3 th\u1EA5y c\xE1ch tinh ch\u1EC9nh m\u1ED9t m\xF4 h\xECnh \u0111\u1EC3 ph\xE2n lo\u1EA1i v\u0103n b\u1EA3n. Trong ch\u01B0\u01A1ng n\xE0y, ch\xFAng ta s\u1EBD gi\u1EA3i quy\u1EBFt c\xE1c t\xE1c v\u1EE5 NLP ph\u1ED5 bi\u1EBFn sau:"),ct.forEach(h),p=w(n),r=o(n,"UL",{});var S=s(r);L=o(S,"LI",{});var gt=s(L);D=a(gt,"Ph\u1EA7n lo\u1EA1i token"),gt.forEach(h),V=w(S),N=o(S,"LI",{});var dt=s(N);H=a(dt,"M\xF4 h\xECnh ng\xF4n ng\u1EEF b\u1ECB \u1EA9n \u0111i (nh\u01B0 BERT)"),dt.forEach(h),W=w(S),R=o(S,"LI",{});var _t=s(R);F=a(_t,"T\xF3m t\u1EAFt"),_t.forEach(h),X=w(S),K=o(S,"LI",{});var bt=s(K);C=a(bt,"D\u1ECBch m\xE1y"),bt.forEach(h),m=w(S),j=o(S,"LI",{});var yt=s(j);tt=a(yt,"M\xF4 h\xECnh ng\xF4n ng\u1EEF nh\xE2n qu\u1EA3 hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc (nh\u01B0 GPT-2)"),yt.forEach(h),nt=w(S),Q=o(S,"LI",{});var Et=s(Q);et=a(Et,"H\u1ECFi \u0111\xE1p"),Et.forEach(h),S.forEach(h),M=w(n),J.l(n),U=w(n),lt(z.$$.fragment,n),this.h()},h(){A(e,"name","hf:doc:metadata"),A(e,"content",JSON.stringify(Nt)),A(u,"id","gii-thiu"),A(u,"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"),A(u,"href","#gii-thiu"),A(b,"class","relative group"),A(_,"href","/course/chapter3")},m(n,f){t(document.head,e),k(n,g,f),ot(i,n,f),k(n,v,f),k(n,b,f),t(b,u),t(u,q),ot($,q,null),t(b,y),t(b,I),t(I,G),k(n,d,f),k(n,E,f),t(E,x),t(E,_),t(_,P),t(E,O),k(n,p,f),k(n,r,f),t(r,L),t(L,D),t(r,V),t(r,N),t(N,H),t(r,W),t(r,R),t(R,F),t(r,X),t(r,K),t(K,C),t(r,m),t(r,j),t(j,tt),t(r,nt),t(r,Q),t(Q,et),k(n,M,f),J.m(n,f),k(n,U,f),ot(z,n,f),Y=!0},p(n,[f]){const Z={};f&1&&(Z.fw=n[0]),i.$set(Z),rt!==(rt=pt(n))&&(J.d(1),J=rt(n),J&&(J.c(),J.m(U.parentNode,U)));const ht={};f&2&&(ht.$$scope={dirty:f,ctx:n}),z.$set(ht)},i(n){Y||(it(i.$$.fragment,n),it($.$$.fragment,n),it(z.$$.fragment,n),Y=!0)},o(n){st(i.$$.fragment,n),st($.$$.fragment,n),st(z.$$.fragment,n),Y=!1},d(n){h(e),n&&h(g),ut(i,n),n&&h(v),n&&h(b),ut($),n&&h(d),n&&h(E),n&&h(p),n&&h(r),n&&h(M),J.d(n),n&&h(U),ut(z,n)}}}const Nt={local:"gii-thiu",title:"Gi\u1EDBi thi\u1EC7u"};function Ht(B,e,g){let i="pt";return Pt(()=>{const v=new URLSearchParams(window.location.search);g(0,i=v.get("fw")||"pt")}),[i]}class zt extends kt{constructor(e){super();$t(this,e,Ht,Dt,Ct,{})}}export{zt as default,Nt as metadata};
