mirror of https://github.com/explosion/spaCy.git
Merge pull request #7223 from svlandeg/ux/wandb_import
import wandb failure - UX
This commit is contained in:
commit
fb0f095d0a
|
@ -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 "
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue