import{S as oa,i as ha,s as ra,e as r,k as l,w as m,t as i,M as aa,c as a,d as n,m as u,a as c,x as d,h as o,b as p,N as ei,G as e,g as h,y as f,q as _,o as b,B as k,v as ca}from"../../chunks/vendor-hf-doc-builder.js";import{T as Oh}from"../../chunks/Tip-hf-doc-builder.js";import{Y as zh}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Sh}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as y}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as la}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function ua(U){let g,q;return{c(){g=r("p"),q=i("\u{1F6A8} B\u1EA1n c\xF3 th\u1EA5y h\u1ED9p m\xE0u xanh lam xung quanh \u201C6 frames\u201D trong ph\u1EA7n truy xu\u1EA5t t\u1EEB Google Colab kh\xF4ng? \u0110\xF3 l\xE0 m\u1ED9t t\xEDnh n\u0103ng \u0111\u1EB7c bi\u1EC7t c\u1EE7a Colab, n\xE9n ph\u1EA7n truy xu\u1EA5t v\xE0o c\xE1c \u201Cframes\u201D. N\u1EBFu b\u1EA1n d\u01B0\u1EDDng nh\u01B0 kh\xF4ng th\u1EC3 t\xECm ra ngu\u1ED3n g\u1ED1c c\u1EE7a l\u1ED7i, h\xE3y \u0111\u1EA3m b\u1EA3o r\u1EB1ng b\u1EA1n m\u1EDF r\u1ED9ng to\xE0n b\u1ED9 theo d\xF5i b\u1EB1ng c\xE1ch nh\u1EA5p v\xE0o hai m\u0169i t\xEAn nh\u1ECF \u0111\xF3.")},l(v){g=a(v,"P",{});var w=c(g);q=o(w,"\u{1F6A8} B\u1EA1n c\xF3 th\u1EA5y h\u1ED9p m\xE0u xanh lam xung quanh \u201C6 frames\u201D trong ph\u1EA7n truy xu\u1EA5t t\u1EEB Google Colab kh\xF4ng? \u0110\xF3 l\xE0 m\u1ED9t t\xEDnh n\u0103ng \u0111\u1EB7c bi\u1EC7t c\u1EE7a Colab, n\xE9n ph\u1EA7n truy xu\u1EA5t v\xE0o c\xE1c \u201Cframes\u201D. N\u1EBFu b\u1EA1n d\u01B0\u1EDDng nh\u01B0 kh\xF4ng th\u1EC3 t\xECm ra ngu\u1ED3n g\u1ED1c c\u1EE7a l\u1ED7i, h\xE3y \u0111\u1EA3m b\u1EA3o r\u1EB1ng b\u1EA1n m\u1EDF r\u1ED9ng to\xE0n b\u1ED9 theo d\xF5i b\u1EB1ng c\xE1ch nh\u1EA5p v\xE0o hai m\u0169i t\xEAn nh\u1ECF \u0111\xF3."),w.forEach(n)},m(v,w){h(v,g,w),e(g,q)},d(v){v&&n(g)}}}function pa(U){let g,q,v,w,D,$,C,O,I,Z,M;return{c(){g=r("p"),q=i("\u{1F4A1} N\u1EBFu b\u1EA1n g\u1EB7p ph\u1EA3i th\xF4ng b\xE1o l\u1ED7i kh\xF3 hi\u1EC3u, ch\u1EC9 c\u1EA7n sao ch\xE9p v\xE0 d\xE1n th\xF4ng b\xE1o \u0111\xF3 v\xE0o thanh t\xECm ki\u1EBFm Google ho\u1EB7c "),v=r("a"),w=i("Stack Overflow"),D=i(" (v\xE2ng, th\u1EF1c s\u1EF1!). C\xF3 nhi\u1EC1u kh\u1EA3 n\u0103ng b\u1EA1n kh\xF4ng ph\u1EA3i l\xE0 ng\u01B0\u1EDDi \u0111\u1EA7u ti\xEAn g\u1EB7p ph\u1EA3i l\u1ED7i v\xE0 \u0111\xE2y l\xE0 m\u1ED9t c\xE1ch t\u1ED1t \u0111\u1EC3 t\xECm gi\u1EA3i ph\xE1p m\xE0 nh\u1EEFng ng\u01B0\u1EDDi kh\xE1c trong c\u1ED9ng \u0111\u1ED3ng \u0111\xE3 \u0111\u0103ng. V\xED d\u1EE5: t\xECm ki\u1EBFm "),$=r("code"),C=i("OSError: Can't load config for"),O=i(" tr\xEAn Stack Overflow mang l\u1EA1i nhi\u1EC1u "),I=r("a"),Z=i("l\u1EA7n truy c\u1EADp"),M=i(" c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng nh\u01B0 m\u1ED9t \u0111i\u1EC3m kh\u1EDFi \u0111\u1EA7u \u0111\u1EC3 gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1."),this.h()},l(L){g=a(L,"P",{});var x=c(g);q=o(x,"\u{1F4A1} N\u1EBFu b\u1EA1n g\u1EB7p ph\u1EA3i th\xF4ng b\xE1o l\u1ED7i kh\xF3 hi\u1EC3u, ch\u1EC9 c\u1EA7n sao ch\xE9p v\xE0 d\xE1n th\xF4ng b\xE1o \u0111\xF3 v\xE0o thanh t\xECm ki\u1EBFm Google ho\u1EB7c "),v=a(x,"A",{href:!0,rel:!0});var ln=c(v);w=o(ln,"Stack Overflow"),ln.forEach(n),D=o(x," (v\xE2ng, th\u1EF1c s\u1EF1!). C\xF3 nhi\u1EC1u kh\u1EA3 n\u0103ng b\u1EA1n kh\xF4ng ph\u1EA3i l\xE0 ng\u01B0\u1EDDi \u0111\u1EA7u ti\xEAn g\u1EB7p ph\u1EA3i l\u1ED7i v\xE0 \u0111\xE2y l\xE0 m\u1ED9t c\xE1ch t\u1ED1t \u0111\u1EC3 t\xECm gi\u1EA3i ph\xE1p m\xE0 nh\u1EEFng ng\u01B0\u1EDDi kh\xE1c trong c\u1ED9ng \u0111\u1ED3ng \u0111\xE3 \u0111\u0103ng. V\xED d\u1EE5: t\xECm ki\u1EBFm "),$=a(x,"CODE",{});var W=c($);C=o(W,"OSError: Can't load config for"),W.forEach(n),O=o(x," tr\xEAn Stack Overflow mang l\u1EA1i nhi\u1EC1u "),I=a(x,"A",{href:!0,rel:!0});var un=c(I);Z=o(un,"l\u1EA7n truy c\u1EADp"),un.forEach(n),M=o(x," c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng nh\u01B0 m\u1ED9t \u0111i\u1EC3m kh\u1EDFi \u0111\u1EA7u \u0111\u1EC3 gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1."),x.forEach(n),this.h()},h(){p(v,"href","https://stackoverflow.com/"),p(v,"rel","nofollow"),p(I,"href","https://stackoverflow.com/search?q=OSError%3A+Can%27t+load+config+for+"),p(I,"rel","nofollow")},m(L,x){h(L,g,x),e(g,q),e(g,v),e(v,w),e(g,D),e(g,$),e($,C),e(g,O),e(g,I),e(I,Z),e(g,M)},d(L){L&&n(g)}}}function ga(U){let g,q,v,w,D;return{c(){g=r("p"),q=i("\u{1F6A8} C\xE1ch ti\u1EBFp c\u1EADn m\xE0 ch\xFAng t\xF4i \u0111ang th\u1EF1c hi\u1EC7n \u1EDF \u0111\xE2y kh\xF4ng ph\u1EA3i l\xE0 ho\xE0n h\u1EA3o, v\xEC \u0111\u1ED3ng nghi\u1EC7p c\u1EE7a ch\xFAng ta c\xF3 th\u1EC3 \u0111\xE3 ch\u1EC9nh s\u1EEDa c\u1EA5u h\xECnh c\u1EE7a "),v=r("code"),w=i("distilbert-base-uncased"),D=i(" tr\u01B0\u1EDBc khi tinh ch\u1EC9nh m\xF4 h\xECnh. Trong th\u1EF1c t\u1EBF, ch\xFAng ta mu\u1ED1n ki\u1EC3m tra v\u1EDBi h\u1ECD tr\u01B0\u1EDBc, nh\u01B0ng v\u1EDBi m\u1EE5c \u0111\xEDch c\u1EE7a ph\u1EA7n n\xE0y, ch\xFAng ta s\u1EBD gi\u1EA3 \u0111\u1ECBnh r\u1EB1ng h\u1ECD \u0111\xE3 s\u1EED d\u1EE5ng c\u1EA5u h\xECnh m\u1EB7c \u0111\u1ECBnh.")},l($){g=a($,"P",{});var C=c(g);q=o(C,"\u{1F6A8} C\xE1ch ti\u1EBFp c\u1EADn m\xE0 ch\xFAng t\xF4i \u0111ang th\u1EF1c hi\u1EC7n \u1EDF \u0111\xE2y kh\xF4ng ph\u1EA3i l\xE0 ho\xE0n h\u1EA3o, v\xEC \u0111\u1ED3ng nghi\u1EC7p c\u1EE7a ch\xFAng ta c\xF3 th\u1EC3 \u0111\xE3 ch\u1EC9nh s\u1EEDa c\u1EA5u h\xECnh c\u1EE7a "),v=a(C,"CODE",{});var O=c(v);w=o(O,"distilbert-base-uncased"),O.forEach(n),D=o(C," tr\u01B0\u1EDBc khi tinh ch\u1EC9nh m\xF4 h\xECnh. Trong th\u1EF1c t\u1EBF, ch\xFAng ta mu\u1ED1n ki\u1EC3m tra v\u1EDBi h\u1ECD tr\u01B0\u1EDBc, nh\u01B0ng v\u1EDBi m\u1EE5c \u0111\xEDch c\u1EE7a ph\u1EA7n n\xE0y, ch\xFAng ta s\u1EBD gi\u1EA3 \u0111\u1ECBnh r\u1EB1ng h\u1ECD \u0111\xE3 s\u1EED d\u1EE5ng c\u1EA5u h\xECnh m\u1EB7c \u0111\u1ECBnh."),C.forEach(n)},m($,C){h($,g,C),e(g,q),e(g,v),e(v,w),e(g,D)},d($){$&&n(g)}}}function ma(U){let g,q,v,w,D,$,C,O,I,Z,M,L,x,ln,W,un,si,qe,ft,Ee,G,ii,_t,oi,hi,bt,ri,ai,je,kt,Ce,pn,ci,Te,vt,Pe,tt,li,On,ui,pi,Ae,yt,De,nt,gi,zn,mi,di,Oe,X,et,Sn,wt,fi,Nn,_i,ze,gn,bi,Se,mn,$t,ki,dn,vi,yi,Ne,st,wi,Hn,$i,xi,He,xt,Ie,qt,Me,V,qi,In,Ei,ji,Mn,Ci,Ti,Le,Et,jt,Nh,Ge,T,Pi,Ln,Ai,Di,Gn,Oi,zi,fn,Si,Ni,Vn,Hi,Ii,Ve,it,Be,B,Mi,Bn,Li,Gi,Qn,Vi,Bi,Qe,Ct,Fe,ot,Re,_n,Qi,Ye,Tt,Pt,Hh,Je,bn,Fi,We,At,Dt,Ih,Xe,kn,Ri,Ke,Ot,Ue,zt,Ze,Q,Yi,Fn,Ji,Wi,Rn,Xi,Ki,ts,St,ns,Nt,es,E,Ui,Yn,Zi,to,Jn,no,eo,Ht,Wn,so,io,vn,oo,ho,Xn,ro,ao,ss,It,is,ht,os,rt,co,Kn,lo,uo,hs,Mt,rs,at,po,Un,go,mo,as,Lt,cs,Gt,ls,yn,fo,us,z,Vt,_o,Zn,bo,ko,vo,te,yo,wo,ne,$o,xo,Bt,qo,ee,Eo,jo,ps,wn,Co,gs,K,ct,se,Qt,To,ie,Po,ms,F,Ao,oe,Do,Oo,he,zo,So,ds,Ft,fs,$n,No,_s,Rt,bs,lt,Ho,xn,Io,Mo,ks,Yt,vs,Jt,ys,qn,Lo,ws,Wt,$s,En,Go,xs,Xt,qs,P,Vo,re,Bo,Qo,ae,Fo,Ro,ce,Yo,Jo,le,Wo,Xo,Es,A,Ko,ue,Uo,Zo,pe,th,nh,ge,eh,sh,me,ih,oh,js,Kt,Cs,Ut,Ts,ut,hh,de,rh,ah,Ps,Zt,As,tn,Ds,j,ch,fe,lh,uh,jn,ph,gh,_e,mh,dh,be,fh,_h,ke,bh,kh,Os,nn,zs,S,vh,ve,yh,wh,ye,$h,xh,en,qh,Eh,Ss,sn,on,Mh,Ns,pt,jh,we,Ch,Th,Hs,hn,Is,rn,Ms,gt,Ph,an,Ah,Dh,Ls;return $=new Sh({}),M=new la({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/vi/chapter8/section2.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/vi/chapter8/section2.ipynb"}]}}),ft=new zh({props:{id:"DQ-CpJn6Rc4"}}),kt=new y({props:{code:`from huggingface_hub import notebook_login

notebook_login()`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`}}),vt=new y({props:{code:"huggingface-cli login",highlighted:"huggingface-cli login"}}),yt=new y({props:{code:`from distutils.dir_util import copy_tree
from huggingface_hub import Repository, snapshot_download, create_repo, get_full_repo_name


def copy_repository_template():
    # Sao ch\xE9p kho v\xE0 tr\xEDch xu\u1EA5t \u0111\u01B0\u1EDDng d\u1EABn c\u1EE5c b\u1ED9
    template_repo_id = "lewtun/distilbert-base-uncased-finetuned-squad-d5716d28"
    commit_hash = "be3eaffc28669d7932492681cd5f3e8905e358b4"
    template_repo_dir = snapshot_download(template_repo_id, revision=commit_hash)
    # T\u1EA1o ra m\u1ED9t kho r\u1ED7ng tr\xEAn Hub
    model_name = template_repo_id.split("/")[1]
    create_repo(model_name, exist_ok=True)
    # Sao ch\xE9p kho r\u1ED7ng
    new_repo_id = get_full_repo_name(model_name)
    new_repo_dir = model_name
    repo = Repository(local_dir=new_repo_dir, clone_from=new_repo_id)
    # Sao ch\xE9p c\xE1c t\u1EC7p
    copy_tree(template_repo_dir, new_repo_dir)
    # \u0110\u1EA9y l\xEAn Hub
    repo.push_to_hub()`,highlighted:`<span class="hljs-keyword">from</span> distutils.dir_util <span class="hljs-keyword">import</span> copy_tree
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository, snapshot_download, create_repo, get_full_repo_name


<span class="hljs-keyword">def</span> <span class="hljs-title function_">copy_repository_template</span>():
    <span class="hljs-comment"># Sao ch\xE9p kho v\xE0 tr\xEDch xu\u1EA5t \u0111\u01B0\u1EDDng d\u1EABn c\u1EE5c b\u1ED9</span>
    template_repo_id = <span class="hljs-string">&quot;lewtun/distilbert-base-uncased-finetuned-squad-d5716d28&quot;</span>
    commit_hash = <span class="hljs-string">&quot;be3eaffc28669d7932492681cd5f3e8905e358b4&quot;</span>
    template_repo_dir = snapshot_download(template_repo_id, revision=commit_hash)
    <span class="hljs-comment"># T\u1EA1o ra m\u1ED9t kho r\u1ED7ng tr\xEAn Hub</span>
    model_name = template_repo_id.split(<span class="hljs-string">&quot;/&quot;</span>)[<span class="hljs-number">1</span>]
    create_repo(model_name, exist_ok=<span class="hljs-literal">True</span>)
    <span class="hljs-comment"># Sao ch\xE9p kho r\u1ED7ng</span>
    new_repo_id = get_full_repo_name(model_name)
    new_repo_dir = model_name
    repo = Repository(local_dir=new_repo_dir, clone_from=new_repo_id)
    <span class="hljs-comment"># Sao ch\xE9p c\xE1c t\u1EC7p</span>
    copy_tree(template_repo_dir, new_repo_dir)
    <span class="hljs-comment"># \u0110\u1EA9y l\xEAn Hub</span>
    repo.push_to_hub()`}}),wt=new Sh({}),xt=new y({props:{code:`from transformers import pipeline

model_checkpoint = get_full_repo_name("distillbert-base-uncased-finetuned-squad-d5716d28")
reader = pipeline("question-answering", model=model_checkpoint)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

model_checkpoint = get_full_repo_name(<span class="hljs-string">&quot;distillbert-base-uncased-finetuned-squad-d5716d28&quot;</span>)
reader = pipeline(<span class="hljs-string">&quot;question-answering&quot;</span>, model=model_checkpoint)`}}),qt=new y({props:{code:`"""
OSError: Can't load config for 'lewtun/distillbert-base-uncased-finetuned-squad-d5716d28'. Make sure that:

- 'lewtun/distillbert-base-uncased-finetuned-squad-d5716d28' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'lewtun/distillbert-base-uncased-finetuned-squad-d5716d28' is the correct path to a directory containing a config.json file
"""`,highlighted:`<span class="hljs-string">&quot;&quot;&quot;
OSError: Can&#x27;t load config for &#x27;lewtun/distillbert-base-uncased-finetuned-squad-d5716d28&#x27;. Make sure that:

- &#x27;lewtun/distillbert-base-uncased-finetuned-squad-d5716d28&#x27; is a correct model identifier listed on &#x27;https://huggingface.co/models&#x27;

- or &#x27;lewtun/distillbert-base-uncased-finetuned-squad-d5716d28&#x27; is the correct path to a directory containing a config.json file
&quot;&quot;&quot;</span>`}}),it=new Oh({props:{$$slots:{default:[ua]},$$scope:{ctx:U}}}),Ct=new y({props:{code:`"""
Make sure that:

- 'lewtun/distillbert-base-uncased-finetuned-squad-d5716d28' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'lewtun/distillbert-base-uncased-finetuned-squad-d5716d28' is the correct path to a directory containing a config.json file
"""`,highlighted:`<span class="hljs-string">&quot;&quot;&quot;
Make sure that:

- &#x27;lewtun/distillbert-base-uncased-finetuned-squad-d5716d28&#x27; is a correct model identifier listed on &#x27;https://huggingface.co/models&#x27;

- or &#x27;lewtun/distillbert-base-uncased-finetuned-squad-d5716d28&#x27; is the correct path to a directory containing a config.json file
&quot;&quot;&quot;</span>`}}),ot=new Oh({props:{$$slots:{default:[pa]},$$scope:{ctx:U}}}),Ot=new y({props:{code:`model_checkpoint = get_full_repo_name("distilbert-base-uncased-finetuned-squad-d5716d28")
reader = pipeline("question-answering", model=model_checkpoint)`,highlighted:`model_checkpoint = get_full_repo_name(<span class="hljs-string">&quot;distilbert-base-uncased-finetuned-squad-d5716d28&quot;</span>)
reader = pipeline(<span class="hljs-string">&quot;question-answering&quot;</span>, model=model_checkpoint)`}}),zt=new y({props:{code:`"""
OSError: Can't load config for 'lewtun/distilbert-base-uncased-finetuned-squad-d5716d28'. Make sure that:

- 'lewtun/distilbert-base-uncased-finetuned-squad-d5716d28' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'lewtun/distilbert-base-uncased-finetuned-squad-d5716d28' is the correct path to a directory containing a config.json file
"""`,highlighted:`<span class="hljs-string">&quot;&quot;&quot;
OSError: Can&#x27;t load config for &#x27;lewtun/distilbert-base-uncased-finetuned-squad-d5716d28&#x27;. Make sure that:

- &#x27;lewtun/distilbert-base-uncased-finetuned-squad-d5716d28&#x27; is a correct model identifier listed on &#x27;https://huggingface.co/models&#x27;

- or &#x27;lewtun/distilbert-base-uncased-finetuned-squad-d5716d28&#x27; is the correct path to a directory containing a config.json file
&quot;&quot;&quot;</span>`}}),St=new y({props:{code:`from huggingface_hub import list_repo_files

list_repo_files(repo_id=model_checkpoint)`,highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_repo_files

list_repo_files(repo_id=model_checkpoint)`}}),Nt=new y({props:{code:"['.gitattributes', 'README.md', 'pytorch_model.bin', 'special_tokens_map.json', 'tokenizer_config.json', 'training_args.bin', 'vocab.txt']",highlighted:'[<span class="hljs-string">&#x27;.gitattributes&#x27;</span>, <span class="hljs-string">&#x27;README.md&#x27;</span>, <span class="hljs-string">&#x27;pytorch_model.bin&#x27;</span>, <span class="hljs-string">&#x27;special_tokens_map.json&#x27;</span>, <span class="hljs-string">&#x27;tokenizer_config.json&#x27;</span>, <span class="hljs-string">&#x27;training_args.bin&#x27;</span>, <span class="hljs-string">&#x27;vocab.txt&#x27;</span>]'}}),It=new y({props:{code:`from transformers import AutoConfig

pretrained_checkpoint = "distilbert-base-uncased"
config = AutoConfig.from_pretrained(pretrained_checkpoint)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoConfig

pretrained_checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>
config = AutoConfig.from_pretrained(pretrained_checkpoint)`}}),ht=new Oh({props:{warning:!0,$$slots:{default:[ga]},$$scope:{ctx:U}}}),Mt=new y({props:{code:'config.push_to_hub(model_checkpoint, commit_message="Add config.json")',highlighted:'config.push_to_hub(model_checkpoint, commit_message=<span class="hljs-string">&quot;Add config.json&quot;</span>)'}}),Lt=new y({props:{code:`reader = pipeline("question-answering", model=model_checkpoint, revision="main")

context = r"""
Extractive Question Answering is the task of extracting an answer from a text
given a question. An example of a question answering dataset is the SQuAD
dataset, which is entirely based on that task. If you would like to fine-tune a
model on a SQuAD task, you may leverage the
examples/pytorch/question-answering/run_squad.py script.

\u{1F917} Transformers is interoperable with the PyTorch, TensorFlow, and JAX
frameworks, so you can use your favourite tools for a wide variety of tasks!
"""

question = "What is extractive question answering?"
reader(question=question, context=context)`,highlighted:`reader = pipeline(<span class="hljs-string">&quot;question-answering&quot;</span>, model=model_checkpoint, revision=<span class="hljs-string">&quot;main&quot;</span>)

context = <span class="hljs-string">r&quot;&quot;&quot;
Extractive Question Answering is the task of extracting an answer from a text
given a question. An example of a question answering dataset is the SQuAD
dataset, which is entirely based on that task. If you would like to fine-tune a
model on a SQuAD task, you may leverage the
examples/pytorch/question-answering/run_squad.py script.

\u{1F917} Transformers is interoperable with the PyTorch, TensorFlow, and JAX
frameworks, so you can use your favourite tools for a wide variety of tasks!
&quot;&quot;&quot;</span>

question = <span class="hljs-string">&quot;What is extractive question answering?&quot;</span>
reader(question=question, context=context)`}}),Gt=new y({props:{code:`{'score': 0.38669535517692566,
 'start': 34,
 'end': 95,
 'answer': 'the task of extracting an answer from a text given a question'}`,highlighted:`{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.38669535517692566</span>,
 <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">34</span>,
 <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">95</span>,
 <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;the task of extracting an answer from a text given a question&#x27;</span>}`}}),Qt=new Sh({}),Ft=new y({props:{code:`tokenizer = reader.tokenizer
model = reader.model`,highlighted:`tokenizer = reader.tokenizer
model = reader.model`}}),Rt=new y({props:{code:'question = "Which frameworks can I use?"',highlighted:'question = <span class="hljs-string">&quot;Which frameworks can I use?&quot;</span>'}}),Yt=new y({props:{code:`import torch

inputs = tokenizer(question, context, add_special_tokens=True)
input_ids = inputs["input_ids"][0]
outputs = model(**inputs)
answer_start_scores = outputs.start_logits
answer_end_scores = outputs.end_logits
# L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 b\u1EAFt \u0111\u1EA7u c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1
answer_start = torch.argmax(answer_start_scores)
# L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 k\u1EBFt th\xFAc c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1
answer_end = torch.argmax(answer_end_scores) + 1
answer = tokenizer.convert_tokens_to_string(
    tokenizer.convert_ids_to_tokens(input_ids[answer_start:answer_end])
)
print(f"Question: {question}")
print(f"Answer: {answer}")`,highlighted:`<span class="hljs-keyword">import</span> torch

inputs = tokenizer(question, context, add_special_tokens=<span class="hljs-literal">True</span>)
input_ids = inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>]
outputs = model(**inputs)
answer_start_scores = outputs.start_logits
answer_end_scores = outputs.end_logits
<span class="hljs-comment"># L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 b\u1EAFt \u0111\u1EA7u c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1</span>
answer_start = torch.argmax(answer_start_scores)
<span class="hljs-comment"># L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 k\u1EBFt th\xFAc c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1</span>
answer_end = torch.argmax(answer_end_scores) + <span class="hljs-number">1</span>
answer = tokenizer.convert_tokens_to_string(
    tokenizer.convert_ids_to_tokens(input_ids[answer_start:answer_end])
)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Question: <span class="hljs-subst">{question}</span>&quot;</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Answer: <span class="hljs-subst">{answer}</span>&quot;</span>)`}}),Jt=new y({props:{code:`"""
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_75743/2725838073.py in <module>
      1 inputs = tokenizer(question, text, add_special_tokens=True)
      2 input_ids = inputs["input_ids"]
----> 3 outputs = model(**inputs)
      4 answer_start_scores = outputs.start_logits
      5 answer_end_scores = outputs.end_logits

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1050                 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1051             return forward_call(*input, **kwargs)
   1052         # Do not call functions when jit is used
   1053         full_backward_hooks, non_full_backward_hooks = [], []

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, start_positions, end_positions, output_attentions, output_hidden_states, return_dict)
    723         return_dict = return_dict if return_dict is not None else self.config.use_return_dict
    724
--> 725         distilbert_output = self.distilbert(
    726             input_ids=input_ids,
    727             attention_mask=attention_mask,

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1050                 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1051             return forward_call(*input, **kwargs)
   1052         # Do not call functions when jit is used
   1053         full_backward_hooks, non_full_backward_hooks = [], []

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)
    471             raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
    472         elif input_ids is not None:
--> 473             input_shape = input_ids.size()
    474         elif inputs_embeds is not None:
    475             input_shape = inputs_embeds.size()[:-1]

AttributeError: 'list' object has no attribute 'size'
"""`,highlighted:`<span class="hljs-string">&quot;&quot;&quot;
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_75743/2725838073.py in &lt;module&gt;
      1 inputs = tokenizer(question, text, add_special_tokens=True)
      2 input_ids = inputs[&quot;input_ids&quot;]
----&gt; 3 outputs = model(**inputs)
      4 answer_start_scores = outputs.start_logits
      5 answer_end_scores = outputs.end_logits

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1050                 or _global_forward_hooks or _global_forward_pre_hooks):
-&gt; 1051             return forward_call(*input, **kwargs)
   1052         # Do not call functions when jit is used
   1053         full_backward_hooks, non_full_backward_hooks = [], []

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, start_positions, end_positions, output_attentions, output_hidden_states, return_dict)
    723         return_dict = return_dict if return_dict is not None else self.config.use_return_dict
    724
