Skip to content

Commit

Permalink
allow older models
Browse files Browse the repository at this point in the history
  • Loading branch information
wgifford committed Oct 28, 2024
1 parent 2875dd4 commit c36662a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions services/inference/tsfminference/service_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ def load(cls, model_id: Union[str, Path]) -> Union[Optional["ServiceHandler"], O

tsfm_config_path = Path(model_id) if isinstance(model_id, str) else model_id

with open((tsfm_config_path / "tsfm_config.json").as_posix(), "r", encoding="utf-8") as reader:
text = reader.read()
config = json.loads(text)
try:
with open((tsfm_config_path / "tsfm_config.json").as_posix(), "r", encoding="utf-8") as reader:
text = reader.read()
config = json.loads(text)
except FileNotFoundError:
LOGGER.info("TSFM Config file not found.")
config = {}

try:
wrapper_class = get_service_model_class(config)
Expand Down Expand Up @@ -191,7 +195,7 @@ def load_hf_model(
model, e = load_model(
model_path,
config=config,
module_path=self.tsfm_config["module_path"],
module_path=self.tsfm_config.get("module_path", None),
)

if e is not None:
Expand Down

0 comments on commit c36662a

Please sign in to comment.