Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Fix --standardize not working #588

Merged
merged 3 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion mlem/api/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ def serve(
None
"""
model = get_model_meta(model, load_value=True)

server_obj = ensure_mlem_object(Server, server, **server_kwargs)
telemetry.log_param("server_type", server_obj.type)
log_meta_params(model)
Expand Down
14 changes: 1 addition & 13 deletions mlem/cli/serve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Optional

from typer import Option, Typer
from typer import Typer

from mlem.cli.main import (
app,
Expand Down Expand Up @@ -33,22 +33,13 @@
)
app.add_typer(serve)

# Include "--standartize" for historical compatability
option_standardize = Option(
True,
"--standardize/--no-standardize",
"--standartize/--no-standartize",
help="Whether to conform model interface to standard ('predict' method with single arg 'data')",
)


@mlem_group_callback(serve, required=["model", "load"])
def serve_load(
model: str = make_not_required(option_model),
project: Optional[str] = option_project,
rev: Optional[str] = option_rev,
load: Optional[str] = option_load("server"),
standardize: bool = option_standardize,
):
from mlem.api.commands import serve

Expand All @@ -62,7 +53,6 @@ def serve_load(
conf=None,
file_conf=None,
),
standardize=standardize,
)


Expand All @@ -84,7 +74,6 @@ def serve_command(
project: Optional[str] = option_project,
rev: Optional[str] = option_rev,
file_conf: List[str] = option_file_conf("server"),
standardize: bool = option_standardize,
**__kwargs__
):
from mlem.api.commands import serve
Expand All @@ -101,5 +90,4 @@ def serve_command(
file_conf=file_conf,
**__kwargs__
),
standardize=standardize,
)
2 changes: 1 addition & 1 deletion mlem/runtime/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class _ServerOptions(BaseModel):
response_serializer: Optional[Serializer] = None
"""Serializer to use for all responses"""

standardize: bool = True
standardize: bool = False
"""Use standard model interface"""
methods: Optional[ServerMethods] = None
"""Optional augmented interface"""
Expand Down