Skip to content

Commit 7af63c5

Browse files
Update README with PyTorch Lightning example
Added information about PyTorch Lightning integration with LitLogger.
1 parent 7f9b95a commit 7af63c5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md renamed to williamfalcon

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ pip install litlogger
3838
### Hello world example
3939
Use LitLogger with any Python code (PyTorch, vLLM, LangChain, etc), and any usecase (training, inference, agents, etc).
4040

41+
```python
42+
from litlogger import LightningLogger
43+
44+
logger = LightningLogger()
45+
46+
logger.log_metadata({"my_metadata": "anything"})
47+
48+
for i in range(10):
49+
logger.log_metrics({"my_metric": i}, step=i)
50+
51+
# also log files
52+
# logger.log_file("/path/to/config.txt")
53+
logger.finalize()
54+
```
55+
56+
### Model training example
4157
```python
4258
import litlogger
4359

@@ -69,9 +85,13 @@ litlogger.log_file("/path/to/config.txt")
6985
litlogger.finalize()
7086
```
7187

88+
</details>
89+
7290
### PyTorch Lightning example
7391
PyTorch Lightning now comes with LitLogger natively built in. It's also built by the PyTorch Lightning team for guaranteed fast performance at multi-node GPU scale.
7492

93+
<details>
94+
<summary>Python code</summary>
7595
```python
7696
from lightning import Trainer
7797
from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel

0 commit comments

Comments
 (0)