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