import{s as se,n as ne,o as ae}from"../chunks/scheduler.bdbef820.js";import{S as oe,i as me,g as a,s,r as G,A as pe,h as o,f as l,c as n,j as le,u as $,x as j,k as ie,y as Me,a as i,v as y,d as x,t as Z,w as g}from"../chunks/index.33f81d56.js";import{C as N}from"../chunks/CodeBlock.362b34a4.js";import{H as re,E as fe}from"../chunks/EditOnGithub.a9246e21.js";function Te(E){let m,v,B,I,p,V,M,P=`<a href="https://www.tensorflow.org/lite/guide" rel="nofollow">TensorFlow Lite</a>는 자원이 제한된 휴대폰, 임베디드 시스템, 사물인터넷(IoT) 기기에서
기계학습 모델을 배포하기 위한 경량 프레임워크입니다.
TFLite는 연산 능력, 메모리, 전력 소비가 제한된 기기에서 모델을 효율적으로 최적화하고 실행하기 위해
설계되었습니다.
TensorFlow Lite 모델은 <code>.tflite</code> 파일 확장자로 식별되는 특수하고 효율적인 휴대용 포맷으로 표현됩니다.`,_,r,D=`🤗 Optimum은 <code>exporters.tflite</code> 모듈로 🤗 Transformers 모델을 TFLite로 내보내는 기능을 제공합니다.
지원되는 모델 아키텍처 목록은 <a href="https://huggingface.co/docs/optimum/exporters/tflite/overview" rel="nofollow">🤗 Optimum 문서</a>를 참고하세요.`,H,f,q="모델을 TFLite로 내보내려면, 필요한 종속성을 설치하세요:",F,T,C,u,O=`모든 사용 가능한 인수를 확인하려면, <a href="https://huggingface.co/docs/optimum/main/en/exporters/tflite/usage_guides/export_a_model" rel="nofollow">🤗 Optimum 문서</a>를 참고하거나
터미널에서 도움말을 살펴보세요:`,S,d,W,c,K="예를 들어 🤗 Hub에서의 <code>google-bert/bert-base-uncased</code> 모델 체크포인트를 내보내려면, 다음 명령을 실행하세요:",R,w,k,b,ee="다음과 같이 진행 상황을 나타내는 로그와 결과물인 <code>model.tflite</code>가 저장된 위치를 보여주는 로그가 표시됩니다:",Q,U,A,J,te=`위 예제는 🤗 Hub에서의 체크포인트를 내보내는 방법을 보여줍니다.
로컬 모델을 내보낸다면, 먼저 모델 가중치와 토크나이저 파일이 모두 같은 디렉터리( <code>local_path</code> )에 저장됐는지 확인하세요.
CLI를 사용할 때, 🤗 Hub에서의 체크포인트 이름 대신 <code>model</code> 인수에 <code>local_path</code>를 전달하면 됩니다.`,X,h,Y,L,z;return p=new re({props:{title:"TFLite로 내보내기",local:"export-to-tflite",headingTag:"h1"}}),T=new N({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdGltdW0lNUJleHBvcnRlcnMtdGYlNUQ=",highlighted:"pip install optimum[exporters-tf]",wrap:!1}}),d=new N({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjB0ZmxpdGUlMjAtLWhlbHA=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> tflite --<span class="hljs-built_in">help</span>',wrap:!1}}),w=new N({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjB0ZmxpdGUlMjAtLW1vZGVsJTIwZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtdW5jYXNlZCUyMC0tc2VxdWVuY2VfbGVuZ3RoJTIwMTI4JTIwYmVydF90ZmxpdGUlMkY=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> tflite --model google-bert/bert-base-uncased --sequence_length 128 bert_tflite/',wrap:!1}}),U=new N({props:{code:"VmFsaWRhdGluZyUyMFRGTGl0ZSUyMG1vZGVsLi4uJTBBJTA5LSU1QiVFMiU5QyU5MyU1RCUyMFRGTGl0ZSUyMG1vZGVsJTIwb3V0cHV0JTIwbmFtZXMlMjBtYXRjaCUyMHJlZmVyZW5jZSUyMG1vZGVsJTIwKGxvZ2l0cyklMEElMDktJTIwVmFsaWRhdGluZyUyMFRGTGl0ZSUyME1vZGVsJTIwb3V0cHV0JTIwJTIybG9naXRzJTIyJTNBJTBBJTA5JTA5LSU1QiVFMiU5QyU5MyU1RCUyMCgxJTJDJTIwMTI4JTJDJTIwMzA1MjIpJTIwbWF0Y2hlcyUyMCgxJTJDJTIwMTI4JTJDJTIwMzA1MjIpJTBBJTA5JTA5LSU1QnglNUQlMjB2YWx1ZXMlMjBub3QlMjBjbG9zZSUyMGVub3VnaCUyQyUyMG1heCUyMGRpZmYlM0ElMjA1LjgxNzQxMzMzMDA3ODEyNWUtMDUlMjAoYXRvbCUzQSUyMDFlLTA1KSUwQVRoZSUyMFRlbnNvckZsb3clMjBMaXRlJTIwZXhwb3J0JTIwc3VjY2VlZGVkJTIwd2l0aCUyMHRoZSUyMHdhcm5pbmclM0ElMjBUaGUlMjBtYXhpbXVtJTIwYWJzb2x1dGUlMjBkaWZmZXJlbmNlJTIwYmV0d2VlbiUyMHRoZSUyMG91dHB1dCUyMG9mJTIwdGhlJTIwcmVmZXJlbmNlJTIwbW9kZWwlMjBhbmQlMjB0aGUlMjBURkxpdGUlMjBleHBvcnRlZCUyMG1vZGVsJTIwaXMlMjBub3QlMjB3aXRoaW4lMjB0aGUlMjBzZXQlMjB0b2xlcmFuY2UlMjAxZS0wNSUzQSUwQS0lMjBsb2dpdHMlM0ElMjBtYXglMjBkaWZmJTIwJTNEJTIwNS44MTc0MTMzMzAwNzgxMjVlLTA1LiUwQSUyMFRoZSUyMGV4cG9ydGVkJTIwbW9kZWwlMjB3YXMlMjBzYXZlZCUyMGF0JTNBJTIwYmVydF90ZmxpdGU=",highlighted:`Validating TFLite model...
	-[✓] TFLite model output names match reference model (logits)
	- Validating TFLite Model output <span class="hljs-string">&quot;logits&quot;</span>:
		-[✓] (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`,wrap:!1}}),h=new fe({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/tflite.md"}}),{c(){m=a("meta"),v=s(),B=a("p"),I=s(),G(p.$$.fragment),V=s(),M=a("p"),M.innerHTML=P,_=s(),r=a("p"),r.innerHTML=D,H=s(),f=a("p"),f.textContent=q,F=s(),G(T.$$.fragment),C=s(),u=a("p"),u.innerHTML=O,S=s(),G(d.$$.fragment),W=s(),c=a("p"),c.innerHTML=K,R=s(),G(w.$$.fragment),k=s(),b=a("p"),b.innerHTML=ee,Q=s(),G(U.$$.fragment),A=s(),J=a("p"),J.innerHTML=te,X=s(),G(h.$$.fragment),Y=s(),L=a("p"),this.h()},l(e){const t=pe("svelte-u9bgzb",document.head);m=o(t,"META",{name:!0,content:!0}),t.forEach(l),v=n(e),B=o(e,"P",{}),le(B).forEach(l),I=n(e),$(p.$$.fragment,e),V=n(e),M=o(e,"P",{"data-svelte-h":!0}),j(M)!=="svelte-rtedjj"&&(M.innerHTML=P),_=n(e),r=o(e,"P",{"data-svelte-h":!0}),j(r)!=="svelte-1el6uae"&&(r.innerHTML=D),H=n(e),f=o(e,"P",{"data-svelte-h":!0}),j(f)!=="svelte-lou0zf"&&(f.textContent=q),F=n(e),$(T.$$.fragment,e),C=n(e),u=o(e,"P",{"data-svelte-h":!0}),j(u)!=="svelte-yqbvuw"&&(u.innerHTML=O),S=n(e),$(d.$$.fragment,e),W=n(e),c=o(e,"P",{"data-svelte-h":!0}),j(c)!=="svelte-1g0t3kf"&&(c.innerHTML=K),R=n(e),$(w.$$.fragment,e),k=n(e),b=o(e,"P",{"data-svelte-h":!0}),j(b)!=="svelte-167y084"&&(b.innerHTML=ee),Q=n(e),$(U.$$.fragment,e),A=n(e),J=o(e,"P",{"data-svelte-h":!0}),j(J)!=="svelte-drx2q5"&&(J.innerHTML=te),X=n(e),$(h.$$.fragment,e),Y=n(e),L=o(e,"P",{}),le(L).forEach(l),this.h()},h(){ie(m,"name","hf:doc:metadata"),ie(m,"content",ue)},m(e,t){Me(document.head,m),i(e,v,t),i(e,B,t),i(e,I,t),y(p,e,t),i(e,V,t),i(e,M,t),i(e,_,t),i(e,r,t),i(e,H,t),i(e,f,t),i(e,F,t),y(T,e,t),i(e,C,t),i(e,u,t),i(e,S,t),y(d,e,t),i(e,W,t),i(e,c,t),i(e,R,t),y(w,e,t),i(e,k,t),i(e,b,t),i(e,Q,t),y(U,e,t),i(e,A,t),i(e,J,t),i(e,X,t),y(h,e,t),i(e,Y,t),i(e,L,t),z=!0},p:ne,i(e){z||(x(p.$$.fragment,e),x(T.$$.fragment,e),x(d.$$.fragment,e),x(w.$$.fragment,e),x(U.$$.fragment,e),x(h.$$.fragment,e),z=!0)},o(e){Z(p.$$.fragment,e),Z(T.$$.fragment,e),Z(d.$$.fragment,e),Z(w.$$.fragment,e),Z(U.$$.fragment,e),Z(h.$$.fragment,e),z=!1},d(e){e&&(l(v),l(B),l(I),l(V),l(M),l(_),l(r),l(H),l(f),l(F),l(C),l(u),l(S),l(W),l(c),l(R),l(k),l(b),l(Q),l(A),l(J),l(X),l(Y),l(L)),l(m),g(p,e),g(T,e),g(d,e),g(w,e),g(U,e),g(h,e)}}}const ue='{"title":"TFLite로 내보내기","local":"export-to-tflite","sections":[],"depth":1}';function de(E){return ae(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Je extends oe{constructor(m){super(),me(this,m,de,Te,se,{})}}export{Je as component};
