-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try formatting mlflow save folder after INIT
Make MLFlow experiment and run ID available on all ranks Fix path issue Format mlflow placeholders in remote filenames
- Loading branch information
1 parent
1165ad1
commit cc51073
Showing
7 changed files
with
123 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2022 MosaicML Composer authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
"""Utilities for string manipulation.""" | ||
|
||
|
||
def partial_format(s, *args, **kwargs): | ||
"""Format a string with a partial set of arguments. | ||
Since `str.format()` raises a `KeyError` if a format key is missing from the arguments, this | ||
function allows for a partial set of arguments to be provided. | ||
For example: | ||
>>> partial_format('{foo} {bar}', foo='Hello') | ||
'Hello {bar}' | ||
>>> partial_format('{foo} {bar}', foo='Hello', bar='World') | ||
'Hello World' | ||
""" | ||
result = s | ||
done = False | ||
while not done: | ||
try: | ||
result = s.format(*args, **kwargs) | ||
done = True | ||
except KeyError as e: | ||
key = e.args[0] | ||
kwargs[key] = '{' + key + '}' | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters