Skip to content

Commit

Permalink
hf style imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wgifford committed Jul 16, 2024
1 parent c6f0fc6 commit 3812c18
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tsfm_public/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,53 @@
#

from .version import __version__, __version_tuple__

from pathlib import Path
from typing import TYPE_CHECKING


# Check the dependencies satisfy the minimal versions required.
from transformers.utils import _LazyModule, logging


logger = logging.get_logger(__name__) # pylint: disable=invalid-name

# Base objects, independent of any specific backend
_import_structure = {
"models": [],
"models.tinytimemixer": ["TINYTIMEMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TinyTimeMixerConfig"],
"toolkit": [],
}


# PyTorch-backed objects
_import_structure["models.tinytimemixer"].extend(
[
"TINYTIMEMIXER_PRETRAINED_MODEL_ARCHIVE_LIST",
"TinyTimeMixerPreTrainedModel",
"TinyTimeMixerModel",
"TinyTimeMixerForPrediction",
]
)

# Direct imports for type-checking
if TYPE_CHECKING:
from .models.tinytimemixer import (
TINYTIMEMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP,
TINYTIMEMIXER_PRETRAINED_MODEL_ARCHIVE_LIST,
TinyTimeMixerConfig,
TinyTimeMixerForPrediction,
TinyTimeMixerModel,
TinyTimeMixerPreTrainedModel,
)
else:
# Standard
import sys

sys.modules[__name__] = _LazyModule(
__name__,
globals()["__file__"],
_import_structure,
module_spec=__spec__,
extra_objects={"__version__": __version__},
)

0 comments on commit 3812c18

Please sign in to comment.