mirror of
https://github.com/clearml/clearml-serving
synced 2025-01-30 18:36:53 +00:00
Fix ignore auto detected platform
when passing config.pbtxt with platform
entry
This commit is contained in:
parent
083635c803
commit
96b335e3c2
6
.gitignore
vendored
6
.gitignore
vendored
@ -13,6 +13,9 @@ build/
|
|||||||
|
|
||||||
# JetBrains IDE
|
# JetBrains IDE
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
tests/huggingface
|
||||||
|
|
||||||
# Generated by MacOS
|
# Generated by MacOS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@ -20,6 +23,9 @@ build/
|
|||||||
# Generated by Windows
|
# Generated by Windows
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Virtual environment
|
||||||
|
.venv
|
||||||
|
|
||||||
# Applications
|
# Applications
|
||||||
*.app
|
*.app
|
||||||
*.exe
|
*.exe
|
||||||
|
@ -6,15 +6,22 @@ from pathlib import Path
|
|||||||
|
|
||||||
from clearml.model import Framework
|
from clearml.model import Framework
|
||||||
|
|
||||||
from clearml_serving.serving.model_request_processor import ModelRequestProcessor, CanaryEP
|
|
||||||
from clearml_serving.serving.endpoints import ModelMonitoring, ModelEndpoint, EndpointMetricLogging
|
from clearml_serving.serving.endpoints import ModelMonitoring, ModelEndpoint, EndpointMetricLogging
|
||||||
|
from clearml_serving.serving.model_request_processor import ModelRequestProcessor, CanaryEP
|
||||||
|
from clearml_serving.version import __version__
|
||||||
|
|
||||||
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
|
from clearml.backend_api import Session
|
||||||
|
Session.add_client(__package__.partition(".")[0].replace("_", "-"), __version__) # noqa
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
verbosity = False
|
verbosity = False
|
||||||
answer_yes = False
|
answer_yes = False
|
||||||
|
|
||||||
|
|
||||||
def verify_session_version(request_processor):
|
def verify_session_version(request_processor):
|
||||||
from clearml_serving.version import __version__
|
|
||||||
current_v = float('.'.join(str(__version__).split(".")[:2]))
|
current_v = float('.'.join(str(__version__).split(".")[:2]))
|
||||||
stored_v = float('.'.join(str(request_processor.get_version()).split(".")[:2]))
|
stored_v = float('.'.join(str(request_processor.get_version()).split(".")[:2]))
|
||||||
if stored_v != current_v:
|
if stored_v != current_v:
|
||||||
|
@ -359,6 +359,22 @@ class TritonHelper(object):
|
|||||||
for i, s in enumerate(endpoint.output_name or []):
|
for i, s in enumerate(endpoint.output_name or []):
|
||||||
config_dict.put("output.{}.name".format(i), "\"{}\"".format(s))
|
config_dict.put("output.{}.name".format(i), "\"{}\"".format(s))
|
||||||
|
|
||||||
|
# check if we have platform in the auxiliary config pbtxt
|
||||||
|
if platform and final_config_pbtxt:
|
||||||
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
|
final_config_pbtxt_dict = ConfigFactory.parse_string(final_config_pbtxt)
|
||||||
|
# if we found it, null the requested platform and use the auxiliary config pbtxt platform `value`
|
||||||
|
if final_config_pbtxt_dict.get("platform", None):
|
||||||
|
print(
|
||||||
|
"WARNING: ignoring auto-detecetd `platform={}` "
|
||||||
|
"and using auxiliary pbtxt `platform={}`".format(
|
||||||
|
str(platform).lower(), final_config_pbtxt_dict.get("platform")))
|
||||||
|
platform = None
|
||||||
|
except Exception:
|
||||||
|
# we failed parsing the auxiliary pbtxt
|
||||||
|
pass
|
||||||
|
|
||||||
if platform and not config_dict.get("platform", None) and not config_dict.get("backend", None):
|
if platform and not config_dict.get("platform", None) and not config_dict.get("backend", None):
|
||||||
platform = str(platform).lower()
|
platform = str(platform).lower()
|
||||||
if platform.startswith("tensorflow") or platform.startswith("keras"):
|
if platform.startswith("tensorflow") or platform.startswith("keras"):
|
||||||
|
Loading…
Reference in New Issue
Block a user