Skip to content

Commit

Permalink
fix: ndarray -> numpyarray
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Feb 4, 2025
1 parent 0ed9127 commit bd9c4bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fastembed/sparse/bm25.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(
self.avg_len = avg_len

model_description = self._get_model_description(model_name)
self.cache_dir = define_cache_dir(cache_dir)
self.cache_dir = str(define_cache_dir(cache_dir))

self._model_dir = self.download_model(
model_description,
Expand Down
2 changes: 1 addition & 1 deletion fastembed/sparse/bm42.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __init__(
self.device_id = None

self.model_description = self._get_model_description(model_name)
self.cache_dir = define_cache_dir(cache_dir)
self.cache_dir = str(define_cache_dir(cache_dir))

self._model_dir = self.download_model(
self.model_description,
Expand Down
8 changes: 4 additions & 4 deletions fastembed/sparse/sparse_embedding_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

import numpy as np

from fastembed.common.types import NdArray
from fastembed.common.types import NumpyArray
from fastembed.common.model_management import ModelManagement


@dataclass
class SparseEmbedding:
values: NdArray
indices: NdArray
values: NumpyArray
indices: NumpyArray

def as_object(self) -> dict[str, NdArray]:
def as_object(self) -> dict[str, NumpyArray]:
return {
"values": self.values,
"indices": self.indices,
Expand Down
2 changes: 1 addition & 1 deletion fastembed/sparse/splade_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init__(
self.device_id = None

self.model_description = self._get_model_description(model_name)
self.cache_dir = define_cache_dir(cache_dir)
self.cache_dir = str(define_cache_dir(cache_dir))

self._model_dir = self.download_model(
self.model_description,
Expand Down

0 comments on commit bd9c4bc

Please sign in to comment.