Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
4fc32765
Verified
Commit
4fc32765
authored
2 years ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
fix lint
parent
3aba05ed
No related branches found
No related tags found
1 merge request
!59
Robust mlflow requests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dan/mlflow.py
+5
-3
5 additions, 3 deletions
dan/mlflow.py
with
5 additions
and
3 deletions
dan/mlflow.py
+
5
−
3
View file @
4fc32765
...
...
@@ -3,9 +3,8 @@ import os
from
contextlib
import
contextmanager
import
mlflow
from
mlflow.environment_variables
import
MLFLOW_HTTP_REQUEST_MAX_RETRIES
import
requests
from
mlflow.environment_variables
import
MLFLOW_HTTP_REQUEST_MAX_RETRIES
from
dan
import
logger
...
...
@@ -20,6 +19,7 @@ def make_mlflow_request(mlflow_method, *args, **kwargs):
logger
.
error
(
f
"
Call to `
{
str
(
mlflow_method
)
}
` failed with error:
{
str
(
e
)
}
"
)
raise
e
def
setup_environment
(
config
:
dict
):
"""
Get the necessary variables from the config file and put them in the environment variables
...
...
@@ -39,7 +39,9 @@ def setup_environment(config: dict):
# Check max retry setting
max_retries
=
MLFLOW_HTTP_REQUEST_MAX_RETRIES
.
get
()
if
max_retries
and
int
(
max_retries
)
<=
1
:
logger
.
warning
(
f
"
The maximum number of retries for MLflow HTTP requests is set to
{
max_retries
}
, which is low. Consider using a higher value.
"
)
logger
.
warning
(
f
"
The maximum number of retries for MLflow HTTP requests is set to
{
max_retries
}
, which is low. Consider using a higher value.
"
)
def
logging_metrics
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment