Buckets:
| import"../chunks/DsnmJJEf.js";import{i as $,h as ee,C as re,H as R,a as i,D as o,E as oe,s as se}from"../chunks/BtE7mKSK.js";import{p as te,o as ie,s as e,f as M,a as T,b as de,c as s,d as E,n as r,r as t}from"../chunks/jDjavuwI.js";import{E as le}from"../chunks/SrSJA0zO.js";const ge='{"title":"Logging","local":"logging","sections":[{"title":"Base setters","local":"diffusers.utils.logging.set_verbosity_error","sections":[],"depth":2},{"title":"Other functions","local":"diffusers.utils.logging.get_verbosity","sections":[],"depth":2}],"depth":1}';var ne=E('<meta name="hf:doc:metadata"/>'),ae=E("<p>Enable explicit formatting for every 🤗 Diffusers’ logger. The explicit formatter is as follows:</p> <!>",1),ce=E(`<p></p> <!> <!> <p>🤗 Diffusers has a centralized logging system to easily manage the verbosity of the library. The default verbosity is set to <code>WARNING</code>.</p> <p>To change the verbosity level, use one of the direct setters. For instance, to change the verbosity to the <code>INFO</code> level.</p> <!> <p>You can also use the environment variable <code>DIFFUSERS_VERBOSITY</code> to override the default verbosity. You can set it | |
| to one of the following: <code>debug</code>, <code>info</code>, <code>warning</code>, <code>error</code>, <code>critical</code>. For example:</p> <!> <p>Additionally, some <code>warnings</code> can be disabled by setting the environment variable <code>DIFFUSERS_NO_ADVISORY_WARNINGS</code> to a true value, like <code>1</code>. This disables any warning logged by <code>logger.warning_advice</code>. For example:</p> <!> <p>Here is an example of how to use the same logger as the library in your own module or script:</p> <!> <p>All methods of the logging module are documented below. The main methods are <code>logging.get_verbosity</code> to get the current level of verbosity in the logger and <code>logging.set_verbosity</code> to set the verbosity to the level of your choice.</p> <p>In order from the least verbose to the most verbose:</p> <table><thead><tr><th align="right">Method</th><th align="right">Integer value</th><th align="right">Description</th></tr></thead><tbody><tr><td align="right"><code>diffusers.logging.CRITICAL</code> or <code>diffusers.logging.FATAL</code></td><td align="right">50</td><td align="right">only report the most critical errors</td></tr><tr><td align="right"><code>diffusers.logging.ERROR</code></td><td align="right">40</td><td align="right">only report errors</td></tr><tr><td align="right"><code>diffusers.logging.WARNING</code> or <code>diffusers.logging.WARN</code></td><td align="right">30</td><td align="right">only report errors and warnings (default)</td></tr><tr><td align="right"><code>diffusers.logging.INFO</code></td><td align="right">20</td><td align="right">only report errors, warnings, and basic information</td></tr><tr><td align="right"><code>diffusers.logging.DEBUG</code></td><td align="right">10</td><td align="right">report all information</td></tr></tbody></table> <p>By default, <code>tqdm</code> progress bars are displayed during model download. <code>logging.disable_progress_bar</code> and <code>logging.enable_progress_bar</code> are used to enable or disable this behavior.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Set the verbosity to the <code>ERROR</code> level.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Set the verbosity to the <code>WARNING</code> level.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Set the verbosity to the <code>INFO</code> level.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Set the verbosity to the <code>DEBUG</code> level.</p></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Return the current level for the 🤗 Diffusers’ root logger as an <code>int</code>.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Set the verbosity level for the 🤗 Diffusers’ root logger.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Return a logger with the specified name.</p> <p>This function is not supposed to be directly accessed unless you are writing a custom diffusers module.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Enable the default handler of the 🤗 Diffusers’ root logger.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Disable the default handler of the 🤗 Diffusers’ root logger.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <!> All handlers currently bound to the root logger are affected by this method.</div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Resets the formatting for 🤗 Diffusers’ loggers.</p> <p>All handlers currently bound to the root logger are affected by this method.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Enable tqdm progress bar.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Disable tqdm progress bar.</p></div> <!> <p></p>`,1);function he(G,D){te(D,!1),ie(()=>{new URLSearchParams(window.location.search).get("fw")}),$();var w=ce();ee("5wqssp",d=>{var y=ne();se(y,"content",ge),T(d,y)});var I=e(M(w),2);re(I,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var N=e(I,2);R(N,{title:"Logging",local:"logging",headingTag:"h1"});var x=e(N,6);i(x,{code:"aW1wb3J0JTIwZGlmZnVzZXJzJTBBJTBBZGlmZnVzZXJzLmxvZ2dpbmcuc2V0X3ZlcmJvc2l0eV9pbmZvKCk=",highlighted:`<span class="hljs-keyword">import</span> diffusers | |
| diffusers.logging.set_verbosity_info()`,lang:"python",wrap:!1});var U=e(x,4);i(U,{code:"RElGRlVTRVJTX1ZFUkJPU0lUWSUzRGVycm9yJTIwLiUyRm15cHJvZ3JhbS5weQ==",highlighted:"DIFFUSERS_VERBOSITY=error ./myprogram.py",lang:"bash",wrap:!1});var L=e(U,4);i(L,{code:"RElGRlVTRVJTX05PX0FEVklTT1JZX1dBUk5JTkdTJTNEMSUyMC4lMkZteXByb2dyYW0ucHk=",highlighted:"DIFFUSERS_NO_ADVISORY_WARNINGS=1 ./myprogram.py",lang:"bash",wrap:!1});var S=e(L,4);i(S,{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvZ2dpbmclMEElMEFsb2dnaW5nLnNldF92ZXJib3NpdHlfaW5mbygpJTBBbG9nZ2VyJTIwJTNEJTIwbG9nZ2luZy5nZXRfbG9nZ2VyKCUyMmRpZmZ1c2VycyUyMiklMEFsb2dnZXIuaW5mbyglMjJJTkZPJTIyKSUwQWxvZ2dlci53YXJuaW5nKCUyMldBUk4lMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> logging | |
| logging.set_verbosity_info() | |
| logger = logging.get_logger(<span class="hljs-string">"diffusers"</span>) | |
| logger.info(<span class="hljs-string">"INFO"</span>) | |
| logger.warning(<span class="hljs-string">"WARN"</span>)`,lang:"python",wrap:!1});var J=e(S,10);R(J,{title:"Base setters",local:"diffusers.utils.logging.set_verbosity_error",headingTag:"h2"});var l=e(J,2),V=s(l);o(V,{name:"diffusers.utils.logging.set_verbosity_error",anchor:"diffusers.utils.logging.set_verbosity_error",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L201",parameters:[]}),r(2),t(l);var g=e(l,2),B=s(g);o(B,{name:"diffusers.utils.logging.set_verbosity_warning",anchor:"diffusers.utils.logging.set_verbosity_warning",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L191",parameters:[]}),r(2),t(g);var n=e(g,2),O=s(n);o(O,{name:"diffusers.utils.logging.set_verbosity_info",anchor:"diffusers.utils.logging.set_verbosity_info",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L186",parameters:[]}),r(2),t(n);var a=e(n,2),W=s(a);o(W,{name:"diffusers.utils.logging.set_verbosity_debug",anchor:"diffusers.utils.logging.set_verbosity_debug",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L196",parameters:[]}),r(2),t(a);var A=e(a,2);R(A,{title:"Other functions",local:"diffusers.utils.logging.get_verbosity",headingTag:"h2"});var c=e(A,2),k=s(c);o(k,{name:"diffusers.utils.logging.get_verbosity",anchor:"diffusers.utils.logging.get_verbosity",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L147",parameters:[],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Logging level integers which can be one of:</p> | |
| <ul> | |
| <li><code>50</code>: <code>diffusers.logging.CRITICAL</code> or <code>diffusers.logging.FATAL</code></li> | |
| <li><code>40</code>: <code>diffusers.logging.ERROR</code></li> | |
| <li><code>30</code>: <code>diffusers.logging.WARNING</code> or <code>diffusers.logging.WARN</code></li> | |
| <li><code>20</code>: <code>diffusers.logging.INFO</code></li> | |
| <li><code>10</code>: <code>diffusers.logging.DEBUG</code></li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>int</code></p> | |
| `}),r(2),t(c);var f=e(c,2),C=s(f);o(C,{name:"diffusers.utils.logging.set_verbosity",anchor:"diffusers.utils.logging.set_verbosity",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L167",parameters:[{name:"verbosity",val:": int"}],parametersDescription:[{anchor:"diffusers.utils.logging.set_verbosity.verbosity",description:`<strong>verbosity</strong> (<code>int</code>) — | |
| Logging level which can be one of:</p> | |
| <ul> | |
| <li><code>diffusers.logging.CRITICAL</code> or <code>diffusers.logging.FATAL</code></li> | |
| <li><code>diffusers.logging.ERROR</code></li> | |
| <li><code>diffusers.logging.WARNING</code> or <code>diffusers.logging.WARN</code></li> | |
| <li><code>diffusers.logging.INFO</code></li> | |
| <li><code>diffusers.logging.DEBUG</code></li> | |
| </ul>`,name:"verbosity"}]}),r(2),t(f);var u=e(f,2),X=s(u);o(X,{name:"diffusers.utils.get_logger",anchor:"diffusers.utils.get_logger",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L131",parameters:[{name:"name",val:": str | None = None"}]}),r(4),t(u);var p=e(u,2),j=s(p);o(j,{name:"diffusers.utils.logging.enable_default_handler",anchor:"diffusers.utils.logging.enable_default_handler",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L215",parameters:[]}),r(2),t(p);var b=e(p,2),q=s(b);o(q,{name:"diffusers.utils.logging.disable_default_handler",anchor:"diffusers.utils.logging.disable_default_handler",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L206",parameters:[]}),r(2),t(b);var h=e(b,2),F=s(h);o(F,{name:"diffusers.utils.logging.enable_explicit_format",anchor:"diffusers.utils.logging.enable_explicit_format",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L261",parameters:[]});var z=e(F,2);le(z,{anchor:"diffusers.utils.logging.enable_explicit_format.example",children:(d,y)=>{var Z=ae(),Q=e(M(Z),2);i(Q,{code:"JTVCTEVWRUxOQU1FJTdDRklMRU5BTUUlN0NMSU5FJTIwTlVNQkVSJTVEJTIwVElNRSUyMCUzRSUzRSUyME1FU1NBR0U=",highlighted:'[LEVELNAME|FILENAME|LINE <span class="hljs-built_in">NUMBER</span>] <span class="hljs-built_in">TIME</span> >> MESSAGE',lang:"",wrap:!1}),T(d,Z)},$$slots:{default:!0}}),r(),t(h);var v=e(h,2),Y=s(v);o(Y,{name:"diffusers.utils.logging.reset_format",anchor:"diffusers.utils.logging.reset_format",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L276",parameters:[]}),r(4),t(v);var m=e(v,2),P=s(m);o(P,{name:"diffusers.utils.logging.enable_progress_bar",anchor:"diffusers.utils.logging.enable_progress_bar",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L352",parameters:[]}),r(2),t(m);var _=e(m,2),H=s(_);o(H,{name:"diffusers.utils.logging.disable_progress_bar",anchor:"diffusers.utils.logging.disable_progress_bar",source:"https://github.com/huggingface/diffusers/blob/vr_14230/src/diffusers/utils/logging.py#L358",parameters:[]}),r(2),t(_);var K=e(_,2);oe(K,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/logging.md"}),r(2),T(G,w),de()}export{he as component}; | |
Xet Storage Details
- Size:
- 12.5 kB
- Xet hash:
- ff117dedc3c1cd14a0413cf4a5da87721b62151a666446329faced70261425fe
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.