Skip to content

Commit

Permalink
Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Gonzalez-Martin committed Apr 8, 2021
1 parent 02fdc71 commit 2a02666
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tempo/mlserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from .serve.base import BaseModel
from .serve.loader import load
from .serve.utils import PredictMethodAttr
from .serve.metadata import ModelFramework
from .serve.utils import PredictMethodAttr


def _is_class(model: BaseModel) -> bool:
Expand Down
18 changes: 4 additions & 14 deletions tempo/serve/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
import yaml

from tempo.conf import settings
from tempo.serve.constants import (
DefaultModelFilename,
DefaultRemoteFilename,
MLServerEnvDeps,
)
from tempo.serve.constants import DefaultModelFilename, DefaultRemoteFilename, MLServerEnvDeps
from tempo.utils import logger


Expand Down Expand Up @@ -61,9 +57,7 @@ def _get_env(conda_env_file_path: str = None, env_name: str = None) -> dict:
return env


def save_environment(
conda_pack_file_path: str, conda_env_file_path: str = None, env_name: str = None
):
def save_environment(conda_pack_file_path: str, conda_env_file_path: str = None, env_name: str = None):
if env_name:
_pack_environment(env_name, conda_pack_file_path)
else:
Expand Down Expand Up @@ -93,9 +87,7 @@ def _has_required_deps(env: dict) -> bool:
for dep in MLServerEnvDeps:
parts = re.split(r"==|>=|<=|~=|!=|>|<|==:", dep)
module = parts[0]
r = re.compile(
fr"{module}$|({module}((==|>=|<=|~=|!=|>|<|==:)[0-9]+\.[0-9]+.[0-9]+))"
)
r = re.compile(fr"{module}$|({module}((==|>=|<=|~=|!=|>|<|==:)[0-9]+\.[0-9]+.[0-9]+))")
newlist = list(filter(r.match, pip_deps["pip"]))
if len(newlist) == 0:
return False
Expand All @@ -116,9 +108,7 @@ def _add_required_deps(env: dict) -> dict:
for dep in MLServerEnvDeps:
parts = re.split(r"==|>=|<=|~=|!=|>|<|==:", dep)
module = parts[0]
r = re.compile(
fr"{module}$|({module}((==|>=|<=|~=|!=|>|<|==:)[0-9]+\.[0-9]+.[0-9]+))"
)
r = re.compile(fr"{module}$|({module}((==|>=|<=|~=|!=|>|<|==:)[0-9]+\.[0-9]+.[0-9]+))")
newlist = list(filter(r.match, pip_deps["pip"]))
if len(newlist) == 0:
pip_deps["pip"].extend(MLServerEnvDeps)
Expand Down

0 comments on commit 2a02666

Please sign in to comment.