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