Improve debugging experience (#1512)

* Create CONTRIBUTING.md (#1472)

Creating contributing guidelines

* Update CONTRIBUTING.md

improved sentence

* Improve logging control in `unsloth_compile_transformers` by conditionally redirecting stdout based on UNSLOTH_DISABLE_LOGGER environment variable

---------

Co-authored-by: Michael Han <107991372+shimmyshimmer@users.noreply.github.com>
Co-authored-by: Nino Risteski <95188570+NinoRisteski@users.noreply.github.com>
This commit is contained in:
Edd 2025-01-07 10:04:27 +08:00 committed by GitHub
commit 9940583287

View file

@ -446,7 +446,9 @@ class FastVisionModel(FastBaseVisionModel):
if not was_disabled: enable_progress_bars()
with contextlib.redirect_stdout(open(os.devnull, "w")):
with contextlib.redirect_stdout(
open(os.devnull, "w") if os.environ.get("UNSLOTH_DISABLE_LOGGER", "0") != "1" else sys.stdout
):
patch_loss_functions(torch_compile = False)
model_types = unsloth_compile_transformers(
model_name = model_name,