--&gt; 725         distilbert_output = self.distilbert(
    726             input_ids=input_ids,
    727             attention_mask=attention_mask,

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1050                 or _global_forward_hooks or _global_forward_pre_hooks):
-&gt; 1051             return forward_call(*input, **kwargs)
   1052         # Do not call functions when jit is used
   1053         full_backward_hooks, non_full_backward_hooks = [], []

~/miniconda3/envs/huggingface/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)
    471             raise ValueError(&quot;You cannot specify both input_ids and inputs_embeds at the same time&quot;)
    472         elif input_ids is not None:
--&gt; 473             input_shape = input_ids.size()
    474         elif inputs_embeds is not None:
    475             input_shape = inputs_embeds.size()[:-1]

AttributeError: &#x27;list&#x27; object has no attribute &#x27;size&#x27;
&quot;&quot;&quot;</span>`}}),Wt=new zh({props:{id:"rSPyvPw0p9k"}}),Xt=new zh({props:{id:"5PkZ4rbHL6c"}}),Kt=new y({props:{code:'inputs["input_ids"][:5]',highlighted:'inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][:<span class="hljs-number">5</span>]'}}),Ut=new y({props:{code:"[101, 2029, 7705, 2015, 2064]",highlighted:'[<span class="hljs-number">101</span>, <span class="hljs-number">2029</span>, <span class="hljs-number">7705</span>, <span class="hljs-number">2015</span>, <span class="hljs-number">2064</span>]'}}),Zt=new y({props:{code:'type(inputs["input_ids"])',highlighted:'<span class="hljs-built_in">type</span>(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])'}}),tn=new y({props:{code:"list",highlighted:'<span class="hljs-built_in">list</span>'}}),nn=new y({props:{code:`~/miniconda3/envs/huggingface/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)
    471             raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
    472         elif input_ids is not None:
--> 473             input_shape = input_ids.size()
    474         elif inputs_embeds is not None:
    475             input_shape = inputs_embeds.size()[:-1]

AttributeError: 'list' object has no attribute 'size'`,highlighted:`~<span class="hljs-regexp">/miniconda3/</span>envs<span class="hljs-regexp">/huggingface/</span>lib<span class="hljs-regexp">/python3.8/</span>site-packages<span class="hljs-regexp">/transformers/m</span>odels<span class="hljs-regexp">/distilbert/m</span>odeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)
    <span class="hljs-number">471</span>             raise ValueError(<span class="hljs-string">&quot;You cannot specify both input_ids and inputs_embeds at the same time&quot;</span>)
    <span class="hljs-number">472</span>         elif input_ids is not None:
--&gt; <span class="hljs-number">473</span>             input_shape = input_ids.<span class="hljs-keyword">size</span>()
    <span class="hljs-number">474</span>         elif inputs_embeds is not None:
    <span class="hljs-number">475</span>             input_shape = inputs_embeds.<span class="hljs-keyword">size</span>()[:-<span class="hljs-number">1</span>]

