Metadata-Version: 2.1
Name: wandc
Version: 0.0.2
Summary: A wandb and codecarbon wrapper that logs water and carbon consumption for your experiments on cloud.
Home-page: https://github.com/ielab/wandc
Author: Shengyao Zhuang
Author-email: s.zhuang@uq.edu.au
License: Apache 2.0
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# A WandB Water & Carbon Metering Plug-in

A [wandb](https://github.com/wandb/wandb/) and [codecarbon](https://github.com/mlco2/codecarbon) wrapper that logs on cloud the water and carbon consumption of your experiments.

## Installation

```bash
pip install wandc
```

## Usage
### Basic usage
```python
from wandc.emissions_logger import log_emissions

@log_emissions()
def your_function_to_track(project_name='your project name'):
  # your code
```
For other useful parameters see codecarbon documentation [here](https://mlco2.github.io/codecarbon/parameters.html).

### Tracking emissions of transformers trainer

```python
from wandc.emissions_logger import log_emissions
from transformers import Trainer

class WandcTrainer(Trainer):
    @log_emissions()
    def train(
        self,
        ...,
        **kwargs,
    ):
        super().train(..., **kwargs)

trainer = WandcTrainer(...)
trainer.train()
```
