Merge pull request #7223 from svlandeg/ux/wandb_import

import wandb failure - UX
This commit is contained in:
Ines Montani 2021-02-27 11:49:20 +11:00 committed by GitHub
commit fb0f095d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -487,6 +487,9 @@ class Errors:
# New errors added in v3.x
E880 = ("The 'wandb' library could not be found - did you install it? "
"Alternatively, specify the 'ConsoleLogger' in the 'training.logger' "
"config section, instead of the 'WandbLogger'.")
E885 = ("entity_linker.set_kb received an invalid 'kb_loader' argument: expected "
"a callable function, but got: {arg_type}")
E886 = ("Can't replace {name} -> {tok2vec} listeners: path '{path}' not "

View File

@ -103,7 +103,11 @@ def console_logger(progress_bar: bool = False):
@registry.loggers("spacy.WandbLogger.v1")
def wandb_logger(project_name: str, remove_config_values: List[str] = []):
try:
import wandb
from wandb import init, log, join # test that these are available
except ImportError:
raise ImportError(Errors.E880)
console = console_logger(progress_bar=False)