Skip to content

Commit

Permalink
chore: updated doc string, blob pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Jan 30, 2024
1 parent 0bd761f commit b81f1cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fastembed/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def iter_batch(iterable: Union[Iterable, Generator], size: int) -> Iterable:
yield b


def locate_model_file(model_dir: Path, file_names: list):
def locate_model_file(model_dir: Path, file_names: List[str]):
"""
Find model path for both TransformerJS style `onnx` subdirectory structure and direct model weights structure used by Optimum and Qdrant
"""
if not model_dir.is_dir():
raise ValueError(f"Provided model path '{model_dir}' is not a directory.")

Expand All @@ -44,7 +47,7 @@ def locate_model_file(model_dir: Path, file_names: list):
if path.is_file() and path.name == file_name:
return path

raise ValueError(f"Could not find model file in {model_dir}")
raise ValueError(f"Could not find either of {', '.join(file_names)} in {model_dir}")


def normalize(input_array, p=2, dim=1, eps=1e-12):
Expand Down

0 comments on commit b81f1cd

Please sign in to comment.