Skip to content

Commit

Permalink
Merge pull request #165 from ibm-granite/path_fixes
Browse files Browse the repository at this point in the history
Simplify path handling
  • Loading branch information
ssiegel95 authored Oct 25, 2024
2 parents fb8238c + 9c056c8 commit b1a9c89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions services/inference/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ boilerplate:

# starts the tsfminference service (used mainly for test cases)
start_service_local: boilerplate
TSFM_MODEL_DIR=./mytest-tsfm python -m gunicorn \
TSFM_MODEL_DIR=./mytest-tsfm TSFM_ALLOW_LOAD_FROM_HF_HUB=1 \
python -m gunicorn \
-w 1 \
-k uvicorn.workers.UvicornWorker \
--bind 127.0.0.1:8000 \
Expand All @@ -36,13 +37,12 @@ stop_service_image:
$(CONTAINER_BUILDER) stop tsfmserver

test_local: clone_models boilerplate start_service_local
TSFM_ALLOW_LOAD_FROM_HF_HUB=1 TSFM_MODEL_DIR=./mytest-tsfm \
pytest tests
pytest tests
$(MAKE) stop_service_local
$(MAKE) delete_models

test_image: clone_models start_service_image
TSFM_MODEL_DIR=./ pytest tests
pytest tests
$(MAKE) stop_service_image
$(MAKE) delete_models

Expand Down
8 changes: 1 addition & 7 deletions services/inference/tests/test_inference.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Copyright contributors to the TSFM project
#
import os
import tempfile
from pathlib import Path
from typing import Any, Dict

import numpy as np
Expand Down Expand Up @@ -100,10 +97,7 @@ def test_zero_shot_forecast_inference(ts_data):
prediction_length = params["prediction_length"]
context_length = params["context_length"]
model_id = params["model_id"]
model_dir = (
Path(os.getenv("TSFM_MODEL_DIR")) if os.getenv("TSFM_MODEL_DIR") else Path(tempfile.gettempdir()) / "test-tsfm"
)
model_id_path: Path = (model_dir / model_id).as_posix()
model_id_path: str = model_id

id_columns = params["id_columns"]

Expand Down

0 comments on commit b1a9c89

Please sign in to comment.