fix: avoid circular dependency

This commit is contained in:
Basile Dura 2023-06-01 16:36:47 +02:00
parent 1bcb1f7908
commit 983b968a41
No known key found for this signature in database

View File

@ -1,13 +1,13 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from typing import Optional, Any, Iterable, Dict, Callable, Sequence, List from typing import Optional, Any, Iterable, Dict, Callable, Sequence, List
from spacy.language import Language
from .compat import Protocol, runtime_checkable from .compat import Protocol, runtime_checkable
from thinc.api import Optimizer, Model from thinc.api import Optimizer, Model
if TYPE_CHECKING: if TYPE_CHECKING:
from .training import Example from .training import Example
from spacy.language import Language
@runtime_checkable @runtime_checkable
@ -34,7 +34,7 @@ class InitializableComponent(Protocol):
def initialize( def initialize(
self, self,
get_examples: Callable[[], Iterable["Example"]], get_examples: Callable[[], Iterable["Example"]],
nlp: Language, nlp: "Language",
**kwargs: Any **kwargs: Any
): ):
... ...