mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-25 00:34:20 +03:00
import wandb failure - UX
This commit is contained in:
parent
e43d43db32
commit
2010219a7f
|
@ -487,6 +487,9 @@ class Errors:
|
||||||
|
|
||||||
# New errors added in v3.x
|
# 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 "
|
E885 = ("entity_linker.set_kb received an invalid 'kb_loader' argument: expected "
|
||||||
"a callable function, but got: {arg_type}")
|
"a callable function, but got: {arg_type}")
|
||||||
E886 = ("Can't replace {name} -> {tok2vec} listeners: path '{path}' not "
|
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")
|
@registry.loggers("spacy.WandbLogger.v1")
|
||||||
def wandb_logger(project_name: str, remove_config_values: List[str] = []):
|
def wandb_logger(project_name: str, remove_config_values: List[str] = []):
|
||||||
import wandb
|
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)
|
console = console_logger(progress_bar=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user