Skip to content
Snippets Groups Projects
Commit 2342783d authored by Gokhan OZBULAK's avatar Gokhan OZBULAK Committed by André Anjos
Browse files

Import modules when necessary #60.

parent 6c90cee3
No related branches found
No related tags found
1 merge request!31Experiment and model upload to GitLab via MLflow interface
......@@ -2,16 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
import configparser
import json
import os
import pathlib
import shutil
import tempfile
import click
import gitlab
import mlflow
from clapper.click import ResourceOption, verbosity_option
from clapper.logging import setup
......@@ -27,6 +19,8 @@ def _get_gitlab_config():
-------
Gitlab entry and credential.
"""
import gitlab
import configparser
cfg = pathlib.Path("~/.python-gitlab.cfg").expanduser()
if cfg.exists():
......@@ -56,6 +50,8 @@ def _create_temp_copy(source, target):
-------
Path to target file in temp folder.
"""
import shutil
import tempfile
temp_dir = pathlib.Path(tempfile.gettempdir())
target = temp_dir / target
......@@ -120,6 +116,9 @@ def upload(
**_, # ignored
) -> None: # numpydoc ignore=PR01
"""Upload results from an experiment folder."""
import os
import json
import mlflow
logger.info("Getting Gitlab credentials for accessing to MLFlow server...")
gitlab, config = _get_gitlab_config()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment