import{S as lt,i as ot,s as at,e as r,k as p,w as W,t as a,M as st,c as i,d as t,m as f,a as n,x as H,h as s,b as M,G as l,g as m,y as N,L as rt,q as Y,o as z,B as D,v as it}from"../chunks/vendor-hf-doc-builder.js";import{I as nt}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as ce}from"../chunks/CodeBlock-hf-doc-builder.js";function mt(ke){let u,O,T,w,F,_,Me,L,de,g,h,G,ue,Te,V,he,we,P,d,be,C,Ue,Je,v,ye,_e,q,E,Ge,K,j,ee,b,ve,B,je,Be,te,Z,le,U,Ze,S,$e,xe,oe,$,ae,J,Ee,A,Ie,Fe,se,x,re,c,Le,R,Ve,Ce,X,Se,Ae,k,Re,Xe,ie;return _=new nt({}),j=new ce({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdGltdW0lNUJleHBvcnRlcnMtdGYlNUQ=",highlighted:"pip install optimum[exporters-tf]"}}),Z=new ce({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjB0ZmxpdGUlMjAtLWhlbHA=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> tflite --<span class="hljs-built_in">help</span>'}}),$=new ce({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjB0ZmxpdGUlMjAtLW1vZGVsJTIwYmVydC1iYXNlLXVuY2FzZWQlMjAtLXNlcXVlbmNlX2xlbmd0aCUyMDEyOCUyMGJlcnRfdGZsaXRlJTJG",highlighted:'optimum-cli <span class="hljs-built_in">export</span> tflite --model bert-base-uncased --sequence_length 128 bert_tflite/'}}),x=new ce({props:{code:"VmFsaWRhdGluZyUyMFRGTGl0ZSUyMG1vZGVsLi4uJTBBJTA5LSU1QiVFMiU5QyU5MyU1RCUyMFRGTGl0ZSUyMG1vZGVsJTIwb3V0cHV0JTIwbmFtZXMlMjBtYXRjaCUyMHJlZmVyZW5jZSUyMG1vZGVsJTIwKGxvZ2l0cyklMEElMDktJTIwVmFsaWRhdGluZyUyMFRGTGl0ZSUyME1vZGVsJTIwb3V0cHV0JTIwJTIybG9naXRzJTIyJTNBJTBBJTA5JTA5LSU1QiVFMiU5QyU5MyU1RCUyMCgxJTJDJTIwMTI4JTJDJTIwMzA1MjIpJTIwbWF0Y2hlcyUyMCgxJTJDJTIwMTI4JTJDJTIwMzA1MjIpJTBBJTA5JTA5LSU1QnglNUQlMjB2YWx1ZXMlMjBub3QlMjBjbG9zZSUyMGVub3VnaCUyQyUyMG1heCUyMGRpZmYlM0ElMjA1LjgxNzQxMzMzMDA3ODEyNWUtMDUlMjAoYXRvbCUzQSUyMDFlLTA1KSUwQVRoZSUyMFRlbnNvckZsb3clMjBMaXRlJTIwZXhwb3J0JTIwc3VjY2VlZGVkJTIwd2l0aCUyMHRoZSUyMHdhcm5pbmclM0ElMjBUaGUlMjBtYXhpbXVtJTIwYWJzb2x1dGUlMjBkaWZmZXJlbmNlJTIwYmV0d2VlbiUyMHRoZSUyMG91dHB1dCUyMG9mJTIwdGhlJTIwcmVmZXJlbmNlJTIwbW9kZWwlMjBhbmQlMjB0aGUlMjBURkxpdGUlMjBleHBvcnRlZCUyMG1vZGVsJTIwaXMlMjBub3QlMjB3aXRoaW4lMjB0aGUlMjBzZXQlMjB0b2xlcmFuY2UlMjAxZS0wNSUzQSUwQS0lMjBsb2dpdHMlM0ElMjBtYXglMjBkaWZmJTIwJTNEJTIwNS44MTc0MTMzMzAwNzgxMjVlLTA1LiUwQSUyMFRoZSUyMGV4cG9ydGVkJTIwbW9kZWwlMjB3YXMlMjBzYXZlZCUyMGF0JTNBJTIwYmVydF90ZmxpdGU=",highlighted:`Validating TFLite model...
	-[\u2713] TFLite model output names match reference model (logits)
	- Validating TFLite Model output <span class="hljs-string">&quot;logits&quot;</span>:
		-[\u2713] (1, 128, 30522) matches (1, 128, 30522)
		-[x] values not close enough, max diff: 5.817413330078125e-05 (atol: 1e-05)
The TensorFlow Lite <span class="hljs-built_in">export</span> succeeded with the warning: The maximum absolute difference between the output of the reference model and the TFLite exported model is not within the <span class="hljs-built_in">set</span> tolerance 1e-05:
- logits: max diff = 5.817413330078125e-05.
 The exported model was saved at: bert_tflite`}}),{c(){u=r("meta"),O=p(),T=r("h1"),w=r("a"),F=r("span"),W(_.$$.fragment),Me=p(),L=r("span"),de=a("TFLite\uB85C \uB0B4\uBCF4\uB0B4\uAE30"),g=p(),h=r("p"),G=r("a"),ue=a("TensorFlow Lite"),Te=a(`\uB294 \uC790\uC6D0\uC774 \uC81C\uD55C\uB41C \uD734\uB300\uD3F0, \uC784\uBCA0\uB514\uB4DC \uC2DC\uC2A4\uD15C, \uC0AC\uBB3C\uC778\uD130\uB137(IoT) \uAE30\uAE30\uC5D0\uC11C
\uAE30\uACC4\uD559\uC2B5 \uBAA8\uB378\uC744 \uBC30\uD3EC\uD558\uAE30 \uC704\uD55C \uACBD\uB7C9 \uD504\uB808\uC784\uC6CC\uD06C\uC785\uB2C8\uB2E4.
TFLite\uB294 \uC5F0\uC0B0 \uB2A5\uB825, \uBA54\uBAA8\uB9AC, \uC804\uB825 \uC18C\uBE44\uAC00 \uC81C\uD55C\uB41C \uAE30\uAE30\uC5D0\uC11C \uBAA8\uB378\uC744 \uD6A8\uC728\uC801\uC73C\uB85C \uCD5C\uC801\uD654\uD558\uACE0 \uC2E4\uD589\uD558\uAE30 \uC704\uD574
\uC124\uACC4\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
TensorFlow Lite \uBAA8\uB378\uC740 `),V=r("code"),he=a(".tflite"),we=a(" \uD30C\uC77C \uD655\uC7A5\uC790\uB85C \uC2DD\uBCC4\uB418\uB294 \uD2B9\uC218\uD558\uACE0 \uD6A8\uC728\uC801\uC778 \uD734\uB300\uC6A9 \uD3EC\uB9F7\uC73C\uB85C \uD45C\uD604\uB429\uB2C8\uB2E4."),P=p(),d=r("p"),be=a("\u{1F917} Optimum\uC740 "),C=r("code"),Ue=a("exporters.tflite"),Je=a(` \uBAA8\uB4C8\uB85C \u{1F917} Transformers \uBAA8\uB378\uC744 TFLite\uB85C \uB0B4\uBCF4\uB0B4\uB294 \uAE30\uB2A5\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.
\uC9C0\uC6D0\uB418\uB294 \uBAA8\uB378 \uC544\uD0A4\uD14D\uCC98 \uBAA9\uB85D\uC740 `),v=r("a"),ye=a("\u{1F917} Optimum \uBB38\uC11C"),_e=a("\uB97C \uCC38\uACE0\uD558\uC138\uC694."),q=p(),E=r("p"),Ge=a("\uBAA8\uB378\uC744 TFLite\uB85C \uB0B4\uBCF4\uB0B4\uB824\uBA74, \uD544\uC694\uD55C \uC885\uC18D\uC131\uC744 \uC124\uCE58\uD558\uC138\uC694:"),K=p(),W(j.$$.fragment),ee=p(),b=r("p"),ve=a("\uBAA8\uB4E0 \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uC778\uC218\uB97C \uD655\uC778\uD558\uB824\uBA74, "),B=r("a"),je=a("\u{1F917} Optimum \uBB38\uC11C"),Be=a(`\uB97C \uCC38\uACE0\uD558\uAC70\uB098
\uD130\uBBF8\uB110\uC5D0\uC11C \uB3C4\uC6C0\uB9D0\uC744 \uC0B4\uD3B4\uBCF4\uC138\uC694:`),te=p(),W(Z.$$.fragment),le=p(),U=r("p"),Ze=a("\uC608\uB97C \uB4E4\uC5B4 \u{1F917} Hub\uC5D0\uC11C\uC758 "),S=r("code"),$e=a("bert-base-uncased"),xe=a(" \uBAA8\uB378 \uCCB4\uD06C\uD3EC\uC778\uD2B8\uB97C \uB0B4\uBCF4\uB0B4\uB824\uBA74, \uB2E4\uC74C \uBA85\uB839\uC744 \uC2E4\uD589\uD558\uC138\uC694:"),oe=p(),W($.$$.fragment),ae=p(),J=r("p"),Ee=a("\uB2E4\uC74C\uACFC \uAC19\uC774 \uC9C4\uD589 \uC0C1\uD669\uC744 \uB098\uD0C0\uB0B4\uB294 \uB85C\uADF8\uC640 \uACB0\uACFC\uBB3C\uC778 "),A=r("code"),Ie=a("model.tflite"),Fe=a("\uAC00 \uC800\uC7A5\uB41C \uC704\uCE58\uB97C \uBCF4\uC5EC\uC8FC\uB294 \uB85C\uADF8\uAC00 \uD45C\uC2DC\uB429\uB2C8\uB2E4:"),se=p(),W(x.$$.fragment),re=p(),c=r("p"),Le=a(`\uC704 \uC608\uC81C\uB294 \u{1F917} Hub\uC5D0\uC11C\uC758 \uCCB4\uD06C\uD3EC\uC778\uD2B8\uB97C \uB0B4\uBCF4\uB0B4\uB294 \uBC29\uBC95\uC744 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.
\uB85C\uCEEC \uBAA8\uB378\uC744 \uB0B4\uBCF4\uB0B8\uB2E4\uBA74, \uBA3C\uC800 \uBAA8\uB378 \uAC00\uC911\uCE58\uC640 \uD1A0\uD06C\uB098\uC774\uC800 \uD30C\uC77C\uC774 \uBAA8\uB450 \uAC19\uC740 \uB514\uB809\uD130\uB9AC( `),R=r("code"),Ve=a("local_path"),Ce=a(` )\uC5D0 \uC800\uC7A5\uB410\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694.
CLI\uB97C \uC0AC\uC6A9\uD560 \uB54C, \u{1F917} Hub\uC5D0\uC11C\uC758 \uCCB4\uD06C\uD3EC\uC778\uD2B8 \uC774\uB984 \uB300\uC2E0 `),X=r("code"),Se=a("model"),Ae=a(" \uC778\uC218\uC5D0 "),k=r("code"),Re=a("local_path"),Xe=a("\uB97C \uC804\uB2EC\uD558\uBA74 \uB429\uB2C8\uB2E4."),this.h()},l(e){const o=st('[data-svelte="svelte-1phssyn"]',document.head);u=i(o,"META",{name:!0,content:!0}),o.forEach(t),O=f(e),T=i(e,"H1",{class:!0});var ne=n(T);w=i(ne,"A",{id:!0,class:!0,href:!0});var Qe=n(w);F=i(Qe,"SPAN",{});var We=n(F);H(_.$$.fragment,We),We.forEach(t),Qe.forEach(t),Me=f(ne),L=i(ne,"SPAN",{});var He=n(L);de=s(He,"TFLite\uB85C \uB0B4\uBCF4\uB0B4\uAE30"),He.forEach(t),ne.forEach(t),g=f(e),h=i(e,"P",{});var Q=n(h);G=i(Q,"A",{href:!0,rel:!0});var Ne=n(G);ue=s(Ne,"TensorFlow Lite"),Ne.forEach(t),Te=s(Q,`\uB294 \uC790\uC6D0\uC774 \uC81C\uD55C\uB41C \uD734\uB300\uD3F0, \uC784\uBCA0\uB514\uB4DC \uC2DC\uC2A4\uD15C, \uC0AC\uBB3C\uC778\uD130\uB137(IoT) \uAE30\uAE30\uC5D0\uC11C
\uAE30\uACC4\uD559\uC2B5 \uBAA8\uB378\uC744 \uBC30\uD3EC\uD558\uAE30 \uC704\uD55C \uACBD\uB7C9 \uD504\uB808\uC784\uC6CC\uD06C\uC785\uB2C8\uB2E4.
TFLite\uB294 \uC5F0\uC0B0 \uB2A5\uB825, \uBA54\uBAA8\uB9AC, \uC804\uB825 \uC18C\uBE44\uAC00 \uC81C\uD55C\uB41C \uAE30\uAE30\uC5D0\uC11C \uBAA8\uB378\uC744 \uD6A8\uC728\uC801\uC73C\uB85C \uCD5C\uC801\uD654\uD558\uACE0 \uC2E4\uD589\uD558\uAE30 \uC704\uD574
\uC124\uACC4\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
TensorFlow Lite \uBAA8\uB378\uC740 `),V=i(Q,"CODE",{});var Ye=n(V);he=s(Ye,".tflite"),Ye.forEach(t),we=s(Q," \uD30C\uC77C \uD655\uC7A5\uC790\uB85C \uC2DD\uBCC4\uB418\uB294 \uD2B9\uC218\uD558\uACE0 \uD6A8\uC728\uC801\uC778 \uD734\uB300\uC6A9 \uD3EC\uB9F7\uC73C\uB85C \uD45C\uD604\uB429\uB2C8\uB2E4."),Q.forEach(t),P=f(e),d=i(e,"P",{});var I=n(d);be=s(I,"\u{1F917} Optimum\uC740 "),C=i(I,"CODE",{});var ze=n(C);Ue=s(ze,"exporters.tflite"),ze.forEach(t),Je=s(I,` \uBAA8\uB4C8\uB85C \u{1F917} Transformers \uBAA8\uB378\uC744 TFLite\uB85C \uB0B4\uBCF4\uB0B4\uB294 \uAE30\uB2A5\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.
\uC9C0\uC6D0\uB418\uB294 \uBAA8\uB378 \uC544\uD0A4\uD14D\uCC98 \uBAA9\uB85D\uC740 `),v=i(I,"A",{href:!0,rel:!0});var De=n(v);ye=s(De,"\u{1F917} Optimum \uBB38\uC11C"),De.forEach(t),_e=s(I,"\uB97C \uCC38\uACE0\uD558\uC138\uC694."),I.forEach(t),q=f(e),E=i(e,"P",{});var Oe=n(E);Ge=s(Oe,"\uBAA8\uB378\uC744 TFLite\uB85C \uB0B4\uBCF4\uB0B4\uB824\uBA74, \uD544\uC694\uD55C \uC885\uC18D\uC131\uC744 \uC124\uCE58\uD558\uC138\uC694:"),Oe.forEach(t),K=f(e),H(j.$$.fragment,e),ee=f(e),b=i(e,"P",{});var me=n(b);ve=s(me,"\uBAA8\uB4E0 \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uC778\uC218\uB97C \uD655\uC778\uD558\uB824\uBA74, "),B=i(me,"A",{href:!0,rel:!0});var ge=n(B);je=s(ge,"\u{1F917} Optimum \uBB38\uC11C"),ge.forEach(t),Be=s(me,`\uB97C \uCC38\uACE0\uD558\uAC70\uB098
\uD130\uBBF8\uB110\uC5D0\uC11C \uB3C4\uC6C0\uB9D0\uC744 \uC0B4\uD3B4\uBCF4\uC138\uC694:`),me.forEach(t),te=f(e),H(Z.$$.fragment,e),le=f(e),U=i(e,"P",{});var pe=n(U);Ze=s(pe,"\uC608\uB97C \uB4E4\uC5B4 \u{1F917} Hub\uC5D0\uC11C\uC758 "),S=i(pe,"CODE",{});var Pe=n(S);$e=s(Pe,"bert-base-uncased"),Pe.forEach(t),xe=s(pe," \uBAA8\uB378 \uCCB4\uD06C\uD3EC\uC778\uD2B8\uB97C \uB0B4\uBCF4\uB0B4\uB824\uBA74, \uB2E4\uC74C \uBA85\uB839\uC744 \uC2E4\uD589\uD558\uC138\uC694:"),pe.forEach(t),oe=f(e),H($.$$.fragment,e),ae=f(e),J=i(e,"P",{});var fe=n(J);Ee=s(fe,"\uB2E4\uC74C\uACFC \uAC19\uC774 \uC9C4\uD589 \uC0C1\uD669\uC744 \uB098\uD0C0\uB0B4\uB294 \uB85C\uADF8\uC640 \uACB0\uACFC\uBB3C\uC778 "),A=i(fe,"CODE",{});var qe=n(A);Ie=s(qe,"model.tflite"),qe.forEach(t),Fe=s(fe,"\uAC00 \uC800\uC7A5\uB41C \uC704\uCE58\uB97C \uBCF4\uC5EC\uC8FC\uB294 \uB85C\uADF8\uAC00 \uD45C\uC2DC\uB429\uB2C8\uB2E4:"),fe.forEach(t),se=f(e),H(x.$$.fragment,e),re=f(e),c=i(e,"P",{});var y=n(c);Le=s(y,`\uC704 \uC608\uC81C\uB294 \u{1F917} Hub\uC5D0\uC11C\uC758 \uCCB4\uD06C\uD3EC\uC778\uD2B8\uB97C \uB0B4\uBCF4\uB0B4\uB294 \uBC29\uBC95\uC744 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.
\uB85C\uCEEC \uBAA8\uB378\uC744 \uB0B4\uBCF4\uB0B8\uB2E4\uBA74, \uBA3C\uC800 \uBAA8\uB378 \uAC00\uC911\uCE58\uC640 \uD1A0\uD06C\uB098\uC774\uC800 \uD30C\uC77C\uC774 \uBAA8\uB450 \uAC19\uC740 \uB514\uB809\uD130\uB9AC( `),R=i(y,"CODE",{});var Ke=n(R);Ve=s(Ke,"local_path"),Ke.forEach(t),Ce=s(y,` )\uC5D0 \uC800\uC7A5\uB410\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694.
CLI\uB97C \uC0AC\uC6A9\uD560 \uB54C, \u{1F917} Hub\uC5D0\uC11C\uC758 \uCCB4\uD06C\uD3EC\uC778\uD2B8 \uC774\uB984 \uB300\uC2E0 `),X=i(y,"CODE",{});var et=n(X);Se=s(et,"model"),et.forEach(t),Ae=s(y," \uC778\uC218\uC5D0 "),k=i(y,"CODE",{});var tt=n(k);Re=s(tt,"local_path"),tt.forEach(t),Xe=s(y,"\uB97C \uC804\uB2EC\uD558\uBA74 \uB429\uB2C8\uB2E4."),y.forEach(t),this.h()},h(){M(u,"name","hf:doc:metadata"),M(u,"content",JSON.stringify(pt)),M(w,"id","export-to-tflite"),M(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"),M(w,"href","#export-to-tflite"),M(T,"class","relative group"),M(G,"href","https://www.tensorflow.org/lite/guide"),M(G,"rel","nofollow"),M(v,"href","https://huggingface.co/docs/optimum/exporters/tflite/overview"),M(v,"rel","nofollow"),M(B,"href","https://huggingface.co/docs/optimum/main/en/exporters/tflite/usage_guides/export_a_model"),M(B,"rel","nofollow")},m(e,o){l(document.head,u),m(e,O,o),m(e,T,o),l(T,w),l(w,F),N(_,F,null),l(T,Me),l(T,L),l(L,de),m(e,g,o),m(e,h,o),l(h,G),l(G,ue),l(h,Te),l(h,V),l(V,he),l(h,we),m(e,P,o),m(e,d,o),l(d,be),l(d,C),l(C,Ue),l(d,Je),l(d,v),l(v,ye),l(d,_e),m(e,q,o),m(e,E,o),l(E,Ge),m(e,K,o),N(j,e,o),m(e,ee,o),m(e,b,o),l(b,ve),l(b,B),l(B,je),l(b,Be),m(e,te,o),N(Z,e,o),m(e,le,o),m(e,U,o),l(U,Ze),l(U,S),l(S,$e),l(U,xe),m(e,oe,o),N($,e,o),m(e,ae,o),m(e,J,o),l(J,Ee),l(J,A),l(A,Ie),l(J,Fe),m(e,se,o),N(x,e,o),m(e,re,o),m(e,c,o),l(c,Le),l(c,R),l(R,Ve),l(c,Ce),l(c,X),l(X,Se),l(c,Ae),l(c,k),l(k,Re),l(c,Xe),ie=!0},p:rt,i(e){ie||(Y(_.$$.fragment,e),Y(j.$$.fragment,e),Y(Z.$$.fragment,e),Y($.$$.fragment,e),Y(x.$$.fragment,e),ie=!0)},o(e){z(_.$$.fragment,e),z(j.$$.fragment,e),z(Z.$$.fragment,e),z($.$$.fragment,e),z(x.$$.fragment,e),ie=!1},d(e){t(u),e&&t(O),e&&t(T),D(_),e&&t(g),e&&t(h),e&&t(P),e&&t(d),e&&t(q),e&&t(E),e&&t(K),D(j,e),e&&t(ee),e&&t(b),e&&t(te),D(Z,e),e&&t(le),e&&t(U),e&&t(oe),D($,e),e&&t(ae),e&&t(J),e&&t(se),D(x,e),e&&t(re),e&&t(c)}}}const pt={local:"export-to-tflite",title:"TFLite\uB85C \uB0B4\uBCF4\uB0B4\uAE30"};function ft(ke){return it(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ut extends lt{constructor(u){super();ot(this,u,ft,mt,at,{})}}export{ut as default,pt as metadata};
