Download litgpt/__init__.py from BeepBoopBox/58add4a6: direct link, hf CLI and curl.
- Browser
- Download file 799 Bytes
-
https://huggingface.co/BeepBoopBox/58add4a6/resolve/main/litgpt/__init__.py
- Command line
-
hf download hf://BeepBoopBox/58add4a6/litgpt/__init__.py
-
curl -L -o __init__.py https://huggingface.co/BeepBoopBox/58add4a6/resolve/main/litgpt/__init__.py
799 Bytes
| # Copyright Lightning AI. Licensed under the Apache License 2.0, see LICENSE file. | |
| import logging | |
| import re | |
| from litgpt.model import GPT # needs to be imported before config | |
| from litgpt.config import Config | |
| from litgpt.tokenizer import Tokenizer | |
| # Suppress excessive warnings, see https://github.com/pytorch/pytorch/issues/111632 | |
| pattern = re.compile(".*Profiler function .* will be ignored") | |
| logging.getLogger("torch._dynamo.variables.torch").addFilter( | |
| lambda record: not pattern.search(record.getMessage()) | |
| ) | |
| # Avoid printing state-dict profiling output at the WARNING level when saving a checkpoint | |
| logging.getLogger("torch.distributed.fsdp._optim_utils").disabled = True | |
| logging.getLogger("torch.distributed.fsdp._debug_utils").disabled = True | |
| __all__ = ["GPT", "Config", "Tokenizer"] | |