Use default values for experiment name and uuid in PL callback
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+import uuid
from argparse import Namespace
from typing import Any, Dict, List, Optional, Union
@@ -156,8 +157,16 @@ class Callback(Logger):
@property
def name(self) -> str:
+ if self._experiment is not None and self._experiment.run_data.name is not None:
return self.experiment.run_data.name
+ if self._name:
+ return self._name
+ return "default"
@property
def version(self) -> str:
+ if self._experiment is not None and self._experiment.run_data.uuid is not None:
return self.experiment.run_data.uuid
+ if self._run_uuid:
+ return self._run_uuid
+ return uuid.uuid4().hex
