Skip to content
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
5 changes: 3 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@
import sys
import warnings

from nemo_automodel.cli.app import main

# Pydantic v2 emits UnsupportedFieldAttributeWarning for Field(repr=...) /
# Field(frozen=...) used inside 3.12-style `type` aliases in third-party libs.
# There is nothing actionable for us here, so silence them globally.
# Must run before any import that triggers pydantic schema generation.
try:
from pydantic.warnings import UnsupportedFieldAttributeWarning

warnings.filterwarnings("ignore", category=UnsupportedFieldAttributeWarning)
except ImportError:
pass

from nemo_automodel.cli.app import main

logger = logging.getLogger(__name__)

if __name__ == "__main__":
Expand Down
12 changes: 12 additions & 0 deletions nemo_automodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
import importlib.abc
import importlib.machinery
import sys
import warnings
from types import ModuleType
from typing import Any

# Pydantic v2 emits UnsupportedFieldAttributeWarning for Field(repr=...) /
# Field(frozen=...) used inside 3.12-style `type` aliases in third-party libs.
# Suppress early so any later import that triggers pydantic schema generation
# (e.g. transformers, huggingface_hub) won't emit these warnings.
try:
from pydantic.warnings import UnsupportedFieldAttributeWarning

warnings.filterwarnings("ignore", category=UnsupportedFieldAttributeWarning)
except ImportError:
pass

from .package_info import __package_name__, __version__

# Keep the base package import lightweight.
Expand Down
11 changes: 11 additions & 0 deletions nemo_automodel/recipes/llm/train_ft.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@

from __future__ import annotations

import warnings

# Suppress pydantic v2 UnsupportedFieldAttributeWarning before heavy imports
# (transformers, huggingface_hub) trigger schema generation.
try:
from pydantic.warnings import UnsupportedFieldAttributeWarning

warnings.filterwarnings("ignore", category=UnsupportedFieldAttributeWarning)
except ImportError:
pass

import inspect
import logging
import pathlib
Expand Down
11 changes: 11 additions & 0 deletions nemo_automodel/recipes/vlm/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@

from __future__ import annotations

import warnings

# Suppress pydantic v2 UnsupportedFieldAttributeWarning before heavy imports
# (transformers, huggingface_hub) trigger schema generation.
try:
from pydantic.warnings import UnsupportedFieldAttributeWarning

warnings.filterwarnings("ignore", category=UnsupportedFieldAttributeWarning)
except ImportError:
pass

import logging
import pathlib
import time
Expand Down
Loading