fix: InitializableComponent type hints

This commit is contained in:
Basile Dura 2023-06-01 09:42:14 +02:00
parent c936db2faf
commit 1bcb1f7908
No known key found for this signature in database

View File

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