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