import{s as ce,n as de,o as fe}from"../chunks/scheduler.889ebb13.js";import{S as ue,i as Te,g as s,s as i,u as $,A as he,h as o,f as l,c as a,j as _,v as L,y as M,k as G,o as I,a as n,w as V,d as C,t as g,x as F}from"../chunks/index.8980e686.js";import{I as we}from"../chunks/IconCopyLink.357761cd.js";import{C as K}from"../chunks/CodeBlock.25fc3430.js";function Ue(te){let p,H,v,S,m,r,B,c,ee,x,le="TFLite로 내보내기",k,d,ne=`<a href="https://www.tensorflow.org/lite/guide" rel="nofollow">TensorFlow Lite</a>는 자원이 제한된 휴대폰, 임베디드 시스템, 사물인터넷(IoT) 기기에서
기계학습 모델을 배포하기 위한 경량 프레임워크입니다.
TFLite는 연산 능력, 메모리, 전력 소비가 제한된 기기에서 모델을 효율적으로 최적화하고 실행하기 위해
설계되었습니다.
TensorFlow Lite 모델은 <code>.tflite</code> 파일 확장자로 식별되는 특수하고 효율적인 휴대용 포맷으로 표현됩니다.`,R,f,ie=`🤗 Optimum은 <code>exporters.tflite</code> 모듈로 🤗 Transformers 모델을 TFLite로 내보내는 기능을 제공합니다.
지원되는 모델 아키텍처 목록은 <a href="https://huggingface.co/docs/optimum/exporters/tflite/overview" rel="nofollow">🤗 Optimum 문서</a>를 참고하세요.`,A,u,ae="모델을 TFLite로 내보내려면, 필요한 종속성을 설치하세요:",X,T,Q,h,se=`모든 사용 가능한 인수를 확인하려면, <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 c=new we({}),T=new K({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdGltdW0lNUJleHBvcnRlcnMtdGYlNUQ=",highlighted:"pip install optimum[exporters-tf]"}}),w=new K({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjB0ZmxpdGUlMjAtLWhlbHA=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> tflite --<span class="hljs-built_in">help</span>'}}),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/'}}),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`}}),{c(){p=s("meta"),H=i(),v=s("p"),S=i(),m=s("h1"),r=s("a"),B=s("span"),$(c.$$.fragment),ee=i(),x=s("span"),x.textContent=le,k=i(),d=s("p"),d.innerHTML=ne,R=i(),f=s("p"),f.innerHTML=ie,A=i(),u=s("p"),u.textContent=ae,X=i(),$(T.$$.fragment),Q=i(),h=s("p"),h.innerHTML=se,W=i(),$(w.$$.fragment),N=i(),U=s("p"),U.innerHTML=oe,z=i(),$(y.$$.fragment),Y=i(),b=s("p"),b.innerHTML=pe,E=i(),$(J.$$.fragment),P=i(),j=s("p"),j.innerHTML=me,D=i(),Z=s("p"),this.h()},l(e){const t=he("svelte-1phssyn",document.head);p=o(t,"META",{name:!0,content:!0}),t.forEach(l),H=a(e),v=o(e,"P",{}),_(v).forEach(l),S=a(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(c.$$.fragment,Me),Me.forEach(l),re.forEach(l),ee=a(O),x=o(O,"SPAN",{"data-svelte-h":!0}),M(x)!=="svelte-xy1kez"&&(x.textContent=le),O.forEach(l),k=a(e),d=o(e,"P",{"data-svelte-h":!0}),M(d)!=="svelte-rtedjj"&&(d.innerHTML=ne),R=a(e),f=o(e,"P",{"data-svelte-h":!0}),M(f)!=="svelte-1el6uae"&&(f.innerHTML=ie),A=a(e),u=o(e,"P",{"data-svelte-h":!0}),M(u)!=="svelte-lou0zf"&&(u.textContent=ae),X=a(e),L(T.$$.fragment,e),Q=a(e),h=o(e,"P",{"data-svelte-h":!0}),M(h)!=="svelte-yqbvuw"&&(h.innerHTML=se),W=a(e),L(w.$$.fragment,e),N=a(e),U=o(e,"P",{"data-svelte-h":!0}),M(U)!=="svelte-22k8ap"&&(U.innerHTML=oe),z=a(e),L(y.$$.fragment,e),Y=a(e),b=o(e,"P",{"data-svelte-h":!0}),M(b)!=="svelte-167y084"&&(b.innerHTML=pe),E=a(e),L(J.$$.fragment,e),P=a(e),j=o(e,"P",{"data-svelte-h":!0}),M(j)!=="svelte-drx2q5"&&(j.innerHTML=me),D=a(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),n(e,H,t),n(e,v,t),n(e,S,t),n(e,m,t),I(m,r),I(r,B),V(c,B,null),I(m,ee),I(m,x),n(e,k,t),n(e,d,t),n(e,R,t),n(e,f,t),n(e,A,t),n(e,u,t),n(e,X,t),V(T,e,t),n(e,Q,t),n(e,h,t),n(e,W,t),V(w,e,t),n(e,N,t),n(e,U,t),n(e,z,t),V(y,e,t),n(e,Y,t),n(e,b,t),n(e,E,t),V(J,e,t),n(e,P,t),n(e,j,t),n(e,D,t),n(e,Z,t),q=!0},p:de,i(e){q||(C(c.$$.fragment,e),C(T.$$.fragment,e),C(w.$$.fragment,e),C(y.$$.fragment,e),C(J.$$.fragment,e),q=!0)},o(e){g(c.$$.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(d),l(R),l(f),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(c),F(T,e),F(w,e),F(y,e),F(J,e)}}}const ye={local:"export-to-tflite",title:"TFLite로 내보내기"};function be(te){return fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ve extends ue{constructor(p){super(),Te(this,p,be,Ue,ce,{})}}export{ve as component};
