TensorBoard/Wandb/optuna/raytune integration improvements. (#7935)
Improved TensorBoard and Wandb integration, as well as optuna and ray/tune support, with minor modifications to trainer core code.
This commit is contained in:
@@ -20,6 +20,7 @@ from .file_utils import (
|
||||
_torch_available,
|
||||
_torch_tpu_available,
|
||||
)
|
||||
from .integrations import _has_optuna, _has_ray
|
||||
|
||||
|
||||
SMALL_MODEL_IDENTIFIER = "julien-c/bert-xsmall-dummy"
|
||||
@@ -233,6 +234,32 @@ def require_faiss(test_case):
|
||||
return test_case
|
||||
|
||||
|
||||
def require_optuna(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires optuna.
|
||||
|
||||
These tests are skipped when optuna isn't installed.
|
||||
|
||||
"""
|
||||
if not _has_optuna:
|
||||
return unittest.skip("test requires optuna")(test_case)
|
||||
else:
|
||||
return test_case
|
||||
|
||||
|
||||
def require_ray(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires Ray/tune.
|
||||
|
||||
These tests are skipped when Ray/tune isn't installed.
|
||||
|
||||
"""
|
||||
if not _has_ray:
|
||||
return unittest.skip("test requires Ray/tune")(test_case)
|
||||
else:
|
||||
return test_case
|
||||
|
||||
|
||||
def get_tests_dir(append_path=None):
|
||||
"""
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user