Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pip requrements infer error handling #5176

Merged
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions mlflow/utils/environment.py
Expand Up @@ -175,7 +175,8 @@ def _is_iterable(x):


_INFER_PIP_REQUIREMENTS_FALLBACK_MESSAGE = (
"Encountered an unexpected error while inferring pip requirements (model URI: %s, flavor: %s)"
"Encountered an unexpected error while inferring pip requirements (model URI: %s, flavor: %s),"
" fall back to return %s. Set logging level to DEBUG to see the full traceback."
)


Expand All @@ -194,7 +195,9 @@ def infer_pip_requirements(model_uri, flavor, fallback=None):
return _infer_requirements(model_uri, flavor)
except Exception:
if fallback is not None:
_logger.exception(_INFER_PIP_REQUIREMENTS_FALLBACK_MESSAGE, model_uri, flavor)
_logger.warning(_INFER_PIP_REQUIREMENTS_FALLBACK_MESSAGE,
model_uri, flavor, fallback)
_logger.debug("", exc_info=True)
return fallback
raise

Expand Down