Fix issues for Mypy 0.931 and Pydantic 1.9.0#10384
Fix issues for Mypy 0.931 and Pydantic 1.9.0#10384richardpaulhudson wants to merge 6 commits intoexplosion:masterfrom
Conversation
| cast(Model[List[Ints2d], Ragged], list2ragged()), | ||
| with_array(HashEmbed(nO=width, nV=rows, column=0, seed=5)), # type: ignore | ||
| list2ragged(), | ||
| # TODO: the typing does not seem to make sense here |
There was a problem hiding this comment.
The typing did not seem to make sense here.
| set_dropout_rate(self.model, drop) | ||
| scores, backprop_scores = self.model.begin_update((docs, spans)) | ||
| loss, d_scores = self.get_loss(examples, (spans, scores)) | ||
| # TODO: the types do not seem to make sense here |
There was a problem hiding this comment.
The typing did not seem to make sense here.
| textcat = nlp.add_pipe("textcat") | ||
| textcat.initialize(lambda: train_examples) | ||
| assert isinstance(textcat, TextCategorizer) | ||
| # TODO: the typing doesn't seem to make sense here |
There was a problem hiding this comment.
The typing did not seem to make sense here.
|
Can I ask what the status is here? I might be able to help out pydantic 1.9 had some pretty damn good improvements (discriminated unions) that would be great to have available when using spacy as well. |
You can follow the progress on the related Thinc PR: explosion/thinc#599 which is work-in-progress. We're carefully reviewing quite some type annotations in Thinc and we want to do this thoroughly ;-) |
|
Fair play! Thanks for the update @svlandeg |
Co-authored-by: Zach Kanzler <theY4Kman@gmail.com>
These changes allow updating to the latest versions of Mypy (0.931) and Pydantic (1.9.0)
Description
This PR depends on explosion/thinc#599, so that the tests will not pass at the time of submitting.
Types of change
Mypy / Pydantic fixes
Checklist