| # Utilities |
|
|
| ## Controlling the logging of `huggingface_hub` |
|
|
| The `huggingface_hub` package exposes a `logging` utility to control the logging level of the package itself. |
| You can import it as such: |
|
|
| ```py |
| from huggingface_hub import logging |
| ``` |
|
|
| Then, you may define the verbosity in order to update the amount of logs you |
|
|
| ```python |
| from huggingface_hub import logging |
|
|
| logging.set_verbosity_error() |
| logging.set_verbosity_warning() |
| logging.set_verbosity_info() |
| logging.set_verbosity_debug() |
|
|
| logging.set_verbosity(...) |
| ``` |
|
|
| The levels should be understood as follows: |
|
|
| - `error`: only show critical logs about usage which may result in an error or unexpected behavior. |
| - `warning`: show logs that aren |
| Additionally, important informative logs may be shown. |
| - `info`: show most logs, including some verbose logging regarding what is happening under the hood. |
| If something is behaving in an unexpected manner, we recommend switching the verbosity level to this in order |
| to get more information. |
| - `debug`: show all logs, including some internal logs which may be used to track exactly what |
| under the hood. |
|
|
| [[autodoc]] logging.get_verbosity |
| [[autodoc]] logging.set_verbosity |
| [[autodoc]] logging.set_verbosity_info |
| [[autodoc]] logging.set_verbosity_debug |
| [[autodoc]] logging.set_verbosity_warning |
| [[autodoc]] logging.set_verbosity_error |
| [[autodoc]] logging.disable_propagation |
| [[autodoc]] logging.enable_propagation |
|
|
| ### Repo-specific helper methods |
|
|
| The methods exposed below are relevant when modifying modules from the `huggingface_hub` library itself. |
| Using these shouldn |
|
|
| [[autodoc]] logging.get_logger |
|
|
| ## Custom errors |
|
|
| See below for all custom errors thrown by different methods across the package. |
|
|
| [[autodoc]] huggingface_hub.utils.RepositoryNotFoundError |
|
|
| [[autodoc]] huggingface_hub.utils.RevisionNotFoundError |
|
|
| [[autodoc]] huggingface_hub.utils.EntryNotFoundError |
|
|
| [[autodoc]] huggingface_hub.utils.LocalEntryNotFoundError |
|
|