import{s as ne,o as se,n as Q}from"../chunks/scheduler.6062bdaf.js";import{S as le,i as ie,g as d,s as p,r as _,A as ce,h as f,f as o,c as u,j as V,u as y,x as U,k as N,y as j,a as i,v as b,d as $,t as w,w as T}from"../chunks/index.4bca734e.js";import{T as ge}from"../chunks/Tip.b9ac1f03.js";import{D as pe}from"../chunks/Docstring.d7918b6d.js";import{C as oe}from"../chunks/CodeBlock.fa01571c.js";import{E as ae}from"../chunks/ExampleCodeBlock.d27cbfa4.js";import{H as re,E as ue}from"../chunks/EditOnGithub.74ab2baa.js";function me(H){let t,c="<code>HFSummaryWriter</code> is experimental. Its API is subject to change in the future without prior notice.";return{c(){t=d("p"),t.innerHTML=c},l(a){t=f(a,"P",{"data-svelte-h":!0}),U(t)!=="svelte-1jyxcko"&&(t.innerHTML=c)},m(a,l){i(a,t,l)},p:Q,d(a){a&&o(t)}}}function he(H){let t,c="Examples:",a,l,m;return l=new oe({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMEhGU3VtbWFyeVdyaXRlciUwQSUwQWxvZ2dlciUyMCUzRCUyMEhGU3VtbWFyeVdyaXRlcihyZXBvX2lkJTNEJTIydGVzdF9oZl9sb2dnZXIlMjIlMkMlMjBjb21taXRfZXZlcnklM0QxNSklMEFsb2dnZXIuYWRkX3NjYWxhciglMjJhJTIyJTJDJTIwMSklMEFsb2dnZXIuYWRkX3NjYWxhciglMjJiJTIyJTJDJTIwMiklMEElMEFsb2dnZXIuc2NoZWR1bGVyLnRyaWdnZXIoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> HFSummaryWriter

<span class="hljs-comment"># Logs are automatically pushed every 15 minutes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logger = HFSummaryWriter(repo_id=<span class="hljs-string">&quot;test_hf_logger&quot;</span>, commit_every=<span class="hljs-number">15</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logger.add_scalar(<span class="hljs-string">&quot;a&quot;</span>, <span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logger.add_scalar(<span class="hljs-string">&quot;b&quot;</span>, <span class="hljs-number">2</span>)
...

<span class="hljs-comment"># You can also trigger a push manually</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logger.scheduler.trigger()`,wrap:!1}}),{c(){t=d("p"),t.textContent=c,a=p(),_(l.$$.fragment)},l(n){t=f(n,"P",{"data-svelte-h":!0}),U(t)!=="svelte-kvfsh7"&&(t.textContent=c),a=u(n),y(l.$$.fragment,n)},m(n,h){i(n,t,h),i(n,a,h),b(l,n,h),m=!0},p:Q,i(n){m||($(l.$$.fragment,n),m=!0)},o(n){w(l.$$.fragment,n),m=!1},d(n){n&&(o(t),o(a)),T(l,n)}}}function de(H){let t,c;return t=new oe({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMEhGU3VtbWFyeVdyaXRlciUwQSUwQXdpdGglMjBIRlN1bW1hcnlXcml0ZXIocmVwb19pZCUzRCUyMnRlc3RfaGZfbG9nZ2VyJTIyKSUyMGFzJTIwbG9nZ2VyJTNBJTBBJTIwJTIwJTIwJTIwbG9nZ2VyLmFkZF9zY2FsYXIoJTIyYSUyMiUyQyUyMDEpJTBBJTIwJTIwJTIwJTIwbG9nZ2VyLmFkZF9zY2FsYXIoJTIyYiUyMiUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> HFSummaryWriter

<span class="hljs-comment"># Logs are automatically pushed every 5 minutes (default) + when exiting the context manager</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> HFSummaryWriter(repo_id=<span class="hljs-string">&quot;test_hf_logger&quot;</span>) <span class="hljs-keyword">as</span> logger:
<span class="hljs-meta">... </span>    logger.add_scalar(<span class="hljs-string">&quot;a&quot;</span>, <span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    logger.add_scalar(<span class="hljs-string">&quot;b&quot;</span>, <span class="hljs-number">2</span>)`,wrap:!1}}),{c(){_(t.$$.fragment)},l(a){y(t.$$.fragment,a)},m(a,l){b(t,a,l),c=!0},p:Q,i(a){c||($(t.$$.fragment,a),c=!0)},o(a){w(t.$$.fragment,a),c=!1},d(a){T(t,a)}}}function fe(H){let t,c,a,l,m,n,h,z=`TensorBoard는 기계학습 실험을 위한 시각화 도구입니다. 주로 손실 및 정확도와 같은 지표를 추적 및 시각화하고, 모델 그래프와
히스토그램을 보여주고, 이미지를 표시하는 등 다양한 기능을 제공합니다. 또한 TensorBoard는 Hugging Face Hub와 잘 통합되어 있습니다.
<code>tfevents</code> 같은 TensorBoard 추적을 Hub에 푸시하면 Hub는 이를 자동으로 감지하여 시각화 인스턴스를 시작합니다.
TensorBoard와 Hub의 통합에 대한 자세한 정보는 <a href="https://huggingface.co/docs/hub/tensorboard" rel="nofollow">가이드</a>를 확인하세요.`,Z,F,A=`이 통합을 위해, <code>huggingface_hub</code>는 로그를 Hub로 푸시하기 위한 사용자 정의 로거를 제공합니다.
이 로거는 추가적인 코드 없이 <a href="https://tensorboardx.readthedocs.io/en/latest/tensorboard.html" rel="nofollow">SummaryWriter</a>의 대체제로 사용될 수 있습니다.
추적은 계속해서 로컬에 저장되며 백그라운드 작업이 일정한 시간마다 Hub에 푸시하는 형태로 동작합니다.`,q,S,X,s,k,L,I,K="Wrapper around the tensorboard’s <code>SummaryWriter</code> to push training logs to the Hub.",B,J,O=`Data is logged locally and then pushed to the Hub asynchronously. Pushing data to the Hub is done in a separate
thread to avoid blocking the training script. In particular, if the upload fails for any reason (e.g. a connection
issue), the main script will not be interrupted. Data is automatically pushed to the Hub every <code>commit_every</code>
minutes (default to every 5 minutes).`,Y,v,P,x,R,W,E,M,D,C,G;return m=new re({props:{title:"TensorBoard 로거",local:"tensorboard-logger",headingTag:"h1"}}),S=new re({props:{title:"HFSummaryWriter",local:"huggingface_hub.HFSummaryWriter ][ huggingface_hub.HFSummaryWriter",headingTag:"h2"}}),k=new pe({props:{name:"class huggingface_hub.HFSummaryWriter",anchor:"huggingface_hub.HFSummaryWriter",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.HFSummaryWriter.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The id of the repo to which the logs will be pushed.`,name:"repo_id"},{anchor:"huggingface_hub.HFSummaryWriter.logdir",description:`<strong>logdir</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The directory where the logs will be written. If not specified, a local directory will be created by the
underlying <code>SummaryWriter</code> object.`,name:"logdir"},{anchor:"huggingface_hub.HFSummaryWriter.commit_every",description:`<strong>commit_every</strong> (<code>int</code> or <code>float</code>, <em>optional</em>) &#x2014;
The frequency (in minutes) at which the logs will be pushed to the Hub. Defaults to 5 minutes.`,name:"commit_every"},{anchor:"huggingface_hub.HFSummaryWriter.squash_history",description:`<strong>squash_history</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to squash the history of the repo after each commit. Defaults to <code>False</code>. Squashing commits is
useful to avoid degraded performances on the repo when it grows too large.`,name:"squash_history"},{anchor:"huggingface_hub.HFSummaryWriter.repo_type",description:`<strong>repo_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The type of the repo to which the logs will be pushed. Defaults to &#x201C;model&#x201D;.`,name:"repo_type"},{anchor:"huggingface_hub.HFSummaryWriter.repo_revision",description:`<strong>repo_revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The revision of the repo to which the logs will be pushed. Defaults to &#x201C;main&#x201D;.`,name:"repo_revision"},{anchor:"huggingface_hub.HFSummaryWriter.repo_private",description:`<strong>repo_private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to create a private repo or not. Defaults to False. This argument is ignored if the repo already
exists.`,name:"repo_private"},{anchor:"huggingface_hub.HFSummaryWriter.path_in_repo",description:`<strong>path_in_repo</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to the folder in the repo where the logs will be pushed. Defaults to &#x201C;tensorboard/&#x201C;.`,name:"path_in_repo"},{anchor:"huggingface_hub.HFSummaryWriter.repo_allow_patterns",description:`<strong>repo_allow_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
A list of patterns to include in the upload. Defaults to <code>&quot;*.tfevents.*&quot;</code>. Check out the
<a href="https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-folder" rel="nofollow">upload guide</a> for more details.`,name:"repo_allow_patterns"},{anchor:"huggingface_hub.HFSummaryWriter.repo_ignore_patterns",description:`<strong>repo_ignore_patterns</strong> (<code>List[str]</code> or <code>str</code>, <em>optional</em>) &#x2014;
A list of patterns to exclude in the upload. Check out the
<a href="https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-folder" rel="nofollow">upload guide</a> for more details.`,name:"repo_ignore_patterns"},{anchor:"huggingface_hub.HFSummaryWriter.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Authentication token. Will default to the stored token. See <a href="https://huggingface.co/settings/token" rel="nofollow">https://huggingface.co/settings/token</a> for more
details
kwargs &#x2014;
Additional keyword arguments passed to <code>SummaryWriter</code>.`,name:"token"}],source:"https://github.com/huggingface/huggingface_hub/blob/vr_2320/src/huggingface_hub/_tensorboard_logger.py#L46"}}),v=new ge({props:{warning:!0,$$slots:{default:[me]},$$scope:{ctx:H}}}),x=new ae({props:{anchor:"huggingface_hub.HFSummaryWriter.example",$$slots:{default:[he]},$$scope:{ctx:H}}}),W=new ae({props:{anchor:"huggingface_hub.HFSummaryWriter.example-2",$$slots:{default:[de]},$$scope:{ctx:H}}}),M=new ue({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/ko/package_reference/tensorboard.md"}}),{c(){t=d("meta"),c=p(),a=d("p"),l=p(),_(m.$$.fragment),n=p(),h=d("p"),h.innerHTML=z,Z=p(),F=d("p"),F.innerHTML=A,q=p(),_(S.$$.fragment),X=p(),s=d("div"),_(k.$$.fragment),L=p(),I=d("p"),I.innerHTML=K,B=p(),J=d("p"),J.innerHTML=O,Y=p(),_(v.$$.fragment),P=p(),_(x.$$.fragment),R=p(),_(W.$$.fragment),E=p(),_(M.$$.fragment),D=p(),C=d("p"),this.h()},l(e){const r=ce("svelte-u9bgzb",document.head);t=f(r,"META",{name:!0,content:!0}),r.forEach(o),c=u(e),a=f(e,"P",{}),V(a).forEach(o),l=u(e),y(m.$$.fragment,e),n=u(e),h=f(e,"P",{"data-svelte-h":!0}),U(h)!=="svelte-a0nj69"&&(h.innerHTML=z),Z=u(e),F=f(e,"P",{"data-svelte-h":!0}),U(F)!=="svelte-8u26do"&&(F.innerHTML=A),q=u(e),y(S.$$.fragment,e),X=u(e),s=f(e,"DIV",{class:!0});var g=V(s);y(k.$$.fragment,g),L=u(g),I=f(g,"P",{"data-svelte-h":!0}),U(I)!=="svelte-1gj9gtd"&&(I.innerHTML=K),B=u(g),J=f(g,"P",{"data-svelte-h":!0}),U(J)!=="svelte-37hlnu"&&(J.innerHTML=O),Y=u(g),y(v.$$.fragment,g),P=u(g),y(x.$$.fragment,g),R=u(g),y(W.$$.fragment,g),g.forEach(o),E=u(e),y(M.$$.fragment,e),D=u(e),C=f(e,"P",{}),V(C).forEach(o),this.h()},h(){N(t,"name","hf:doc:metadata"),N(t,"content",_e),N(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,r){j(document.head,t),i(e,c,r),i(e,a,r),i(e,l,r),b(m,e,r),i(e,n,r),i(e,h,r),i(e,Z,r),i(e,F,r),i(e,q,r),b(S,e,r),i(e,X,r),i(e,s,r),b(k,s,null),j(s,L),j(s,I),j(s,B),j(s,J),j(s,Y),b(v,s,null),j(s,P),b(x,s,null),j(s,R),b(W,s,null),i(e,E,r),b(M,e,r),i(e,D,r),i(e,C,r),G=!0},p(e,[r]){const g={};r&2&&(g.$$scope={dirty:r,ctx:e}),v.$set(g);const ee={};r&2&&(ee.$$scope={dirty:r,ctx:e}),x.$set(ee);const te={};r&2&&(te.$$scope={dirty:r,ctx:e}),W.$set(te)},i(e){G||($(m.$$.fragment,e),$(S.$$.fragment,e),$(k.$$.fragment,e),$(v.$$.fragment,e),$(x.$$.fragment,e),$(W.$$.fragment,e),$(M.$$.fragment,e),G=!0)},o(e){w(m.$$.fragment,e),w(S.$$.fragment,e),w(k.$$.fragment,e),w(v.$$.fragment,e),w(x.$$.fragment,e),w(W.$$.fragment,e),w(M.$$.fragment,e),G=!1},d(e){e&&(o(c),o(a),o(l),o(n),o(h),o(Z),o(F),o(q),o(X),o(s),o(E),o(D),o(C)),o(t),T(m,e),T(S,e),T(k),T(v),T(x),T(W),T(M,e)}}}const _e='{"title":"TensorBoard 로거","local":"tensorboard-logger","sections":[{"title":"HFSummaryWriter","local":"huggingface_hub.HFSummaryWriter ][ huggingface_hub.HFSummaryWriter","sections":[],"depth":2}],"depth":1}';function ye(H){return se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class We extends le{constructor(t){super(),ie(this,t,ye,fe,ne,{})}}export{We as component};
