Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize logging configuration #229

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions components/caption_images/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
from transformers import BatchEncoding, BlipForConditionalGeneration, BlipProcessor

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/download_images/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
from resizer import Resizer

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/embedding_based_laion_retrieval/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
from clip_client import ClipClient, Modality

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/filter_comments/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from utils.text_extraction import get_comments_to_code_ratio

from fondant.component import DaskTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/filter_line_length/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import dask.dataframe as dd

from fondant.component import DaskTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/image_cropping/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
from PIL import Image

from fondant.component import DaskTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/image_embedding/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
from transformers import CLIPProcessor, CLIPVisionModelWithProjection

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/image_resolution_extraction/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import pandas as pd

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/image_resolution_filtering/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import dask.dataframe as dd

from fondant.component import DaskTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/load_from_hf_hub/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import dask.dataframe as dd

from fondant.component import LoadComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/pii_redaction/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from pii_redaction import redact_pii

from fondant.component import DaskTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/prompt_based_laion_retrieval/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from clip_client import ClipClient, Modality

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/segment_images/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from transformers import AutoModelForSemanticSegmentation, BatchFeature, SegformerImageProcessor

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions components/write_to_hf_hub/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from PIL import Image

from fondant.component import WriteComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
import pandas as pd

from fondant.component import LoadComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)

interior_styles = [
Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/controlnet-interior-design/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
Pipeline,
Client,
)
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)
# General configs
pipeline_name = "controlnet-pipeline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
from spacy.symbols import nsubj, VERB

from fondant.component import PandasTransformComponent
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/datacomp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

from fondant.compiler import DockerCompiler
from fondant.pipeline import ComponentOp, Pipeline, Client
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)

# Initialize pipeline and client
Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/finetune_stable_diffusion/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from pipeline_configs import PipelineConfigs

from fondant.pipeline import ComponentOp, Pipeline, Client
from fondant.logger import configure_logging

configure_logging()
logger = logging.getLogger(__name__)
# General configs
pipeline_name = "Test fondant pipeline"
Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/starcoder/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
from pipeline_configs import PipelineConfigs

from fondant.compiler import DockerCompiler
from fondant.logger import configure_logging
from fondant.pipeline import ComponentOp, Pipeline

configure_logging()
logger = logging.getLogger(__name__)


Expand Down
5 changes: 5 additions & 0 deletions fondant/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import logging

logging.basicConfig(
format="[%(asctime)s | %(name)s | %(levelname)s] %(message)s", level=logging.INFO
)
23 changes: 0 additions & 23 deletions fondant/logger.py

This file was deleted.

25 changes: 0 additions & 25 deletions tests/test_logger.py

This file was deleted.