AttributeError: <span class="hljs-string">&#x27;list&#x27;</span> object has no attribute <span class="hljs-string">&#x27;size&#x27;</span>`}}),hn=new y({props:{code:`inputs = tokenizer(question, context, add_special_tokens=True, return_tensors="pt")
input_ids = inputs["input_ids"][0]
outputs = model(**inputs)
answer_start_scores = outputs.start_logits
answer_end_scores = outputs.end_logits
# L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 b\u1EAFt \u0111\u1EA7u c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1 
answer_start = torch.argmax(answer_start_scores)
# L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 k\u1EBFt th\xFAc c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1 
answer_end = torch.argmax(answer_end_scores) + 1
answer = tokenizer.convert_tokens_to_string(
    tokenizer.convert_ids_to_tokens(input_ids[answer_start:answer_end])
)
print(f"Question: {question}")
print(f"Answer: {answer}")`,highlighted:`inputs = tokenizer(question, context, add_special_tokens=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
input_ids = inputs[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>]
outputs = model(**inputs)
answer_start_scores = outputs.start_logits
answer_end_scores = outputs.end_logits
<span class="hljs-comment"># L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 b\u1EAFt \u0111\u1EA7u c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1 </span>
answer_start = torch.argmax(answer_start_scores)
<span class="hljs-comment"># L\u1EA5y ph\u1EA7n c\xF3 kh\u1EA3 n\u0103ng l\xE0 k\u1EBFt th\xFAc c\u1EE7a c\xE2u tr\u1EA3 l\u1EDDi nh\u1EA5t v\u1EDBi argmax c\u1EE7a \u0111i\u1EC3m tr\u1EA3 v\u1EC1 </span>
answer_end = torch.argmax(answer_end_scores) + <span class="hljs-number">1</span>
answer = tokenizer.convert_tokens_to_string(
    tokenizer.convert_ids_to_tokens(input_ids[answer_start:answer_end])
)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Question: <span class="hljs-subst">{question}</span>&quot;</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Answer: <span class="hljs-subst">{answer}</span>&quot;</span>)`}}),rn=new y({props:{code:`"""
Question: Which frameworks can I use?
Answer: pytorch, tensorflow, and jax
"""`,highlighted:`<span class="hljs-string">&quot;&quot;&quot;
Question: Which frameworks can I use?
Answer: pytorch, tensorflow, and jax
&quot;&quot;&quot;</span>`}}),{c(){g=r("meta"),q=l(),v=r("h1"),w=r("a"),D=r("span"),m($.$$.fragment),C=l(),O=r("span"),I=i("Ph\u1EA3i l\xE0m g\xEC khi b\u1EA1n g\u1EB7p l\u1ED7i"),Z=l(),m(M.$$.fragment),L=l(),x=r("p"),ln=i("Trong ph\u1EA7n n\xE0y, ch\xFAng ta s\u1EBD xem x\xE9t m\u1ED9t s\u1ED1 l\u1ED7i ph\u1ED5 bi\u1EBFn c\xF3 th\u1EC3 x\u1EA3y ra khi b\u1EA1n \u0111ang c\u1ED1 g\u1EAFng t\u1EA1o d\u1EF1 \u0111o\xE1n t\u1EEB m\xF4 h\xECnh Transformer m\u1EDBi \u0111\u01B0\u1EE3c \u0111i\u1EC1u ch\u1EC9nh c\u1EE7a m\xECnh. \u0110i\u1EC1u n\xE0y s\u1EBD gi\xFAp b\u1EA1n chu\u1EA9n b\u1ECB cho "),W=r("a"),un=i("section 4"),si=i(", n\u01A1i ch\xFAng ta s\u1EBD kh\xE1m ph\xE1 c\xE1ch g\u1EE1 l\u1ED7i ch\xEDnh giai \u0111o\u1EA1n hu\u1EA5n luy\u1EC7n."),qe=l(),m(ft.$$.fragment),Ee=l(),G=r("p"),ii=i("Ch\xFAng t\xF4i \u0111\xE3 chu\u1EA9n b\u1ECB "),_t=r("a"),oi=i("kho l\u01B0u tr\u1EEF m\xF4 h\xECnh m\u1EABu"),hi=i(" cho ph\u1EA7n n\xE0y v\xE0 n\u1EBFu b\u1EA1n mu\u1ED1n ch\u1EA1y m\xE3 trong ch\u01B0\u01A1ng n\xE0y, tr\u01B0\u1EDBc ti\xEAn, b\u1EA1n c\u1EA7n sao ch\xE9p m\xF4 h\xECnh v\xE0o t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n tr\xEAn "),bt=r("a"),ri=i("Hugging Face Hub"),ai=i(". \u0110\u1EC3 l\xE0m nh\u01B0 v\u1EADy, tr\u01B0\u1EDBc ti\xEAn h\xE3y \u0111\u0103ng nh\u1EADp b\u1EB1ng c\xE1ch ch\u1EA1y m\u1ED9t trong hai thao t\xE1c sau trong notebook Jupyter:"),je=l(),m(kt.$$.fragment),Ce=l(),pn=r("p"),ci=i("ho\u1EB7c sau trong terminal y\xEAu th\xEDch c\u1EE7a b\u1EA1n:"),Te=l(),m(vt.$$.fragment),Pe=l(),tt=r("p"),li=i("Thao t\xE1c n\xE0y s\u1EBD nh\u1EAFc b\u1EA1n nh\u1EADp t\xEAn ng\u01B0\u1EDDi d\xF9ng v\xE0 m\u1EADt kh\u1EA9u c\u1EE7a m\xECnh, \u0111\u1ED3ng th\u1EDDi s\u1EBD l\u01B0u token d\u01B0\u1EDBi "),On=r("em"),ui=i("~/.cache/huggingface/"),pi=i(". Khi b\u1EA1n \u0111\xE3 \u0111\u0103ng nh\u1EADp, b\u1EA1n c\xF3 th\u1EC3 sao ch\xE9p kho m\u1EABu v\u1EDBi h\xE0m sau:"),Ae=l(),m(yt.$$.fragment),De=l(),nt=r("p"),gi=i("Gi\u1EDD khi b\u1EA1n g\u1ECDi "),zn=r("code"),mi=i("copy_repository_template()"),di=i(", n\xF3 s\u1EBD t\u1EA1o ra m\u1ED9t b\u1EA3n sao kho l\u01B0u tr\u1EEF m\u1EABu d\u01B0\u1EDBi t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n."),Oe=l(),X=r("h2"),et=r("a"),Sn=r("span"),m(wt.$$.fragment),fi=l(),Nn=r("span"),_i=i("G\u1EE1 l\u1ED7i pipeline \u{1F917} Transformers"),ze=l(),gn=r("p"),bi=i("\u0110\u1EC3 b\u1EAFt \u0111\u1EA7u cu\u1ED9c h\xE0nh tr\xECnh c\u1EE7a ch\xFAng ta v\xE0o th\u1EBF gi\u1EDBi tuy\u1EC7t v\u1EDDi c\u1EE7a vi\u1EC7c g\u1EE1 l\u1ED7i c\xE1c m\xF4 h\xECnh Transformer, h\xE3y xem x\xE9t t\xECnh hu\u1ED1ng sau: b\u1EA1n \u0111ang l\xE0m vi\u1EC7c v\u1EDBi m\u1ED9t \u0111\u1ED3ng nghi\u1EC7p trong m\u1ED9t d\u1EF1 \xE1n h\u1ECFi \u0111\xE1p \u0111\u1EC3 gi\xFAp kh\xE1ch h\xE0ng c\u1EE7a m\u1ED9t trang web th\u01B0\u01A1ng m\u1EA1i \u0111i\u1EC7n t\u1EED t\xECm th\u1EA5y c\xE2u tr\u1EA3 l\u1EDDi v\u1EC1 c\xE1c s\u1EA3n ph\u1EA9m ti\xEAu d\xF9ng. \u0110\u1ED3ng nghi\u1EC7p c\u1EE7a b\u1EA1n g\u1EEDi cho b\u1EA1n m\u1ED9t tin nh\u1EAFn nh\u01B0:"),Se=l(),mn=r("blockquote"),$t=r("p"),ki=i("Ch\xFAc b\u1EA1n m\u1ED9t ng\xE0y t\u1ED1t l\xE0nh! T\xF4i v\u1EEBa ch\u1EA1y m\u1ED9t th\u1EED nghi\u1EC7m b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng c\xE1c k\u1EF9 thu\u1EADt trong "),dn=r("a"),vi=i("Ch\u01B0\u01A1ng 7"),yi=i(" c\u1EE7a kh\xF3a h\u1ECDc Hugging Face v\xE0 nh\u1EADn \u0111\u01B0\u1EE3c m\u1ED9t s\u1ED1 k\u1EBFt qu\u1EA3 tuy\u1EC7t v\u1EDDi tr\xEAn SQuAD! T\xF4i ngh\u0129 ch\xFAng ta c\xF3 th\u1EC3 s\u1EED d\u1EE5ng m\xF4 h\xECnh n\xE0y nh\u01B0 m\u1ED9t \u0111i\u1EC3m kh\u1EDFi \u0111\u1EA7u cho d\u1EF1 \xE1n c\u1EE7a m\xECnh. ID m\xF4 h\xECnh tr\xEAn Hub l\xE0 \u201Clewtun/distillbert-base-uncased-finetuned-squad-d5716d28\u201D. H\xE3y th\u1EED nghi\u1EC7m n\xF3 xem :)"),Ne=l(),st=r("p"),wi=i("v\xE0 \u0111i\u1EC1u \u0111\u1EA7u ti\xEAn b\u1EA1n ngh\u0129 \u0111\u1EBFn l\xE0 t\u1EA3i m\xF4 h\xECnh b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),Hn=r("code"),$i=i("pipeline"),xi=i(" t\u1EEB \u{1F917} Transformers:"),He=l(),m(xt.$$.fragment),Ie=l(),m(qt.$$.fragment),Me=l(),V=r("p"),qi=i("\xD4i kh\xF4ng, c\xF3 v\u1EBB nh\u01B0 c\xF3 g\xEC \u0111\xF3 kh\xF4ng \u1ED5n! N\u1EBFu b\u1EA1n l\xE0 ng\u01B0\u1EDDi m\u1EDBi l\u1EADp tr\xECnh, nh\u1EEFng l\u1ED7i ki\u1EC3u n\xE0y tho\u1EA1t \u0111\u1EA7u c\xF3 v\u1EBB h\u01A1i kh\xF3 hi\u1EC3u (th\u1EADm ch\xED "),In=r("code"),Ei=i("OSError"),ji=i(" l\xE0 g\xEC ?!). L\u1ED7i \u0111\u01B0\u1EE3c hi\u1EC3n th\u1ECB \u1EDF \u0111\xE2y ch\u1EC9 l\xE0 ph\u1EA7n cu\u1ED1i c\xF9ng c\u1EE7a m\u1ED9t b\xE1o c\xE1o l\u1ED7i l\u1EDBn h\u01A1n nhi\u1EC1u \u0111\u01B0\u1EE3c g\u1ECDi l\xE0 "),Mn=r("em"),Ci=i("Python traceback"),Ti=i(" (hay c\xF2n g\u1ECDi l\xE0 \u0111\xE1u v\u1EBFt ng\u0103n x\u1EBFp). V\xED d\u1EE5: n\u1EBFu b\u1EA1n \u0111ang ch\u1EA1y \u0111o\u1EA1n m\xE3 n\xE0y tr\xEAn Google Colab, b\u1EA1n s\u1EBD th\u1EA5y m\u1ED9t c\xE1i g\xEC \u0111\xF3 gi\u1ED1ng nh\u01B0 \u1EA3nh ch\u1EE5p m\xE0n h\xECnh sau:"),Le=l(),Et=r("div"),jt=r("img"),Ge=l(),T=r("p"),Pi=i("C\xF3 r\u1EA5t nhi\u1EC1u th\xF4ng tin c\xF3 trong c\xE1c b\xE1o c\xE1o n\xE0y, v\xEC v\u1EADy ch\xFAng ta h\xE3y c\xF9ng nhau xem qua c\xE1c ph\u1EA7n ch\xEDnh. \u0110i\u1EC1u \u0111\u1EA7u ti\xEAn c\u1EA7n l\u01B0u \xFD l\xE0 theo d\xF5i ph\u1EA3i \u0111\u01B0\u1EE3c \u0111\u1ECDc "),Ln=r("em"),Ai=i("t\u1EEB d\u01B0\u1EDBi l\xEAn tr\xEAn"),Di=i(". \u0110i\u1EC1u n\xE0y nghe c\xF3 v\u1EBB k\u1EF3 l\u1EA1 n\u1EBFu b\u1EA1n \u0111\xE3 quen \u0111\u1ECDc v\u0103n b\u1EA3n ti\u1EBFng Anh t\u1EEB tr\xEAn xu\u1ED1ng d\u01B0\u1EDBi, nh\u01B0ng n\xF3 ph\u1EA3n \xE1nh th\u1EF1c t\u1EBF l\xE0 b\u1EA3n truy xu\u1EA5t hi\u1EC3n th\u1ECB chu\u1ED7i c\xE1c l\u1EC7nh g\u1ECDi h\xE0m m\xE0 "),Gn=r("code"),Oi=i("pipeline"),zi=i(" th\u1EF1c hi\u1EC7n khi t\u1EA3i xu\u1ED1ng m\xF4 h\xECnh v\xE0 tr\xECnh tokenizer. (Xem "),fn=r("a"),Si=i("Ch\u01B0\u01A1ng 2"),Ni=i(" \u0111\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt v\u1EC1 c\xE1ch ho\u1EA1t \u0111\u1ED9ng c\u1EE7a "),Vn=r("code"),Hi=i("pipeline"),Ii=i(".)"),Ve=l(),m(it.$$.fragment),Be=l(),B=r("p"),Mi=i("\u0110i\u1EC1u n\xE0y c\xF3 ngh\u0129a l\xE0 d\xF2ng cu\u1ED1i c\xF9ng c\u1EE7a truy xu\u1EA5t cho bi\u1EBFt th\xF4ng b\xE1o l\u1ED7i cu\u1ED1i c\xF9ng v\xE0 cung c\u1EA5p t\xEAn c\u1EE7a ngo\u1EA1i l\u1EC7 \u0111\xE3 \u0111\u01B0\u1EE3c n\xEAu ra. Trong tr\u01B0\u1EDDng h\u1EE3p n\xE0y, lo\u1EA1i ngo\u1EA1i l\u1EC7 l\xE0 "),Bn=r("code"),Li=i("OSError"),Gi=i(", cho bi\u1EBFt l\u1ED7i li\xEAn quan \u0111\u1EBFn h\u1EC7 th\u1ED1ng. N\u1EBFu ch\xFAng ta \u0111\u1ECDc th\xF4ng b\xE1o l\u1ED7i k\xE8m theo, ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y r\u1EB1ng d\u01B0\u1EDDng nh\u01B0 c\xF3 s\u1EF1 c\u1ED1 v\u1EDBi t\u1EC7p "),Qn=r("em"),Vi=i("config.json"),Bi=i(" c\u1EE7a m\xF4 h\xECnh v\xE0 ta s\u1EBD \u0111\u01B0a ra hai \u0111\u1EC1 xu\u1EA5t \u0111\u1EC3 kh\u1EAFc ph\u1EE5c:"),Qe=l(),m(Ct.$$.fragment),Fe=l(),m(ot.$$.fragment),Re=l(),_n=r("p"),Qi=i("\u0110\u1EC1 xu\u1EA5t \u0111\u1EA7u ti\xEAn l\xE0 y\xEAu c\u1EA7u ta ki\u1EC3m tra xem ID m\xF4 h\xECnh c\xF3 th\u1EF1c s\u1EF1 ch\xEDnh x\xE1c hay kh\xF4ng, v\xEC v\u1EADy, vi\u1EC7c \u0111\u1EA7u ti\xEAn ta l\xE0m l\xE0 sao ch\xE9p ch\u1EC9 s\u1ED1 nh\u1EADn d\u1EA1ng v\xE0 d\xE1n n\xF3 v\xE0o thanh t\xECm ki\u1EBFm c\u1EE7a Hub:"),Ye=l(),Tt=r("div"),Pt=r("img"),Je=l(),bn=r("p"),Fi=i("R\u1EA5t ti\u1EBFc, c\xF3 v\u1EBB nh\u01B0 m\xF4 h\xECnh c\u1EE7a anh \u0111\u1ED3ng nghi\u1EC7p kh\xF4ng c\xF3 tr\xEAn Hub \u2026 aha, nh\u01B0ng c\xF3 m\u1ED9t l\u1ED7i \u0111\xE1nh m\xE1y trong t\xEAn c\u1EE7a m\xF4 h\xECnh! DistilBERT ch\u1EC9 c\xF3 m\u1ED9t ch\u1EEF \u201Cl\u201D trong t\xEAn c\u1EE7a n\xF3, v\xEC v\u1EADy h\xE3y s\u1EEDa l\u1ED7i \u0111\xF3 v\xE0 t\xECm \u201Clewtun/distilbert-base-unsased-finetuned-Squad-d5716d28\u201D thay th\u1EBF:"),We=l(),At=r("div"),Dt=r("img"),Xe=l(),kn=r("p"),Ri=i("\u0110\u01B0\u1EE3c r\u1ED3i, \u0111i\u1EC1u n\xE0y \u0111\xE3 th\xE0nh c\xF4ng. B\xE2y gi\u1EDD, h\xE3y th\u1EED t\u1EA3i xu\u1ED1ng m\xF4 h\xECnh m\u1ED9t l\u1EA7n n\u1EEFa v\u1EDBi \u0111\xFAng ID m\xF4 h\xECnh:"),Ke=l(),m(Ot.$$.fragment),Ue=l(),m(zt.$$.fragment),Ze=l(),Q=r("p"),Yi=i("Argh, l\u1EA1i th\u1EA5t b\u1EA1i - ch\xE0o m\u1EEBng b\u1EA1n \u0111\u1EBFn v\u1EDBi cu\u1ED9c s\u1ED1ng h\xE0ng ng\xE0y c\u1EE7a m\u1ED9t k\u1EF9 s\u01B0 h\u1ECDc m\xE1y! V\xEC ch\xFAng ta \u0111\xE3 s\u1EEDa ID m\xF4 h\xECnh, v\u1EA5n \u0111\u1EC1 ph\u1EA3i n\u1EB1m \u1EDF ch\xEDnh kho l\u01B0u tr\u1EEF. M\u1ED9t c\xE1ch nhanh ch\xF3ng \u0111\u1EC3 truy c\u1EADp n\u1ED9i dung c\u1EE7a m\u1ED9t kho l\u01B0u tr\u1EEF tr\xEAn \u{1F917} Hub l\xE0 th\xF4ng qua h\xE0m "),Fn=r("code"),Ji=i("list_repo_files()"),Wi=i(" c\u1EE7a th\u01B0 vi\u1EC7n "),Rn=r("code"),Xi=i("huggingface_hub"),Ki=i(":"),ts=l(),m(St.$$.fragment),ns=l(),m(Nt.$$.fragment),es=l(),E=r("p"),Ui=i("Th\u1EADt th\xFA v\u1ECB - d\u01B0\u1EDDng nh\u01B0 kh\xF4ng c\xF3 t\u1EC7p "),Yn=r("em"),Zi=i("config.json"),to=i(" trong kho l\u01B0u tr\u1EEF! Kh\xF4ng c\xF3 g\xEC ng\u1EA1c nhi\xEAn khi "),Jn=r("code"),no=i("pipeline"),eo=i(" kh\xF4ng th\u1EC3 t\u1EA3i m\xF4 h\xECnh; \u0111\u1ED3ng nghi\u1EC7p c\u1EE7a ch\xFAng ta ch\u1EAFc h\u1EB3n \u0111\xE3 qu\xEAn \u0111\u1EA9y t\u1EC7p n\xE0y v\xE0o Hub sau khi \u0111\xE3 tinh ch\u1EC9nh n\xF3. Trong tr\u01B0\u1EDDng h\u1EE3p n\xE0y, v\u1EA5n \u0111\u1EC1 c\xF3 v\u1EBB kh\xE1 \u0111\u01A1n gi\u1EA3n \u0111\u1EC3 kh\u1EAFc ph\u1EE5c: ch\xFAng ta c\xF3 th\u1EC3 y\xEAu c\u1EA7u h\u1ECD th\xEAm t\u1EC7p ho\u1EB7c, v\xEC ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y t\u1EEB ID m\xF4 h\xECnh m\xE0 m\xF4 h\xECnh hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc \u0111\xE3 s\u1EED d\u1EE5ng l\xE0 "),Ht=r("a"),Wn=r("code"),so=i("distilbert-base-uncased"),io=i(", ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i xu\u1ED1ng c\u1EA5u h\xECnh cho m\xF4 h\xECnh n\xE0y v\xE0 \u0111\u1EA9y n\xF3 v\xE0o kho l\u01B0u tr\u1EEF c\u1EE7a m\xECnh \u0111\u1EC3 xem li\u1EC7u \u0111i\u1EC1u \u0111\xF3 c\xF3 gi\u1EA3i quy\u1EBFt \u0111\u01B0\u1EE3c s\u1EF1 c\u1ED1 hay kh\xF4ng. H\xE3y th\u1EED \u0111i\u1EC1u \u0111\xF3. S\u1EED d\u1EE5ng c\xE1c k\u1EF9 thu\u1EADt ch\xFAng ta \u0111\xE3 h\u1ECDc trong "),vn=r("a"),oo=i("Ch\u01B0\u01A1ng 2"),ho=i(", ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i xu\u1ED1ng c\u1EA5u h\xECnh c\u1EE7a m\xF4 h\xECnh v\u1EDBi l\u1EDBp "),Xn=r("code"),ro=i("AutoConfig"),ao=i(":"),ss=l(),m(It.$$.fragment),is=l(),m(ht.$$.fragment),os=l(),rt=r("p"),co=i("Sau \u0111\xF3, ch\xFAng ta c\xF3 th\u1EC3 \u0111\u1EA9y n\xF3 v\xE0o kho l\u01B0u tr\u1EEF m\xF4 h\xECnh c\u1EE7a m\xECnh b\u1EB1ng h\xE0m "),Kn=r("code"),lo=i("push_to_hub()"),uo=i(" c\u1EE7a c\u1EA5u h\xECnh:"),hs=l(),m(Mt.$$.fragment),rs=l(),at=r("p"),po=i("B\xE2y gi\u1EDD ch\xFAng ta c\xF3 th\u1EC3 ki\u1EC3m tra xem \u0111i\u1EC1u n\xE0y c\xF3 ho\u1EA1t \u0111\u1ED9ng hay kh\xF4ng b\u1EB1ng c\xE1ch t\u1EA3i m\xF4 h\xECnh t\u1EEB cam k\u1EBFt m\u1EDBi nh\u1EA5t tr\xEAn nh\xE1nh "),Un=r("code"),go=i("main"),mo=i(":"),as=l(),m(Lt.$$.fragment),cs=l(),m(Gt.$$.fragment),ls=l(),yn=r("p"),fo=i("Tuy\u1EC7t v\u1EDDi, n\xF3 \u0111\xE3 ho\u1EA1t \u0111\u1ED9ng! H\xE3y t\xF3m t\u1EAFt l\u1EA1i nh\u1EEFng g\xEC b\u1EA1n v\u1EEBa h\u1ECDc \u0111\u01B0\u1EE3c:"),us=l(),z=r("ul"),Vt=r("li"),_o=i("C\xE1c th\xF4ng b\xE1o l\u1ED7i trong Python \u0111\u01B0\u1EE3c g\u1ECDi l\xE0 "),Zn=r("em"),bo=i("tracebacks"),ko=i(" v\xE0 \u0111\u01B0\u1EE3c \u0111\u1ECDc t\u1EEB d\u01B0\u1EDBi l\xEAn tr\xEAn. D\xF2ng cu\u1ED1i c\xF9ng c\u1EE7a th\xF4ng b\xE1o l\u1ED7i th\u01B0\u1EDDng ch\u1EE9a th\xF4ng tin b\u1EA1n c\u1EA7n \u0111\u1EC3 x\xE1c \u0111\u1ECBnh ngu\u1ED3n g\u1ED1c c\u1EE7a v\u1EA5n \u0111\u1EC1."),vo=l(),te=r("li"),yo=i("N\u1EBFu d\xF2ng cu\u1ED1i c\xF9ng kh\xF4ng ch\u1EE9a \u0111\u1EE7 th\xF4ng tin, h\xE3y l\xE0m theo c\xE1ch c\u1EE7a b\u1EA1n \u0111\u1EC3 truy xu\u1EA5t l\u1EA1i v\xE0 xem li\u1EC7u b\u1EA1n c\xF3 th\u1EC3 x\xE1c \u0111\u1ECBnh \u0111\u01B0\u1EE3c l\u1ED7i x\u1EA3y ra \u1EDF \u0111\xE2u trong m\xE3 ngu\u1ED3n hay kh\xF4ng."),wo=l(),ne=r("li"),$o=i("N\u1EBFu kh\xF4ng c\xF3 th\xF4ng b\xE1o l\u1ED7i n\xE0o c\xF3 th\u1EC3 gi\xFAp b\u1EA1n g\u1EE1 l\u1ED7i, h\xE3y th\u1EED t\xECm ki\u1EBFm tr\u1EF1c tuy\u1EBFn gi\u1EA3i ph\xE1p cho v\u1EA5n \u0111\u1EC1 t\u01B0\u01A1ng t\u1EF1."),xo=l(),Bt=r("li"),qo=i("C\xE1c th\u01B0 vi\u1EC7n "),ee=r("code"),Eo=i("huggingface_hub"),jo=i(" // \u{1F917} Hub? cung c\u1EA5p m\u1ED9t b\u1ED9 c\xF4ng c\u1EE5 m\xE0 b\u1EA1n c\xF3 th\u1EC3 s\u1EED d\u1EE5ng \u0111\u1EC3 t\u01B0\u01A1ng t\xE1c v\xE0 g\u1EE1 l\u1ED7i c\xE1c kho l\u01B0u tr\u1EEF tr\xEAn Hub."),ps=l(),wn=r("p"),Co=i("B\xE2y gi\u1EDD b\u1EA1n \u0111\xE3 bi\u1EBFt c\xE1ch g\u1EE1 l\u1ED7i m\u1ED9t \u0111\u01B0\u1EDDng d\u1EABn, ch\xFAng ta h\xE3y xem m\u1ED9t v\xED d\u1EE5 ph\u1EE9c t\u1EA1p h\u01A1n trong b\u01B0\u1EDBc truy\u1EC1n th\u1EB3ng c\u1EE7a ch\xEDnh m\xF4 h\xECnh."),gs=l(),K=r("h2"),ct=r("a"),se=r("span"),m(Qt.$$.fragment),To=l(),ie=r("span"),Po=i("G\u1EE1 l\u1ED7i truy\u1EC1n th\u1EB3ng m\xF4 h\xECnh c\u1EE7a b\u1EA1n"),ms=l(),F=r("p"),Ao=i("M\u1EB7c d\xF9 "),oe=r("code"),Do=i("pipeline"),Oo=i(" tuy\u1EC7t v\u1EDDi cho h\u1EA7u h\u1EBFt c\xE1c \u1EE9ng d\u1EE5ng m\xE0 b\u1EA1n c\u1EA7n nhanh ch\xF3ng t\u1EA1o d\u1EF1 \u0111o\xE1n, \u0111\xF4i khi b\u1EA1n s\u1EBD c\u1EA7n truy c\u1EADp nh\u1EADt k\xFD c\u1EE7a m\xF4 h\xECnh (gi\u1EA3 s\u1EED, n\u1EBFu b\u1EA1n c\xF3 m\u1ED9t s\u1ED1 h\u1EADu x\u1EED l\xFD t\xF9y ch\u1EC9nh m\xE0 b\u1EA1n mu\u1ED1n \xE1p d\u1EE5ng). \u0110\u1EC3 xem \u0111i\u1EC1u g\xEC c\xF3 th\u1EC3 sai trong tr\u01B0\u1EDDng h\u1EE3p n\xE0y, tr\u01B0\u1EDBc ti\xEAn h\xE3y l\u1EA5y m\xF4 h\xECnh v\xE0 tr\xECnh tokenize t\u1EEB "),he=r("code"),zo=i("pipeline"),So=i(" c\u1EE7a m\xECnh:"),ds=l(),m(Ft.$$.fragment),fs=l(),$n=r("p"),No=i("Ti\u1EBFp theo, ch\xFAng ta c\u1EA7n m\u1ED9t c\xE2u h\u1ECFi, v\xEC v\u1EADy h\xE3y xem li\u1EC7u c\xE1c khung y\xEAu th\xEDch c\u1EE7a ch\xFAng ta c\xF3 \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3 kh\xF4ng:"),_s=l(),m(Rt.$$.fragment),bs=l(),lt=r("p"),Ho=i("Nh\u01B0 \u0111\xE3 th\u1EA5y trong "),xn=r("a"),Io=i("Ch\u01B0\u01A1ng 7"),Mo=i(", c\xE1c b\u01B0\u1EDBc th\xF4ng th\u01B0\u1EDDng ta c\u1EA7n l\xE0m \u0111\xF3 l\xE0 tokenize \u0111\u1EA7u v\xE0o, tr\xEDch xu\u1EA5t c\xE1c logit c\u1EE7a token b\u1EAFt \u0111\u1EA7u v\xE0 k\u1EBFt th\xFAc, r\u1ED3i sau \u0111\xF3 gi\u1EA3i m\xE3 c\xE1c kho\u1EA3ng tr\u1EA3 l\u1EDDi:"),ks=l(),m(Yt.$$.fragment),vs=l(),m(Jt.$$.fragment),ys=l(),qn=r("p"),Lo=i("\xD4i tr\u1EDDi, c\xF3 v\u1EBB nh\u01B0 ch\xFAng ta c\xF3 m\u1ED9t l\u1ED7i trong \u0111o\u1EA1n m\xE3 c\u1EE7a m\xECnh! Nh\u01B0ng ch\xFAng ta kh\xF4ng s\u1EE3 g\u1EE1 l\u1ED7i ch\xFAt n\xE0o. B\u1EA1n c\xF3 th\u1EC3 s\u1EED d\u1EE5ng tr\xECnh g\u1EE1 l\u1ED7i Python trong notebook:"),ws=l(),m(Wt.$$.fragment),$s=l(),En=r("p"),Go=i("ho\u1EB7c trong terminal:"),xs=l(),m(Xt.$$.fragment),qs=l(),P=r("p"),Vo=i("\u1EDE \u0111\xE2y, khi \u0111\u1ECDc th\xF4ng b\xE1o l\u1ED7i cho ch\xFAng ta bi\u1EBFt r\u1EB1ng \u0111\u1ED1i t\u01B0\u1EE3ng "),re=r("code"),Bo=i("'list' object has no attribute 'size'"),Qo=i(" v\xE0 ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y m\u1ED9t m\u0169i t\xEAn "),ae=r("code"),Fo=i("-->"),Ro=i(" tr\u1ECF \u0111\u1EBFn d\xF2ng n\u01A1i v\u1EA5n \u0111\u1EC1 \u0111\xE3 \u0111\u01B0\u1EE3c n\xEAu ra trong "),ce=r("code"),Yo=i("model(** input)"),Jo=i(". B\u1EA1n c\xF3 th\u1EC3 g\u1EE1 l\u1ED7i \u0111i\u1EC1u n\xE0y m\u1ED9t c\xE1ch t\u01B0\u01A1ng t\u1EF1 b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng tr\xECnh g\u1EE1 l\u1ED7i Python, nh\u01B0ng b\xE2y gi\u1EDD ch\xFAng ta ch\u1EC9 c\u1EA7n in ra m\u1ED9t ph\u1EA7n c\u1EE7a "),le=r("code"),Wo=i("inputs"),Xo=i(" \u0111\u1EC3 xem nh\u1EEFng g\xEC ch\xFAng ta c\xF3:"),Es=l(),A=r("p"),Ko=i("Here, reading the error message tells us that "),ue=r("code"),Uo=i("'list' object has no attribute 'size'"),Zo=i(", and we can see a "),pe=r("code"),th=i("-->"),nh=i(" arrow pointing to the line where the problem was raised in "),ge=r("code"),eh=i("model(**inputs)"),sh=i(".You can debug this interactively using the Python debugger, but for now we\u2019ll simply print out a slice of "),me=r("code"),ih=i("inputs"),oh=i(" to see what we have:"),js=l(),m(Kt.$$.fragment),Cs=l(),m(Ut.$$.fragment),Ts=l(),ut=r("p"),hh=i("\u0110i\u1EC1u n\xE0y ch\u1EAFc ch\u1EAFn tr\xF4ng gi\u1ED1ng nh\u01B0 m\u1ED9t "),de=r("code"),rh=i("list"),ah=i(" Python b\xECnh th\u01B0\u1EDDng, nh\u01B0ng h\xE3y ki\u1EC3m tra k\u1EF9 lo\u1EA1i:"),Ps=l(),m(Zt.$$.fragment),As=l(),m(tn.$$.fragment),Ds=l(),j=r("p"),ch=i("V\xE2ng, \u0111\xF3 ch\u1EAFc ch\u1EAFn l\xE0 m\u1ED9t "),fe=r("code"),lh=i("list"),uh=i(" Python. V\u1EADy \u0111i\u1EC1u g\xEC \u0111\xE3 x\u1EA3y ra? Nh\u1EDB l\u1EA1i t\u1EEB "),jn=r("a"),ph=i("Ch\u01B0\u01A1ng 2"),gh=i(" r\u1EB1ng c\xE1c l\u1EDBp "),_e=r("code"),mh=i("AutoModelForXxx"),dh=i(" trong \u{1F917} Transformers ho\u1EA1t \u0111\u1ED9ng tr\xEAn "),be=r("em"),fh=i("tensors"),_h=i(" (trong PyTorch ho\u1EB7c TensorFlow) v\xE0 ho\u1EA1t \u0111\u1ED9ng ph\u1ED5 bi\u1EBFn l\xE0 tr\xEDch xu\u1EA5t c\xE1c k\xEDch th\u01B0\u1EDBc c\u1EE7a tensor b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),ke=r("code"),bh=i("Tensor.size()"),kh=i(" trong PyTorch. Ch\xFAng ta h\xE3y xem x\xE9t l\u1EA1i qu\xE1 tr\xECnh truy v\u1EBFt, \u0111\u1EC3 xem d\xF2ng n\xE0o \u0111\xE3 k\xEDch ho\u1EA1t ngo\u1EA1i l\u1EC7:"),Os=l(),m(nn.$$.fragment),zs=l(),S=r("p"),vh=i("C\xF3 v\u1EBB nh\u01B0 m\xE3 c\u1EE7a ch\xFAng ta \u0111\xE3 c\u1ED1 g\u1EAFng g\u1ECDi "),ve=r("code"),yh=i("input_ids.size()"),wh=i(", nh\u01B0ng \u0111i\u1EC1u n\xE0y r\xF5 r\xE0ng s\u1EBD kh\xF4ng ho\u1EA1t \u0111\u1ED9ng \u0111\u1ED1i v\u1EDBi m\u1ED9t "),ye=r("code"),$h=i("list"),xh=i(" Python, v\u1ED1n ch\u1EC9 l\xE0 m\u1ED9t v\xF9ng ch\u1EE9a. L\xE0m th\u1EBF n\xE0o ch\xFAng ta c\xF3 th\u1EC3 gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1 n\xE0y? T\xECm ki\u1EBFm th\xF4ng b\xE1o l\u1ED7i tr\xEAn Stack Overflow \u0111\u01B0a ra m\u1ED9t s\u1ED1 "),en=r("a"),qh=i("l\u01B0\u1EE3t truy c\u1EADp"),Eh=i(" li\xEAn quan. Nh\u1EA5p v\xE0o c\xE2u h\u1ECFi \u0111\u1EA7u ti\xEAn s\u1EBD hi\u1EC3n th\u1ECB m\u1ED9t c\xE2u h\u1ECFi t\u01B0\u01A1ng t\u1EF1 nh\u01B0 c\xE2u h\u1ECFi c\u1EE7a ch\xFAng ta, v\u1EDBi c\xE2u tr\u1EA3 l\u1EDDi \u0111\u01B0\u1EE3c hi\u1EC3n th\u1ECB trong \u1EA3nh ch\u1EE5p m\xE0n h\xECnh b\xEAn d\u01B0\u1EDBi:"),Ss=l(),sn=r("div"),on=r("img"),Ns=l(),pt=r("p"),jh=i("C\xE2u tr\u1EA3 l\u1EDDi khuy\xEAn ch\xFAng ta n\xEAn th\xEAm "),we=r("code"),Ch=i("return_tensors='pt'"),Th=i(" v\xE0o tokenizer, v\xEC v\u1EADy h\xE3y xem \u0111i\u1EC1u \u0111\xF3 c\xF3 ph\xF9 h\u1EE3p v\u1EDBi ch\xFAng ta kh\xF4ng:"),Hs=l(),m(hn.$$.fragment),Is=l(),m(rn.$$.fragment),Ms=l(),gt=r("p"),Ph=i("T\u1ED1t, n\xF3 \u0111\xE3 ho\u1EA1t \u0111\u1ED9ng! \u0110\xE2y l\xE0 m\u1ED9t v\xED d\u1EE5 tuy\u1EC7t v\u1EDDi v\u1EC1 m\u1EE9c \u0111\u1ED9 h\u1EEFu \xEDch c\u1EE7a Stack Overflow: b\u1EB1ng c\xE1ch x\xE1c \u0111\u1ECBnh m\u1ED9t v\u1EA5n \u0111\u1EC1 t\u01B0\u01A1ng t\u1EF1, ch\xFAng ta c\xF3 th\u1EC3 h\u01B0\u1EDFng l\u1EE3i t\u1EEB kinh nghi\u1EC7m c\u1EE7a nh\u1EEFng ng\u01B0\u1EDDi kh\xE1c trong c\u1ED9ng \u0111\u1ED3ng. Tuy nhi\xEAn, m\u1ED9t t\xECm ki\u1EBFm nh\u01B0 th\u1EBF n\xE0y kh\xF4ng ph\u1EA3i l\xFAc n\xE0o c\u0169ng mang l\u1EA1i c\xE2u tr\u1EA3 l\u1EDDi ph\xF9 h\u1EE3p, v\u1EADy b\u1EA1n c\xF3 th\u1EC3 l\xE0m g\xEC trong nh\u1EEFng tr\u01B0\u1EDDng h\u1EE3p nh\u01B0 v\u1EADy? May m\u1EAFn thay, c\xF3 m\u1ED9t c\u1ED9ng \u0111\u1ED3ng c\xE1c nh\xE0 ph\xE1t tri\u1EC3n ch\xE0o \u0111\xF3n tr\xEAn "),an=r("a"),Ah=i("di\u1EC5n \u0111\xE0n Hugging Face"),Dh=i(" c\xF3 th\u1EC3 gi\xFAp b\u1EA1n! Trong ph\u1EA7n ti\u1EBFp theo, ch\xFAng ta s\u1EBD xem x\xE9t c\xE1ch b\u1EA1n c\xF3 th\u1EC3 t\u1EA1o ra c\xE1c c\xE2u h\u1ECFi t\u1ED1t tr\xEAn di\u1EC5n \u0111\xE0n c\xF3 kh\u1EA3 n\u0103ng \u0111\u01B0\u1EE3c tr\u1EA3 l\u1EDDi."),this.h()},l(t){const s=aa('[data-svelte="svelte-1phssyn"]',document.head);g=a(s,"META",{name:!0,content:!0}),s.forEach(n),q=u(t),v=a(t,"H1",{class:!0});var cn=c(v);w=a(cn,"A",{id:!0,class:!0,href:!0});var $e=c(w);D=a($e,"SPAN",{});var xe=c(D);d($.$$.fragment,xe),xe.forEach(n),$e.forEach(n),C=u(cn),O=a(cn,"SPAN",{});var Lh=c(O);I=o(Lh,"Ph\u1EA3i l\xE0m g\xEC khi b\u1EA1n g\u1EB7p l\u1ED7i"),Lh.forEach(n),cn.forEach(n),Z=u(t),d(M.$$.fragment,t),L=u(t),x=a(t,"P",{});var Gs=c(x);ln=o(Gs,"Trong ph\u1EA7n n\xE0y, ch\xFAng ta s\u1EBD xem x\xE9t m\u1ED9t s\u1ED1 l\u1ED7i ph\u1ED5 bi\u1EBFn c\xF3 th\u1EC3 x\u1EA3y ra khi b\u1EA1n \u0111ang c\u1ED1 g\u1EAFng t\u1EA1o d\u1EF1 \u0111o\xE1n t\u1EEB m\xF4 h\xECnh Transformer m\u1EDBi \u0111\u01B0\u1EE3c \u0111i\u1EC1u ch\u1EC9nh c\u1EE7a m\xECnh. \u0110i\u1EC1u n\xE0y s\u1EBD gi\xFAp b\u1EA1n chu\u1EA9n b\u1ECB cho "),W=a(Gs,"A",{href:!0});var Gh=c(W);un=o(Gh,"section 4"),Gh.forEach(n),si=o(Gs,", n\u01A1i ch\xFAng ta s\u1EBD kh\xE1m ph\xE1 c\xE1ch g\u1EE1 l\u1ED7i ch\xEDnh giai \u0111o\u1EA1n hu\u1EA5n luy\u1EC7n."),Gs.forEach(n),qe=u(t),d(ft.$$.fragment,t),Ee=u(t),G=a(t,"P",{});var Cn=c(G);ii=o(Cn,"Ch\xFAng t\xF4i \u0111\xE3 chu\u1EA9n b\u1ECB "),_t=a(Cn,"A",{href:!0,rel:!0});var Vh=c(_t);oi=o(Vh,"kho l\u01B0u tr\u1EEF m\xF4 h\xECnh m\u1EABu"),Vh.forEach(n),hi=o(Cn," cho ph\u1EA7n n\xE0y v\xE0 n\u1EBFu b\u1EA1n mu\u1ED1n ch\u1EA1y m\xE3 trong ch\u01B0\u01A1ng n\xE0y, tr\u01B0\u1EDBc ti\xEAn, b\u1EA1n c\u1EA7n sao ch\xE9p m\xF4 h\xECnh v\xE0o t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n tr\xEAn "),bt=a(Cn,"A",{href:!0,rel:!0});var Bh=c(bt);ri=o(Bh,"Hugging Face Hub"),Bh.forEach(n),ai=o(Cn,". \u0110\u1EC3 l\xE0m nh\u01B0 v\u1EADy, tr\u01B0\u1EDBc ti\xEAn h\xE3y \u0111\u0103ng nh\u1EADp b\u1EB1ng c\xE1ch ch\u1EA1y m\u1ED9t trong hai thao t\xE1c sau trong notebook Jupyter:"),Cn.forEach(n),je=u(t),d(kt.$$.fragment,t),Ce=u(t),pn=a(t,"P",{});var Qh=c(pn);ci=o(Qh,"ho\u1EB7c sau trong terminal y\xEAu th\xEDch c\u1EE7a b\u1EA1n:"),Qh.forEach(n),Te=u(t),d(vt.$$.fragment,t),Pe=u(t),tt=a(t,"P",{});var Vs=c(tt);li=o(Vs,"Thao t\xE1c n\xE0y s\u1EBD nh\u1EAFc b\u1EA1n nh\u1EADp t\xEAn ng\u01B0\u1EDDi d\xF9ng v\xE0 m\u1EADt kh\u1EA9u c\u1EE7a m\xECnh, \u0111\u1ED3ng th\u1EDDi s\u1EBD l\u01B0u token d\u01B0\u1EDBi "),On=a(Vs,"EM",{});var Fh=c(On);ui=o(Fh,"~/.cache/huggingface/"),Fh.forEach(n),pi=o(Vs,". Khi b\u1EA1n \u0111\xE3 \u0111\u0103ng nh\u1EADp, b\u1EA1n c\xF3 th\u1EC3 sao ch\xE9p kho m\u1EABu v\u1EDBi h\xE0m sau:"),Vs.forEach(n),Ae=u(t),d(yt.$$.fragment,t),De=u(t),nt=a(t,"P",{});var Bs=c(nt);gi=o(Bs,"Gi\u1EDD khi b\u1EA1n g\u1ECDi "),zn=a(Bs,"CODE",{});var Rh=c(zn);mi=o(Rh,"copy_repository_template()"),Rh.forEach(n),di=o(Bs,", n\xF3 s\u1EBD t\u1EA1o ra m\u1ED9t b\u1EA3n sao kho l\u01B0u tr\u1EEF m\u1EABu d\u01B0\u1EDBi t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n."),Bs.forEach(n),Oe=u(t),X=a(t,"H2",{class:!0});var Qs=c(X);et=a(Qs,"A",{id:!0,class:!0,href:!0});var Yh=c(et);Sn=a(Yh,"SPAN",{});var Jh=c(Sn);d(wt.$$.fragment,Jh),Jh.forEach(n),Yh.forEach(n),fi=u(Qs),Nn=a(Qs,"SPAN",{});var Wh=c(Nn);_i=o(Wh,"G\u1EE1 l\u1ED7i pipeline \u{1F917} Transformers"),Wh.forEach(n),Qs.forEach(n),ze=u(t),gn=a(t,"P",{});var Xh=c(gn);bi=o(Xh,"\u0110\u1EC3 b\u1EAFt \u0111\u1EA7u cu\u1ED9c h\xE0nh tr\xECnh c\u1EE7a ch\xFAng ta v\xE0o th\u1EBF gi\u1EDBi tuy\u1EC7t v\u1EDDi c\u1EE7a vi\u1EC7c g\u1EE1 l\u1ED7i c\xE1c m\xF4 h\xECnh Transformer, h\xE3y xem x\xE9t t\xECnh hu\u1ED1ng sau: b\u1EA1n \u0111ang l\xE0m vi\u1EC7c v\u1EDBi m\u1ED9t \u0111\u1ED3ng nghi\u1EC7p trong m\u1ED9t d\u1EF1 \xE1n h\u1ECFi \u0111\xE1p \u0111\u1EC3 gi\xFAp kh\xE1ch h\xE0ng c\u1EE7a m\u1ED9t trang web th\u01B0\u01A1ng m\u1EA1i \u0111i\u1EC7n t\u1EED t\xECm th\u1EA5y c\xE2u tr\u1EA3 l\u1EDDi v\u1EC1 c\xE1c s\u1EA3n ph\u1EA9m ti\xEAu d\xF9ng. \u0110\u1ED3ng nghi\u1EC7p c\u1EE7a b\u1EA1n g\u1EEDi cho b\u1EA1n m\u1ED9t tin nh\u1EAFn nh\u01B0:"),Xh.forEach(n),Se=u(t),mn=a(t,"BLOCKQUOTE",{});var Kh=c(mn);$t=a(Kh,"P",{});var Fs=c($t);ki=o(Fs,"Ch\xFAc b\u1EA1n m\u1ED9t ng\xE0y t\u1ED1t l\xE0nh! T\xF4i v\u1EEBa ch\u1EA1y m\u1ED9t th\u1EED nghi\u1EC7m b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng c\xE1c k\u1EF9 thu\u1EADt trong "),dn=a(Fs,"A",{href:!0});var Uh=c(dn);vi=o(Uh,"Ch\u01B0\u01A1ng 7"),Uh.forEach(n),yi=o(Fs," c\u1EE7a kh\xF3a h\u1ECDc Hugging Face v\xE0 nh\u1EADn \u0111\u01B0\u1EE3c m\u1ED9t s\u1ED1 k\u1EBFt qu\u1EA3 tuy\u1EC7t v\u1EDDi tr\xEAn SQuAD! T\xF4i ngh\u0129 ch\xFAng ta c\xF3 th\u1EC3 s\u1EED d\u1EE5ng m\xF4 h\xECnh n\xE0y nh\u01B0 m\u1ED9t \u0111i\u1EC3m kh\u1EDFi \u0111\u1EA7u cho d\u1EF1 \xE1n c\u1EE7a m\xECnh. ID m\xF4 h\xECnh tr\xEAn Hub l\xE0 \u201Clewtun/distillbert-base-uncased-finetuned-squad-d5716d28\u201D. H\xE3y th\u1EED nghi\u1EC7m n\xF3 xem :)"),Fs.forEach(n),Kh.forEach(n),Ne=u(t),st=a(t,"P",{});var Rs=c(st);wi=o(Rs,"v\xE0 \u0111i\u1EC1u \u0111\u1EA7u ti\xEAn b\u1EA1n ngh\u0129 \u0111\u1EBFn l\xE0 t\u1EA3i m\xF4 h\xECnh b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),Hn=a(Rs,"CODE",{});var Zh=c(Hn);$i=o(Zh,"pipeline"),Zh.forEach(n),xi=o(Rs," t\u1EEB \u{1F917} Transformers:"),Rs.forEach(n),He=u(t),d(xt.$$.fragment,t),Ie=u(t),d(qt.$$.fragment,t),Me=u(t),V=a(t,"P",{});var Tn=c(V);qi=o(Tn,"\xD4i kh\xF4ng, c\xF3 v\u1EBB nh\u01B0 c\xF3 g\xEC \u0111\xF3 kh\xF4ng \u1ED5n! N\u1EBFu b\u1EA1n l\xE0 ng\u01B0\u1EDDi m\u1EDBi l\u1EADp tr\xECnh, nh\u1EEFng l\u1ED7i ki\u1EC3u n\xE0y tho\u1EA1t \u0111\u1EA7u c\xF3 v\u1EBB h\u01A1i kh\xF3 hi\u1EC3u (th\u1EADm ch\xED "),In=a(Tn,"CODE",{});var tr=c(In);Ei=o(tr,"OSError"),tr.forEach(n),ji=o(Tn," l\xE0 g\xEC ?!). L\u1ED7i \u0111\u01B0\u1EE3c hi\u1EC3n th\u1ECB \u1EDF \u0111\xE2y ch\u1EC9 l\xE0 ph\u1EA7n cu\u1ED1i c\xF9ng c\u1EE7a m\u1ED9t b\xE1o c\xE1o l\u1ED7i l\u1EDBn h\u01A1n nhi\u1EC1u \u0111\u01B0\u1EE3c g\u1ECDi l\xE0 "),Mn=a(Tn,"EM",{});var nr=c(Mn);Ci=o(nr,"Python traceback"),nr.forEach(n),Ti=o(Tn," (hay c\xF2n g\u1ECDi l\xE0 \u0111\xE1u v\u1EBFt ng\u0103n x\u1EBFp). V\xED d\u1EE5: n\u1EBFu b\u1EA1n \u0111ang ch\u1EA1y \u0111o\u1EA1n m\xE3 n\xE0y tr\xEAn Google Colab, b\u1EA1n s\u1EBD th\u1EA5y m\u1ED9t c\xE1i g\xEC \u0111\xF3 gi\u1ED1ng nh\u01B0 \u1EA3nh ch\u1EE5p m\xE0n h\xECnh sau:"),Tn.forEach(n),Le=u(t),Et=a(t,"DIV",{class:!0});var er=c(Et);jt=a(er,"IMG",{src:!0,alt:!0,width:!0}),er.forEach(n),Ge=u(t),T=a(t,"P",{});var R=c(T);Pi=o(R,"C\xF3 r\u1EA5t nhi\u1EC1u th\xF4ng tin c\xF3 trong c\xE1c b\xE1o c\xE1o n\xE0y, v\xEC v\u1EADy ch\xFAng ta h\xE3y c\xF9ng nhau xem qua c\xE1c ph\u1EA7n ch\xEDnh. \u0110i\u1EC1u \u0111\u1EA7u ti\xEAn c\u1EA7n l\u01B0u \xFD l\xE0 theo d\xF5i ph\u1EA3i \u0111\u01B0\u1EE3c \u0111\u1ECDc "),Ln=a(R,"EM",{});var sr=c(Ln);Ai=o(sr,"t\u1EEB d\u01B0\u1EDBi l\xEAn tr\xEAn"),sr.forEach(n),Di=o(R,". \u0110i\u1EC1u n\xE0y nghe c\xF3 v\u1EBB k\u1EF3 l\u1EA1 n\u1EBFu b\u1EA1n \u0111\xE3 quen \u0111\u1ECDc v\u0103n b\u1EA3n ti\u1EBFng Anh t\u1EEB tr\xEAn xu\u1ED1ng d\u01B0\u1EDBi, nh\u01B0ng n\xF3 ph\u1EA3n \xE1nh th\u1EF1c t\u1EBF l\xE0 b\u1EA3n truy xu\u1EA5t hi\u1EC3n th\u1ECB chu\u1ED7i c\xE1c l\u1EC7nh g\u1ECDi h\xE0m m\xE0 "),Gn=a(R,"CODE",{});var ir=c(Gn);Oi=o(ir,"pipeline"),ir.forEach(n),zi=o(R," th\u1EF1c hi\u1EC7n khi t\u1EA3i xu\u1ED1ng m\xF4 h\xECnh v\xE0 tr\xECnh tokenizer. (Xem "),fn=a(R,"A",{href:!0});var or=c(fn);Si=o(or,"Ch\u01B0\u01A1ng 2"),or.forEach(n),Ni=o(R," \u0111\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt v\u1EC1 c\xE1ch ho\u1EA1t \u0111\u1ED9ng c\u1EE7a "),Vn=a(R,"CODE",{});var hr=c(Vn);Hi=o(hr,"pipeline"),hr.forEach(n),Ii=o(R,".)"),R.forEach(n),Ve=u(t),d(it.$$.fragment,t),Be=u(t),B=a(t,"P",{});var Pn=c(B);Mi=o(Pn,"\u0110i\u1EC1u n\xE0y c\xF3 ngh\u0129a l\xE0 d\xF2ng cu\u1ED1i c\xF9ng c\u1EE7a truy xu\u1EA5t cho bi\u1EBFt th\xF4ng b\xE1o l\u1ED7i cu\u1ED1i c\xF9ng v\xE0 cung c\u1EA5p t\xEAn c\u1EE7a ngo\u1EA1i l\u1EC7 \u0111\xE3 \u0111\u01B0\u1EE3c n\xEAu ra. Trong tr\u01B0\u1EDDng h\u1EE3p n\xE0y, lo\u1EA1i ngo\u1EA1i l\u1EC7 l\xE0 "),Bn=a(Pn,"CODE",{});var rr=c(Bn);Li=o(rr,"OSError"),rr.forEach(n),Gi=o(Pn,", cho bi\u1EBFt l\u1ED7i li\xEAn quan \u0111\u1EBFn h\u1EC7 th\u1ED1ng. N\u1EBFu ch\xFAng ta \u0111\u1ECDc th\xF4ng b\xE1o l\u1ED7i k\xE8m theo, ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y r\u1EB1ng d\u01B0\u1EDDng nh\u01B0 c\xF3 s\u1EF1 c\u1ED1 v\u1EDBi t\u1EC7p "),Qn=a(Pn,"EM",{});var ar=c(Qn);Vi=o(ar,"config.json"),ar.forEach(n),Bi=o(Pn," c\u1EE7a m\xF4 h\xECnh v\xE0 ta s\u1EBD \u0111\u01B0a ra hai \u0111\u1EC1 xu\u1EA5t \u0111\u1EC3 kh\u1EAFc ph\u1EE5c:"),Pn.forEach(n),Qe=u(t),d(Ct.$$.fragment,t),Fe=u(t),d(ot.$$.fragment,t),Re=u(t),_n=a(t,"P",{});var cr=c(_n);Qi=o(cr,"\u0110\u1EC1 xu\u1EA5t \u0111\u1EA7u ti\xEAn l\xE0 y\xEAu c\u1EA7u ta ki\u1EC3m tra xem ID m\xF4 h\xECnh c\xF3 th\u1EF1c s\u1EF1 ch\xEDnh x\xE1c hay kh\xF4ng, v\xEC v\u1EADy, vi\u1EC7c \u0111\u1EA7u ti\xEAn ta l\xE0m l\xE0 sao ch\xE9p ch\u1EC9 s\u1ED1 nh\u1EADn d\u1EA1ng v\xE0 d\xE1n n\xF3 v\xE0o thanh t\xECm ki\u1EBFm c\u1EE7a Hub:"),cr.forEach(n),Ye=u(t),Tt=a(t,"DIV",{class:!0});var lr=c(Tt);Pt=a(lr,"IMG",{src:!0,alt:!0,width:!0}),lr.forEach(n),Je=u(t),bn=a(t,"P",{});var ur=c(bn);Fi=o(ur,"R\u1EA5t ti\u1EBFc, c\xF3 v\u1EBB nh\u01B0 m\xF4 h\xECnh c\u1EE7a anh \u0111\u1ED3ng nghi\u1EC7p kh\xF4ng c\xF3 tr\xEAn Hub \u2026 aha, nh\u01B0ng c\xF3 m\u1ED9t l\u1ED7i \u0111\xE1nh m\xE1y trong t\xEAn c\u1EE7a m\xF4 h\xECnh! DistilBERT ch\u1EC9 c\xF3 m\u1ED9t ch\u1EEF \u201Cl\u201D trong t\xEAn c\u1EE7a n\xF3, v\xEC v\u1EADy h\xE3y s\u1EEDa l\u1ED7i \u0111\xF3 v\xE0 t\xECm \u201Clewtun/distilbert-base-unsased-finetuned-Squad-d5716d28\u201D thay th\u1EBF:"),ur.forEach(n),We=u(t),At=a(t,"DIV",{class:!0});var pr=c(At);Dt=a(pr,"IMG",{src:!0,alt:!0,width:!0}),pr.forEach(n),Xe=u(t),kn=a(t,"P",{});var gr=c(kn);Ri=o(gr,"\u0110\u01B0\u1EE3c r\u1ED3i, \u0111i\u1EC1u n\xE0y \u0111\xE3 th\xE0nh c\xF4ng. B\xE2y gi\u1EDD, h\xE3y th\u1EED t\u1EA3i xu\u1ED1ng m\xF4 h\xECnh m\u1ED9t l\u1EA7n n\u1EEFa v\u1EDBi \u0111\xFAng ID m\xF4 h\xECnh:"),gr.forEach(n),Ke=u(t),d(Ot.$$.fragment,t),Ue=u(t),d(zt.$$.fragment,t),Ze=u(t),Q=a(t,"P",{});var An=c(Q);Yi=o(An,"Argh, l\u1EA1i th\u1EA5t b\u1EA1i - ch\xE0o m\u1EEBng b\u1EA1n \u0111\u1EBFn v\u1EDBi cu\u1ED9c s\u1ED1ng h\xE0ng ng\xE0y c\u1EE7a m\u1ED9t k\u1EF9 s\u01B0 h\u1ECDc m\xE1y! V\xEC ch\xFAng ta \u0111\xE3 s\u1EEDa ID m\xF4 h\xECnh, v\u1EA5n \u0111\u1EC1 ph\u1EA3i n\u1EB1m \u1EDF ch\xEDnh kho l\u01B0u tr\u1EEF. M\u1ED9t c\xE1ch nhanh ch\xF3ng \u0111\u1EC3 truy c\u1EADp n\u1ED9i dung c\u1EE7a m\u1ED9t kho l\u01B0u tr\u1EEF tr\xEAn \u{1F917} Hub l\xE0 th\xF4ng qua h\xE0m "),Fn=a(An,"CODE",{});var mr=c(Fn);Ji=o(mr,"list_repo_files()"),mr.forEach(n),Wi=o(An," c\u1EE7a th\u01B0 vi\u1EC7n "),Rn=a(An,"CODE",{});var dr=c(Rn);Xi=o(dr,"huggingface_hub"),dr.forEach(n),Ki=o(An,":"),An.forEach(n),ts=u(t),d(St.$$.fragment,t),ns=u(t),d(Nt.$$.fragment,t),es=u(t),E=a(t,"P",{});var N=c(E);Ui=o(N,"Th\u1EADt th\xFA v\u1ECB - d\u01B0\u1EDDng nh\u01B0 kh\xF4ng c\xF3 t\u1EC7p "),Yn=a(N,"EM",{});var fr=c(Yn);Zi=o(fr,"config.json"),fr.forEach(n),to=o(N," trong kho l\u01B0u tr\u1EEF! Kh\xF4ng c\xF3 g\xEC ng\u1EA1c nhi\xEAn khi "),Jn=a(N,"CODE",{});var _r=c(Jn);no=o(_r,"pipeline"),_r.forEach(n),eo=o(N," kh\xF4ng th\u1EC3 t\u1EA3i m\xF4 h\xECnh; \u0111\u1ED3ng nghi\u1EC7p c\u1EE7a ch\xFAng ta ch\u1EAFc h\u1EB3n \u0111\xE3 qu\xEAn \u0111\u1EA9y t\u1EC7p n\xE0y v\xE0o Hub sau khi \u0111\xE3 tinh ch\u1EC9nh n\xF3. Trong tr\u01B0\u1EDDng h\u1EE3p n\xE0y, v\u1EA5n \u0111\u1EC1 c\xF3 v\u1EBB kh\xE1 \u0111\u01A1n gi\u1EA3n \u0111\u1EC3 kh\u1EAFc ph\u1EE5c: ch\xFAng ta c\xF3 th\u1EC3 y\xEAu c\u1EA7u h\u1ECD th\xEAm t\u1EC7p ho\u1EB7c, v\xEC ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y t\u1EEB ID m\xF4 h\xECnh m\xE0 m\xF4 h\xECnh hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc \u0111\xE3 s\u1EED d\u1EE5ng l\xE0 "),Ht=a(N,"A",{href:!0,rel:!0});var br=c(Ht);Wn=a(br,"CODE",{});var kr=c(Wn);so=o(kr,"distilbert-base-uncased"),kr.forEach(n),br.forEach(n),io=o(N,", ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i xu\u1ED1ng c\u1EA5u h\xECnh cho m\xF4 h\xECnh n\xE0y v\xE0 \u0111\u1EA9y n\xF3 v\xE0o kho l\u01B0u tr\u1EEF c\u1EE7a m\xECnh \u0111\u1EC3 xem li\u1EC7u \u0111i\u1EC1u \u0111\xF3 c\xF3 gi\u1EA3i quy\u1EBFt \u0111\u01B0\u1EE3c s\u1EF1 c\u1ED1 hay kh\xF4ng. H\xE3y th\u1EED \u0111i\u1EC1u \u0111\xF3. S\u1EED d\u1EE5ng c\xE1c k\u1EF9 thu\u1EADt ch\xFAng ta \u0111\xE3 h\u1ECDc trong "),vn=a(N,"A",{href:!0});var vr=c(vn);oo=o(vr,"Ch\u01B0\u01A1ng 2"),vr.forEach(n),ho=o(N,", ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i xu\u1ED1ng c\u1EA5u h\xECnh c\u1EE7a m\xF4 h\xECnh v\u1EDBi l\u1EDBp "),Xn=a(N,"CODE",{});var yr=c(Xn);ro=o(yr,"AutoConfig"),yr.forEach(n),ao=o(N,":"),N.forEach(n),ss=u(t),d(It.$$.fragment,t),is=u(t),d(ht.$$.fragment,t),os=u(t),rt=a(t,"P",{});var Ys=c(rt);co=o(Ys,"Sau \u0111\xF3, ch\xFAng ta c\xF3 th\u1EC3 \u0111\u1EA9y n\xF3 v\xE0o kho l\u01B0u tr\u1EEF m\xF4 h\xECnh c\u1EE7a m\xECnh b\u1EB1ng h\xE0m "),Kn=a(Ys,"CODE",{});var wr=c(Kn);lo=o(wr,"push_to_hub()"),wr.forEach(n),uo=o(Ys," c\u1EE7a c\u1EA5u h\xECnh:"),Ys.forEach(n),hs=u(t),d(Mt.$$.fragment,t),rs=u(t),at=a(t,"P",{});var Js=c(at);po=o(Js,"B\xE2y gi\u1EDD ch\xFAng ta c\xF3 th\u1EC3 ki\u1EC3m tra xem \u0111i\u1EC1u n\xE0y c\xF3 ho\u1EA1t \u0111\u1ED9ng hay kh\xF4ng b\u1EB1ng c\xE1ch t\u1EA3i m\xF4 h\xECnh t\u1EEB cam k\u1EBFt m\u1EDBi nh\u1EA5t tr\xEAn nh\xE1nh "),Un=a(Js,"CODE",{});var $r=c(Un);go=o($r,"main"),$r.forEach(n),mo=o(Js,":"),Js.forEach(n),as=u(t),d(Lt.$$.fragment,t),cs=u(t),d(Gt.$$.fragment,t),ls=u(t),yn=a(t,"P",{});var xr=c(yn);fo=o(xr,"Tuy\u1EC7t v\u1EDDi, n\xF3 \u0111\xE3 ho\u1EA1t \u0111\u1ED9ng! H\xE3y t\xF3m t\u1EAFt l\u1EA1i nh\u1EEFng g\xEC b\u1EA1n v\u1EEBa h\u1ECDc \u0111\u01B0\u1EE3c:"),xr.forEach(n),us=u(t),z=a(t,"UL",{});var mt=c(z);Vt=a(mt,"LI",{});var Ws=c(Vt);_o=o(Ws,"C\xE1c th\xF4ng b\xE1o l\u1ED7i trong Python \u0111\u01B0\u1EE3c g\u1ECDi l\xE0 "),Zn=a(Ws,"EM",{});var qr=c(Zn);bo=o(qr,"tracebacks"),qr.forEach(n),ko=o(Ws," v\xE0 \u0111\u01B0\u1EE3c \u0111\u1ECDc t\u1EEB d\u01B0\u1EDBi l\xEAn tr\xEAn. D\xF2ng cu\u1ED1i c\xF9ng c\u1EE7a th\xF4ng b\xE1o l\u1ED7i th\u01B0\u1EDDng ch\u1EE9a th\xF4ng tin b\u1EA1n c\u1EA7n \u0111\u1EC3 x\xE1c \u0111\u1ECBnh ngu\u1ED3n g\u1ED1c c\u1EE7a v\u1EA5n \u0111\u1EC1."),Ws.forEach(n),vo=u(mt),te=a(mt,"LI",{});var Er=c(te);yo=o(Er,"N\u1EBFu d\xF2ng cu\u1ED1i c\xF9ng kh\xF4ng ch\u1EE9a \u0111\u1EE7 th\xF4ng tin, h\xE3y l\xE0m theo c\xE1ch c\u1EE7a b\u1EA1n \u0111\u1EC3 truy xu\u1EA5t l\u1EA1i v\xE0 xem li\u1EC7u b\u1EA1n c\xF3 th\u1EC3 x\xE1c \u0111\u1ECBnh \u0111\u01B0\u1EE3c l\u1ED7i x\u1EA3y ra \u1EDF \u0111\xE2u trong m\xE3 ngu\u1ED3n hay kh\xF4ng."),Er.forEach(n),wo=u(mt),ne=a(mt,"LI",{});var jr=c(ne);$o=o(jr,"N\u1EBFu kh\xF4ng c\xF3 th\xF4ng b\xE1o l\u1ED7i n\xE0o c\xF3 th\u1EC3 gi\xFAp b\u1EA1n g\u1EE1 l\u1ED7i, h\xE3y th\u1EED t\xECm ki\u1EBFm tr\u1EF1c tuy\u1EBFn gi\u1EA3i ph\xE1p cho v\u1EA5n \u0111\u1EC1 t\u01B0\u01A1ng t\u1EF1."),jr.forEach(n),xo=u(mt),Bt=a(mt,"LI",{});var Xs=c(Bt);qo=o(Xs,"C\xE1c th\u01B0 vi\u1EC7n "),ee=a(Xs,"CODE",{});var Cr=c(ee);Eo=o(Cr,"huggingface_hub"),Cr.forEach(n),jo=o(Xs," // \u{1F917} Hub? cung c\u1EA5p m\u1ED9t b\u1ED9 c\xF4ng c\u1EE5 m\xE0 b\u1EA1n c\xF3 th\u1EC3 s\u1EED d\u1EE5ng \u0111\u1EC3 t\u01B0\u01A1ng t\xE1c v\xE0 g\u1EE1 l\u1ED7i c\xE1c kho l\u01B0u tr\u1EEF tr\xEAn Hub."),Xs.forEach(n),mt.forEach(n),ps=u(t),wn=a(t,"P",{});var Tr=c(wn);Co=o(Tr,"B\xE2y gi\u1EDD b\u1EA1n \u0111\xE3 bi\u1EBFt c\xE1ch g\u1EE1 l\u1ED7i m\u1ED9t \u0111\u01B0\u1EDDng d\u1EABn, ch\xFAng ta h\xE3y xem m\u1ED9t v\xED d\u1EE5 ph\u1EE9c t\u1EA1p h\u01A1n trong b\u01B0\u1EDBc truy\u1EC1n th\u1EB3ng c\u1EE7a ch\xEDnh m\xF4 h\xECnh."),Tr.forEach(n),gs=u(t),K=a(t,"H2",{class:!0});var Ks=c(K);ct=a(Ks,"A",{id:!0,class:!0,href:!0});var Pr=c(ct);se=a(Pr,"SPAN",{});var Ar=c(se);d(Qt.$$.fragment,Ar),Ar.forEach(n),Pr.forEach(n),To=u(Ks),ie=a(Ks,"SPAN",{});var Dr=c(ie);Po=o(Dr,"G\u1EE1 l\u1ED7i truy\u1EC1n th\u1EB3ng m\xF4 h\xECnh c\u1EE7a b\u1EA1n"),Dr.forEach(n),Ks.forEach(n),ms=u(t),F=a(t,"P",{});var Dn=c(F);Ao=o(Dn,"M\u1EB7c d\xF9 "),oe=a(Dn,"CODE",{});var Or=c(oe);Do=o(Or,"pipeline"),Or.forEach(n),Oo=o(Dn," tuy\u1EC7t v\u1EDDi cho h\u1EA7u h\u1EBFt c\xE1c \u1EE9ng d\u1EE5ng m\xE0 b\u1EA1n c\u1EA7n nhanh ch\xF3ng t\u1EA1o d\u1EF1 \u0111o\xE1n, \u0111\xF4i khi b\u1EA1n s\u1EBD c\u1EA7n truy c\u1EADp nh\u1EADt k\xFD c\u1EE7a m\xF4 h\xECnh (gi\u1EA3 s\u1EED, n\u1EBFu b\u1EA1n c\xF3 m\u1ED9t s\u1ED1 h\u1EADu x\u1EED l\xFD t\xF9y ch\u1EC9nh m\xE0 b\u1EA1n mu\u1ED1n \xE1p d\u1EE5ng). \u0110\u1EC3 xem \u0111i\u1EC1u g\xEC c\xF3 th\u1EC3 sai trong tr\u01B0\u1EDDng h\u1EE3p n\xE0y, tr\u01B0\u1EDBc ti\xEAn h\xE3y l\u1EA5y m\xF4 h\xECnh v\xE0 tr\xECnh tokenize t\u1EEB "),he=a(Dn,"CODE",{});var zr=c(he);zo=o(zr,"pipeline"),zr.forEach(n),So=o(Dn," c\u1EE7a m\xECnh:"),Dn.forEach(n),ds=u(t),d(Ft.$$.fragment,t),fs=u(t),$n=a(t,"P",{});var Sr=c($n);No=o(Sr,"Ti\u1EBFp theo, ch\xFAng ta c\u1EA7n m\u1ED9t c\xE2u h\u1ECFi, v\xEC v\u1EADy h\xE3y xem li\u1EC7u c\xE1c khung y\xEAu th\xEDch c\u1EE7a ch\xFAng ta c\xF3 \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3 kh\xF4ng:"),Sr.forEach(n),_s=u(t),d(Rt.$$.fragment,t),bs=u(t),lt=a(t,"P",{});var Us=c(lt);Ho=o(Us,"Nh\u01B0 \u0111\xE3 th\u1EA5y trong "),xn=a(Us,"A",{href:!0});var Nr=c(xn);Io=o(Nr,"Ch\u01B0\u01A1ng 7"),Nr.forEach(n),Mo=o(Us,", c\xE1c b\u01B0\u1EDBc th\xF4ng th\u01B0\u1EDDng ta c\u1EA7n l\xE0m \u0111\xF3 l\xE0 tokenize \u0111\u1EA7u v\xE0o, tr\xEDch xu\u1EA5t c\xE1c logit c\u1EE7a token b\u1EAFt \u0111\u1EA7u v\xE0 k\u1EBFt th\xFAc, r\u1ED3i sau \u0111\xF3 gi\u1EA3i m\xE3 c\xE1c kho\u1EA3ng tr\u1EA3 l\u1EDDi:"),Us.forEach(n),ks=u(t),d(Yt.$$.fragment,t),vs=u(t),d(Jt.$$.fragment,t),ys=u(t),qn=a(t,"P",{});var Hr=c(qn);Lo=o(Hr,"\xD4i tr\u1EDDi, c\xF3 v\u1EBB nh\u01B0 ch\xFAng ta c\xF3 m\u1ED9t l\u1ED7i trong \u0111o\u1EA1n m\xE3 c\u1EE7a m\xECnh! Nh\u01B0ng ch\xFAng ta kh\xF4ng s\u1EE3 g\u1EE1 l\u1ED7i ch\xFAt n\xE0o. B\u1EA1n c\xF3 th\u1EC3 s\u1EED d\u1EE5ng tr\xECnh g\u1EE1 l\u1ED7i Python trong notebook:"),Hr.forEach(n),ws=u(t),d(Wt.$$.fragment,t),$s=u(t),En=a(t,"P",{});var Ir=c(En);Go=o(Ir,"ho\u1EB7c trong terminal:"),Ir.forEach(n),xs=u(t),d(Xt.$$.fragment,t),qs=u(t),P=a(t,"P",{});var Y=c(P);Vo=o(Y,"\u1EDE \u0111\xE2y, khi \u0111\u1ECDc th\xF4ng b\xE1o l\u1ED7i cho ch\xFAng ta bi\u1EBFt r\u1EB1ng \u0111\u1ED1i t\u01B0\u1EE3ng "),re=a(Y,"CODE",{});var Mr=c(re);Bo=o(Mr,"'list' object has no attribute 'size'"),Mr.forEach(n),Qo=o(Y," v\xE0 ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y m\u1ED9t m\u0169i t\xEAn "),ae=a(Y,"CODE",{});var Lr=c(ae);Fo=o(Lr,"-->"),Lr.forEach(n),Ro=o(Y," tr\u1ECF \u0111\u1EBFn d\xF2ng n\u01A1i v\u1EA5n \u0111\u1EC1 \u0111\xE3 \u0111\u01B0\u1EE3c n\xEAu ra trong "),ce=a(Y,"CODE",{});var Gr=c(ce);Yo=o(Gr,"model(** input)"),Gr.forEach(n),Jo=o(Y,". B\u1EA1n c\xF3 th\u1EC3 g\u1EE1 l\u1ED7i \u0111i\u1EC1u n\xE0y m\u1ED9t c\xE1ch t\u01B0\u01A1ng t\u1EF1 b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng tr\xECnh g\u1EE1 l\u1ED7i Python, nh\u01B0ng b\xE2y gi\u1EDD ch\xFAng ta ch\u1EC9 c\u1EA7n in ra m\u1ED9t ph\u1EA7n c\u1EE7a "),le=a(Y,"CODE",{});var Vr=c(le);Wo=o(Vr,"inputs"),Vr.forEach(n),Xo=o(Y," \u0111\u1EC3 xem nh\u1EEFng g\xEC ch\xFAng ta c\xF3:"),Y.forEach(n),Es=u(t),A=a(t,"P",{});var J=c(A);Ko=o(J,"Here, reading the error message tells us that "),ue=a(J,"CODE",{});var Br=c(ue);Uo=o(Br,"'list' object has no attribute 'size'"),Br.forEach(n),Zo=o(J,", and we can see a "),pe=a(J,"CODE",{});var Qr=c(pe);th=o(Qr,"-->"),Qr.forEach(n),nh=o(J," arrow pointing to the line where the problem was raised in "),ge=a(J,"CODE",{});var Fr=c(ge);eh=o(Fr,"model(**inputs)"),Fr.forEach(n),sh=o(J,".You can debug this interactively using the Python debugger, but for now we\u2019ll simply print out a slice of "),me=a(J,"CODE",{});var Rr=c(me);ih=o(Rr,"inputs"),Rr.forEach(n),oh=o(J," to see what we have:"),J.forEach(n),js=u(t),d(Kt.$$.fragment,t),Cs=u(t),d(Ut.$$.fragment,t),Ts=u(t),ut=a(t,"P",{});var Zs=c(ut);hh=o(Zs,"\u0110i\u1EC1u n\xE0y ch\u1EAFc ch\u1EAFn tr\xF4ng gi\u1ED1ng nh\u01B0 m\u1ED9t "),de=a(Zs,"CODE",{});var Yr=c(de);rh=o(Yr,"list"),Yr.forEach(n),ah=o(Zs," Python b\xECnh th\u01B0\u1EDDng, nh\u01B0ng h\xE3y ki\u1EC3m tra k\u1EF9 lo\u1EA1i:"),Zs.forEach(n),Ps=u(t),d(Zt.$$.fragment,t),As=u(t),d(tn.$$.fragment,t),Ds=u(t),j=a(t,"P",{});var H=c(j);ch=o(H,"V\xE2ng, \u0111\xF3 ch\u1EAFc ch\u1EAFn l\xE0 m\u1ED9t "),fe=a(H,"CODE",{});var Jr=c(fe);lh=o(Jr,"list"),Jr.forEach(n),uh=o(H," Python. V\u1EADy \u0111i\u1EC1u g\xEC \u0111\xE3 x\u1EA3y ra? Nh\u1EDB l\u1EA1i t\u1EEB "),jn=a(H,"A",{href:!0});var Wr=c(jn);ph=o(Wr,"Ch\u01B0\u01A1ng 2"),Wr.forEach(n),gh=o(H," r\u1EB1ng c\xE1c l\u1EDBp "),_e=a(H,"CODE",{});var Xr=c(_e);mh=o(Xr,"AutoModelForXxx"),Xr.forEach(n),dh=o(H," trong \u{1F917} Transformers ho\u1EA1t \u0111\u1ED9ng tr\xEAn "),be=a(H,"EM",{});var Kr=c(be);fh=o(Kr,"tensors"),Kr.forEach(n),_h=o(H," (trong PyTorch ho\u1EB7c TensorFlow) v\xE0 ho\u1EA1t \u0111\u1ED9ng ph\u1ED5 bi\u1EBFn l\xE0 tr\xEDch xu\u1EA5t c\xE1c k\xEDch th\u01B0\u1EDBc c\u1EE7a tensor b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),ke=a(H,"CODE",{});var Ur=c(ke);bh=o(Ur,"Tensor.size()"),Ur.forEach(n),kh=o(H," trong PyTorch. Ch\xFAng ta h\xE3y xem x\xE9t l\u1EA1i qu\xE1 tr\xECnh truy v\u1EBFt, \u0111\u1EC3 xem d\xF2ng n\xE0o \u0111\xE3 k\xEDch ho\u1EA1t ngo\u1EA1i l\u1EC7:"),H.forEach(n),Os=u(t),d(nn.$$.fragment,t),zs=u(t),S=a(t,"P",{});var dt=c(S);vh=o(dt,"C\xF3 v\u1EBB nh\u01B0 m\xE3 c\u1EE7a ch\xFAng ta \u0111\xE3 c\u1ED1 g\u1EAFng g\u1ECDi "),ve=a(dt,"CODE",{});var Zr=c(ve);yh=o(Zr,"input_ids.size()"),Zr.forEach(n),wh=o(dt,", nh\u01B0ng \u0111i\u1EC1u n\xE0y r\xF5 r\xE0ng s\u1EBD kh\xF4ng ho\u1EA1t \u0111\u1ED9ng \u0111\u1ED1i v\u1EDBi m\u1ED9t "),ye=a(dt,"CODE",{});var ta=c(ye);$h=o(ta,"list"),ta.forEach(n),xh=o(dt," Python, v\u1ED1n ch\u1EC9 l\xE0 m\u1ED9t v\xF9ng ch\u1EE9a. L\xE0m th\u1EBF n\xE0o ch\xFAng ta c\xF3 th\u1EC3 gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1 n\xE0y? T\xECm ki\u1EBFm th\xF4ng b\xE1o l\u1ED7i tr\xEAn Stack Overflow \u0111\u01B0a ra m\u1ED9t s\u1ED1 "),en=a(dt,"A",{href:!0,rel:!0});var na=c(en);qh=o(na,"l\u01B0\u1EE3t truy c\u1EADp"),na.forEach(n),Eh=o(dt," li\xEAn quan. Nh\u1EA5p v\xE0o c\xE2u h\u1ECFi \u0111\u1EA7u ti\xEAn s\u1EBD hi\u1EC3n th\u1ECB m\u1ED9t c\xE2u h\u1ECFi t\u01B0\u01A1ng t\u1EF1 nh\u01B0 c\xE2u h\u1ECFi c\u1EE7a ch\xFAng ta, v\u1EDBi c\xE2u tr\u1EA3 l\u1EDDi \u0111\u01B0\u1EE3c hi\u1EC3n th\u1ECB trong \u1EA3nh ch\u1EE5p m\xE0n h\xECnh b\xEAn d\u01B0\u1EDBi:"),dt.forEach(n),Ss=u(t),sn=a(t,"DIV",{class:!0});var ea=c(sn);on=a(ea,"IMG",{src:!0,alt:!0,width:!0}),ea.forEach(n),Ns=u(t),pt=a(t,"P",{});var ti=c(pt);jh=o(ti,"C\xE2u tr\u1EA3 l\u1EDDi khuy\xEAn ch\xFAng ta n\xEAn th\xEAm "),we=a(ti,"CODE",{});var sa=c(we);Ch=o(sa,"return_tensors='pt'"),sa.forEach(n),Th=o(ti," v\xE0o tokenizer, v\xEC v\u1EADy h\xE3y xem \u0111i\u1EC1u \u0111\xF3 c\xF3 ph\xF9 h\u1EE3p v\u1EDBi ch\xFAng ta kh\xF4ng:"),ti.forEach(n),Hs=u(t),d(hn.$$.fragment,t),Is=u(t),d(rn.$$.fragment,t),Ms=u(t),gt=a(t,"P",{});var ni=c(gt);Ph=o(ni,"T\u1ED1t, n\xF3 \u0111\xE3 ho\u1EA1t \u0111\u1ED9ng! \u0110\xE2y l\xE0 m\u1ED9t v\xED d\u1EE5 tuy\u1EC7t v\u1EDDi v\u1EC1 m\u1EE9c \u0111\u1ED9 h\u1EEFu \xEDch c\u1EE7a Stack Overflow: b\u1EB1ng c\xE1ch x\xE1c \u0111\u1ECBnh m\u1ED9t v\u1EA5n \u0111\u1EC1 t\u01B0\u01A1ng t\u1EF1, ch\xFAng ta c\xF3 th\u1EC3 h\u01B0\u1EDFng l\u1EE3i t\u1EEB kinh nghi\u1EC7m c\u1EE7a nh\u1EEFng ng\u01B0\u1EDDi kh\xE1c trong c\u1ED9ng \u0111\u1ED3ng. Tuy nhi\xEAn, m\u1ED9t t\xECm ki\u1EBFm nh\u01B0 th\u1EBF n\xE0y kh\xF4ng ph\u1EA3i l\xFAc n\xE0o c\u0169ng mang l\u1EA1i c\xE2u tr\u1EA3 l\u1EDDi ph\xF9 h\u1EE3p, v\u1EADy b\u1EA1n c\xF3 th\u1EC3 l\xE0m g\xEC trong nh\u1EEFng tr\u01B0\u1EDDng h\u1EE3p nh\u01B0 v\u1EADy? May m\u1EAFn thay, c\xF3 m\u1ED9t c\u1ED9ng \u0111\u1ED3ng c\xE1c nh\xE0 ph\xE1t tri\u1EC3n ch\xE0o \u0111\xF3n tr\xEAn "),an=a(ni,"A",{href:!0,rel:!0});var ia=c(an);Ah=o(ia,"di\u1EC5n \u0111\xE0n Hugging Face"),ia.forEach(n),Dh=o(ni," c\xF3 th\u1EC3 gi\xFAp b\u1EA1n! Trong ph\u1EA7n ti\u1EBFp theo, ch\xFAng ta s\u1EBD xem x\xE9t c\xE1ch b\u1EA1n c\xF3 th\u1EC3 t\u1EA1o ra c\xE1c c\xE2u h\u1ECFi t\u1ED1t tr\xEAn di\u1EC5n \u0111\xE0n c\xF3 kh\u1EA3 n\u0103ng \u0111\u01B0\u1EE3c tr\u1EA3 l\u1EDDi."),ni.forEach(n),this.h()},h(){p(g,"name","hf:doc:metadata"),p(g,"content",JSON.stringify(da)),p(w,"id","phi-lm-g-khi-bn-gp-li"),p(w,"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"),p(w,"href","#phi-lm-g-khi-bn-gp-li"),p(v,"class","relative group"),p(W,"href","/course/chapter8/section4"),p(_t,"href","https://huggingface.co/lewtun/distilbert-base-uncased-finetuned-squad-d5716d28"),p(_t,"rel","nofollow"),p(bt,"href","https://huggingface.co"),p(bt,"rel","nofollow"),p(et,"id","g-li-pipeline-transformers"),p(et,"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"),p(et,"href","#g-li-pipeline-transformers"),p(X,"class","relative group"),p(dn,"href","/course/chapter7/7"),ei(jt.src,Nh="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter8/traceback.png")||p(jt,"src",Nh),p(jt,"alt","A Python traceback."),p(jt,"width","100%"),p(Et,"class","flex justify-center"),p(fn,"href","/course/chapter2"),ei(Pt.src,Hh="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter8/wrong-model-id.png")||p(Pt,"src",Hh),p(Pt,"alt","The wrong model name."),p(Pt,"width","100%"),p(Tt,"class","flex justify-center"),ei(Dt.src,Ih="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter8/true-model-id.png")||p(Dt,"src",Ih),p(Dt,"alt","The right model name."),p(Dt,"width","100%"),p(At,"class","flex justify-center"),p(Ht,"href","https://huggingface.co/distilbert-base-uncased"),p(Ht,"rel","nofollow"),p(vn,"href","/course/chapter2"),p(ct,"id","g-li-truyn-thng-m-hnh-ca-bn"),p(ct,"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"),p(ct,"href","#g-li-truyn-thng-m-hnh-ca-bn"),p(K,"class","relative group"),p(xn,"href","/course/chapter7"),p(jn,"href","/course/chapter2"),p(en,"href","https://stackoverflow.com/search?q=AttributeError%3A+%27list%27+object+has+no+attribute+%27size%27&s=c15ec54c-63cb-481d-a749-408920073e8f"),p(en,"rel","nofollow"),ei(on.src,Mh="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter8/stack-overflow.png")||p(on,"src",Mh),p(on,"alt","An answer from Stack Overflow."),p(on,"width","100%"),p(sn,"class","flex justify-center"),p(an,"href","https://discuss.huggingface.co/"),p(an,"rel","nofollow")},m(t,s){e(document.head,g),h(t,q,s),h(t,v,s),e(v,w),e(w,D),f($,D,null),e(v,C),e(v,O),e(O,I),h(t,Z,s),f(M,t,s),h(t,L,s),h(t,x,s),e(x,ln),e(x,W),e(W,un),e(x,si),h(t,qe,s),f(ft,t,s),h(t,Ee,s),h(t,G,s),e(G,ii),e(G,_t),e(_t,oi),e(G,hi),e(G,bt),e(bt,ri),e(G,ai),h(t,je,s),f(kt,t,s),h(t,Ce,s),h(t,pn,s),e(pn,ci),h(t,Te,s),f(vt,t,s),h(t,Pe,s),h(t,tt,s),e(tt,li),e(tt,On),e(On,ui),e(tt,pi),h(t,Ae,s),f(yt,t,s),h(t,De,s),h(t,nt,s),e(nt,gi),e(nt,zn),e(zn,mi),e(nt,di),h(t,Oe,s),h(t,X,s),e(X,et),e(et,Sn),f(wt,Sn,null),e(X,fi),e(X,Nn),e(Nn,_i),h(t,ze,s),h(t,gn,s),e(gn,bi),h(t,Se,s),h(t,mn,s),e(mn,$t),e($t,ki),e($t,dn),e(dn,vi),e($t,yi),h(t,Ne,s),h(t,st,s),e(st,wi),e(st,Hn),e(Hn,$i),e(st,xi),h(t,He,s),f(xt,t,s),h(t,Ie,s),f(qt,t,s),h(t,Me,s),h(t,V,s),e(V,qi),e(V,In),e(In,Ei),e(V,ji),e(V,Mn),e(Mn,Ci),e(V,Ti),h(t,Le,s),h(t,Et,s),e(Et,jt),h(t,Ge,s),h(t,T,s),e(T,Pi),e(T,Ln),e(Ln,Ai),e(T,Di),e(T,Gn),e(Gn,Oi),e(T,zi),e(T,fn),e(fn,Si),e(T,Ni),e(T,Vn),e(Vn,Hi),e(T,Ii),h(t,Ve,s),f(it,t,s),h(t,Be,s),h(t,B,s),e(B,Mi),e(B,Bn),e(Bn,Li),e(B,Gi),e(B,Qn),e(Qn,Vi),e(B,Bi),h(t,Qe,s),f(Ct,t,s),h(t,Fe,s),f(ot,t,s),h(t,Re,s),h(t,_n,s),e(_n,Qi),h(t,Ye,s),h(t,Tt,s),e(Tt,Pt),h(t,Je,s),h(t,bn,s),e(bn,Fi),h(t,We,s),h(t,At,s),e(At,Dt),h(t,Xe,s),h(t,kn,s),e(kn,Ri),h(t,Ke,s),f(Ot,t,s),h(t,Ue,s),f(zt,t,s),h(t,Ze,s),h(t,Q,s),e(Q,Yi),e(Q,Fn),e(Fn,Ji),e(Q,Wi),e(Q,Rn),e(Rn,Xi),e(Q,Ki),h(t,ts,s),f(St,t,s),h(t,ns,s),f(Nt,t,s),h(t,es,s),h(t,E,s),e(E,Ui),e(E,Yn),e(Yn,Zi),e(E,to),e(E,Jn),e(Jn,no),e(E,eo),e(E,Ht),e(Ht,Wn),e(Wn,so),e(E,io),e(E,vn),e(vn,oo),e(E,ho),e(E,Xn),e(Xn,ro),e(E,ao),h(t,ss,s),f(It,t,s),h(t,is,s),f(ht,t,s),h(t,os,s),h(t,rt,s),e(rt,co),e(rt,Kn),e(Kn,lo),e(rt,uo),h(t,hs,s),f(Mt,t,s),h(t,rs,s),h(t,at,s),e(at,po),e(at,Un),e(Un,go),e(at,mo),h(t,as,s),f(Lt,t,s),h(t,cs,s),f(Gt,t,s),h(t,ls,s),h(t,yn,s),e(yn,fo),h(t,us,s),h(t,z,s),e(z,Vt),e(Vt,_o),e(Vt,Zn),e(Zn,bo),e(Vt,ko),e(z,vo),e(z,te),e(te,yo),e(z,wo),e(z,ne),e(ne,$o),e(z,xo),e(z,Bt),e(Bt,qo),e(Bt,ee),e(ee,Eo),e(Bt,jo),h(t,ps,s),h(t,wn,s),e(wn,Co),h(t,gs,s),h(t,K,s),e(K,ct),e(ct,se),f(Qt,se,null),e(K,To),e(K,ie),e(ie,Po),h(t,ms,s),h(t,F,s),e(F,Ao),e(F,oe),e(oe,Do),e(F,Oo),e(F,he),e(he,zo),e(F,So),h(t,ds,s),f(Ft,t,s),h(t,fs,s),h(t,$n,s),e($n,No),h(t,_s,s),f(Rt,t,s),h(t,bs,s),h(t,lt,s),e(lt,Ho),e(lt,xn),e(xn,Io),e(lt,Mo),h(t,ks,s),f(Yt,t,s),h(t,vs,s),f(Jt,t,s),h(t,ys,s),h(t,qn,s),e(qn,Lo),h(t,ws,s),f(Wt,t,s),h(t,$s,s),h(t,En,s),e(En,Go),h(t,xs,s),f(Xt,t,s),h(t,qs,s),h(t,P,s),e(P,Vo),e(P,re),e(re,Bo),e(P,Qo),e(P,ae),e(ae,Fo),e(P,Ro),e(P,ce),e(ce,Yo),e(P,Jo),e(P,le),e(le,Wo),e(P,Xo),h(t,Es,s),h(t,A,s),e(A,Ko),e(A,ue),e(ue,Uo),e(A,Zo),e(A,pe),e(pe,th),e(A,nh),e(A,ge),e(ge,eh),e(A,sh),e(A,me),e(me,ih),e(A,oh),h(t,js,s),f(Kt,t,s),h(t,Cs,s),f(Ut,t,s),h(t,Ts,s),h(t,ut,s),e(ut,hh),e(ut,de),e(de,rh),e(ut,ah),h(t,Ps,s),f(Zt,t,s),h(t,As,s),f(tn,t,s),h(t,Ds,s),h(t,j,s),e(j,ch),e(j,fe),e(fe,lh),e(j,uh),e(j,jn),e(jn,ph),e(j,gh),e(j,_e),e(_e,mh),e(j,dh),e(j,be),e(be,fh),e(j,_h),e(j,ke),e(ke,bh),e(j,kh),h(t,Os,s),f(nn,t,s),h(t,zs,s),h(t,S,s),e(S,vh),e(S,ve),e(ve,yh),e(S,wh),e(S,ye),e(ye,$h),e(S,xh),e(S,en),e(en,qh),e(S,Eh),h(t,Ss,s),h(t,sn,s),e(sn,on),h(t,Ns,s),h(t,pt,s),e(pt,jh),e(pt,we),e(we,Ch),e(pt,Th),h(t,Hs,s),f(hn,t,s),h(t,Is,s),f(rn,t,s),h(t,Ms,s),h(t,gt,s),e(gt,Ph),e(gt,an),e(an,Ah),e(gt,Dh),Ls=!0},p(t,[s]){const cn={};s&2&&(cn.$$scope={dirty:s,ctx:t}),it.$set(cn);const $e={};s&2&&($e.$$scope={dirty:s,ctx:t}),ot.$set($e);const xe={};s&2&&(xe.$$scope={dirty:s,ctx:t}),ht.$set(xe)},i(t){Ls||(_($.$$.fragment,t),_(M.$$.fragment,t),_(ft.$$.fragment,t),_(kt.$$.fragment,t),_(vt.$$.fragment,t),_(yt.$$.fragment,t),_(wt.$$.fragment,t),_(xt.$$.fragment,t),_(qt.$$.fragment,t),_(it.$$.fragment,t),_(Ct.$$.fragment,t),_(ot.$$.fragment,t),_(Ot.$$.fragment,t),_(zt.$$.fragment,t),_(St.$$.fragment,t),_(Nt.$$.fragment,t),_(It.$$.fragment,t),_(ht.$$.fragment,t),_(Mt.$$.fragment,t),_(Lt.$$.fragment,t),_(Gt.$$.fragment,t),_(Qt.$$.fragment,t),_(Ft.$$.fragment,t),_(Rt.$$.fragment,t),_(Yt.$$.fragment,t),_(Jt.$$.fragment,t),_(Wt.$$.fragment,t),_(Xt.$$.fragment,t),_(Kt.$$.fragment,t),_(Ut.$$.fragment,t),_(Zt.$$.fragment,t),_(tn.$$.fragment,t),_(nn.$$.fragment,t),_(hn.$$.fragment,t),_(rn.$$.fragment,t),Ls=!0)},o(t){b($.$$.fragment,t),b(M.$$.fragment,t),b(ft.$$.fragment,t),b(kt.$$.fragment,t),b(vt.$$.fragment,t),b(yt.$$.fragment,t),b(wt.$$.fragment,t),b(xt.$$.fragment,t),b(qt.$$.fragment,t),b(it.$$.fragment,t),b(Ct.$$.fragment,t),b(ot.$$.fragment,t),b(Ot.$$.fragment,t),b(zt.$$.fragment,t),b(St.$$.fragment,t),b(Nt.$$.fragment,t),b(It.$$.fragment,t),b(ht.$$.fragment,t),b(Mt.$$.fragment,t),b(Lt.$$.fragment,t),b(Gt.$$.fragment,t),b(Qt.$$.fragment,t),b(Ft.$$.fragment,t),b(Rt.$$.fragment,t),b(Yt.$$.fragment,t),b(Jt.$$.fragment,t),b(Wt.$$.fragment,t),b(Xt.$$.fragment,t),b(Kt.$$.fragment,t),b(Ut.$$.fragment,t),b(Zt.$$.fragment,t),b(tn.$$.fragment,t),b(nn.$$.fragment,t),b(hn.$$.fragment,t),b(rn.$$.fragment,t),Ls=!1},d(t){n(g),t&&n(q),t&&n(v),k($),t&&n(Z),k(M,t),t&&n(L),t&&n(x),t&&n(qe),k(ft,t),t&&n(Ee),t&&n(G),t&&n(je),k(kt,t),t&&n(Ce),t&&n(pn),t&&n(Te),k(vt,t),t&&n(Pe),t&&n(tt),t&&n(Ae),k(yt,t),t&&n(De),t&&n(nt),t&&n(Oe),t&&n(X),k(wt),t&&n(ze),t&&n(gn),t&&n(Se),t&&n(mn),t&&n(Ne),t&&n(st),t&&n(He),k(xt,t),t&&n(Ie),k(qt,t),t&&n(Me),t&&n(V),t&&n(Le),t&&n(Et),t&&n(Ge),t&&n(T),t&&n(Ve),k(it,t),t&&n(Be),t&&n(B),t&&n(Qe),k(Ct,t),t&&n(Fe),k(ot,t),t&&n(Re),t&&n(_n),t&&n(Ye),t&&n(Tt),t&&n(Je),t&&n(bn),t&&n(We),t&&n(At),t&&n(Xe),t&&n(kn),t&&n(Ke),k(Ot,t),t&&n(Ue),k(zt,t),t&&n(Ze),t&&n(Q),t&&n(ts),k(St,t),t&&n(ns),k(Nt,t),t&&n(es),t&&n(E),t&&n(ss),k(It,t),t&&n(is),k(ht,t),t&&n(os),t&&n(rt),t&&n(hs),k(Mt,t),t&&n(rs),t&&n(at),t&&n(as),k(Lt,t),t&&n(cs),k(Gt,t),t&&n(ls),t&&n(yn),t&&n(us),t&&n(z),t&&n(ps),t&&n(wn),t&&n(gs),t&&n(K),k(Qt),t&&n(ms),t&&n(F),t&&n(ds),k(Ft,t),t&&n(fs),t&&n($n),t&&n(_s),k(Rt,t),t&&n(bs),t&&n(lt),t&&n(ks),k(Yt,t),t&&n(vs),k(Jt,t),t&&n(ys),t&&n(qn),t&&n(ws),k(Wt,t),t&&n($s),t&&n(En),t&&n(xs),k(Xt,t),t&&n(qs),t&&n(P),t&&n(Es),t&&n(A),t&&n(js),k(Kt,t),t&&n(Cs),k(Ut,t),t&&n(Ts),t&&n(ut),t&&n(Ps),k(Zt,t),t&&n(As),k(tn,t),t&&n(Ds),t&&n(j),t&&n(Os),k(nn,t),t&&n(zs),t&&n(S),t&&n(Ss),t&&n(sn),t&&n(Ns),t&&n(pt),t&&n(Hs),k(hn,t),t&&n(Is),k(rn,t),t&&n(Ms),t&&n(gt)}}}const da={local:"phi-lm-g-khi-bn-gp-li",sections:[{local:"g-li-pipeline-transformers",title:"G\u1EE1 l\u1ED7i pipeline \u{1F917} Transformers"},{local:"g-li-truyn-thng-m-hnh-ca-bn",title:"G\u1EE1 l\u1ED7i truy\u1EC1n th\u1EB3ng m\xF4 h\xECnh c\u1EE7a b\u1EA1n"}],title:"Ph\u1EA3i l\xE0m g\xEC khi b\u1EA1n g\u1EB7p l\u1ED7i"};function fa(U){return ca(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $a extends oa{constructor(g){super();ha(this,g,fa,ma,ra,{})}}export{$a as default,da as metadata};
