Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
louisbrulenaudet committed Aug 11, 2024
1 parent 599c0ba commit e7e6159
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
project = 'RAGoon'
copyright = '2024, Louis Brulé Naudet'
author = 'Louis Brulé Naudet'
release = '0.0.11'
release = '0.0.12'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ragoon"
version = "0.0.11"
version = "0.0.12"
description = "RAGoon : High level library for batched embeddings generation, blazingly-fast web-based RAG and quantitized indexes processing ⚡"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
6 changes: 4 additions & 2 deletions src/ragoon/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __init__(
----------
model_configs : list of dict
The list of dictionaries with model configurations to use for generating embeddings.
token : str
The token for accessing Hugging Face API. Default is None.
Expand All @@ -163,12 +163,14 @@ def __init__(
The device used for embedding processing if torch.cuda.is_available() is not reliable.
Useful when using the Zero GPU on Hugging Face Space. Default is 'cuda'.
"""
if not token or not isinstance(token, str):
if token and not isinstance(token, str):
raise ValueError("Invalid token. Please provide a non-empty string.")

if not model_configs or not isinstance(model_configs, list):
raise ValueError(
"Invalid model configurations. Please provide a non-empty list of dictionaries."
)

if not isinstance(batch_size, int) or batch_size <= 0:
raise ValueError("Invalid batch size. Please provide a positive integer.")

Expand Down

0 comments on commit e7e6159

Please sign in to comment.