Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
e644b600
Unverified
Commit
e644b600
authored
Mar 30, 2024
by
Alexander Jipa
Committed by
GitHub
Mar 30, 2024
Browse files
fix: get mlflow version from mlflow-skinny (#29918)
Co-authored-by:
Alexander Jipa
<
azzhipa@amazon.com
>
parent
156d30da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/transformers/integrations/integration_utils.py
src/transformers/integrations/integration_utils.py
+8
-1
No files found.
src/transformers/integrations/integration_utils.py
View file @
e644b600
...
@@ -131,6 +131,13 @@ def is_mlflow_available():
...
@@ -131,6 +131,13 @@ def is_mlflow_available():
return
importlib
.
util
.
find_spec
(
"mlflow"
)
is
not
None
return
importlib
.
util
.
find_spec
(
"mlflow"
)
is
not
None
def
get_mlflow_version
():
try
:
return
importlib
.
metadata
.
version
(
"mlflow"
)
except
importlib
.
metadata
.
PackageNotFoundError
:
return
importlib
.
metadata
.
version
(
"mlflow-skinny"
)
def
is_dagshub_available
():
def
is_dagshub_available
():
return
None
not
in
[
importlib
.
util
.
find_spec
(
"dagshub"
),
importlib
.
util
.
find_spec
(
"mlflow"
)]
return
None
not
in
[
importlib
.
util
.
find_spec
(
"dagshub"
),
importlib
.
util
.
find_spec
(
"mlflow"
)]
...
@@ -1002,7 +1009,7 @@ class MLflowCallback(TrainerCallback):
...
@@ -1002,7 +1009,7 @@ class MLflowCallback(TrainerCallback):
# "synchronous" flag is only available with mlflow version >= 2.8.0
# "synchronous" flag is only available with mlflow version >= 2.8.0
# https://github.com/mlflow/mlflow/pull/9705
# https://github.com/mlflow/mlflow/pull/9705
# https://github.com/mlflow/mlflow/releases/tag/v2.8.0
# https://github.com/mlflow/mlflow/releases/tag/v2.8.0
if
packaging
.
version
.
parse
(
importlib
.
metadata
.
version
(
"mlflow"
))
>=
packaging
.
version
.
parse
(
"2.8.0"
):
if
packaging
.
version
.
parse
(
get_mlflow_version
(
))
>=
packaging
.
version
.
parse
(
"2.8.0"
):
self
.
_async_log
=
True
self
.
_async_log
=
True
logger
.
debug
(
logger
.
debug
(
f
"MLflow experiment_name=
{
self
.
_experiment_name
}
, run_name=
{
args
.
run_name
}
, nested=
{
self
.
_nested_run
}
,"
f
"MLflow experiment_name=
{
self
.
_experiment_name
}
, run_name=
{
args
.
run_name
}
, nested=
{
self
.
_nested_run
}
,"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment