Skip to content

Commit

Permalink
refactor: remove redundant type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Jan 27, 2025
1 parent a930a28 commit b807540
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fastembed/image/onnx_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def list_supported_models(cls) -> list[dict[str, Any]]:
Lists the supported models.
Returns:
list[Dict[str, Any]]: A list of dictionaries containing the model information.
list[dict[str, Any]]: A list of dictionaries containing the model information.
"""
return supported_onnx_models

Expand Down
12 changes: 6 additions & 6 deletions fastembed/text/onnx_embedding.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict, Iterable, List, Optional, Sequence, Type, Union
from typing import Any, Iterable, Optional, Sequence, Type, Union

import numpy as np

Expand Down Expand Up @@ -185,12 +185,12 @@ class OnnxTextEmbedding(TextEmbeddingBase, OnnxTextModel[np.ndarray]):
"""Implementation of the Flag Embedding model."""

@classmethod
def list_supported_models(cls) -> List[Dict[str, Any]]:
def list_supported_models(cls) -> list[dict[str, Any]]:
"""
Lists the supported models.
Returns:
List[Dict[str, Any]]: A list of dictionaries containing the model information.
list[dict[str, Any]]: A list of dictionaries containing the model information.
"""
return supported_onnx_models

Expand All @@ -201,7 +201,7 @@ def __init__(
threads: Optional[int] = None,
providers: Optional[Sequence[OnnxProvider]] = None,
cuda: bool = False,
device_ids: Optional[List[int]] = None,
device_ids: Optional[list[int]] = None,
lazy_load: bool = False,
device_id: Optional[int] = None,
specific_model_path: Optional[str] = None,
Expand Down Expand Up @@ -295,8 +295,8 @@ def _get_worker_class(cls) -> Type["TextEmbeddingWorker"]:
return OnnxTextEmbeddingWorker

def _preprocess_onnx_input(
self, onnx_input: Dict[str, np.ndarray], **kwargs
) -> Dict[str, np.ndarray]:
self, onnx_input: dict[str, np.ndarray], **kwargs
) -> dict[str, np.ndarray]:
"""
Preprocess the onnx input.
"""
Expand Down

0 comments on commit b807540

Please sign in to comment.