diff --git a/docs/source/conf.py b/docs/source/conf.py index 99b69b8..a96b06f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index db36ce6..eedb78f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/ragoon/embeddings.py b/src/ragoon/embeddings.py index a1eae12..c811dbb 100644 --- a/src/ragoon/embeddings.py +++ b/src/ragoon/embeddings.py @@ -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. @@ -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.")