From 998b7d945eeb6fa4c1d480df73eff639c1f75d4d Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 1 Aug 2023 14:48:48 +0200 Subject: [PATCH] Fix type and lint bpemb example --- website/docs/usage/embeddings-transformers.mdx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/website/docs/usage/embeddings-transformers.mdx b/website/docs/usage/embeddings-transformers.mdx index 3d4590b1b..2bd2856b6 100644 --- a/website/docs/usage/embeddings-transformers.mdx +++ b/website/docs/usage/embeddings-transformers.mdx @@ -644,23 +644,26 @@ As an example, the following `BPEmbVectors` class implements support for ```python # requires: pip install bpemb -from typing import cast, Callable, Optional -from pathlib import Path import warnings +from pathlib import Path +from typing import Callable, Optional, cast + from bpemb import BPEmb -from spacy.util import registry -from spacy.vectors import BaseVectors -from spacy.vocab import Vocab from thinc.api import Ops, get_current_ops from thinc.backends import get_array_ops from thinc.types import Floats2d +from spacy.strings import StringStore +from spacy.util import registry +from spacy.vectors import BaseVectors +from spacy.vocab import Vocab + class BPEmbVectors(BaseVectors): def __init__( self, *, - strings: Optional[str] = None, + strings: Optional[StringStore] = None, lang: Optional[str] = None, vs: Optional[int] = None, dim: Optional[int] = None,