Ingest
This module provides functionality for ingesting text files and creating a vector store for them using Llama embeddings and Faiss indexing.
Note
The vector store is created using Faiss indexing, and it is saved in a new folder in the 'index' directory. The name of the new folder is the same as the name of the folder containing the text documents.
create_store(chunks, folder_name='vector_store')
Create the vector store for given text chunks using model embeddings and Faiss indexing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
chunks |
List[str] : Required : A list of text chunks to create the vector store from. |
required | |
folder_name |
str : Optional : The name of the folder where the vector store will be saved. Default is "vector_store". |
'vector_store'
|
Source code in src/ingest.py
ingest(documentation_path=typer.Argument(Ellipsis, help='Folder containing the documents.'), model_path=typer.Argument(Ellipsis, help='Folder containing the model.'))
Ingest all the text files from documentation_path
and create a vector store using the Llama model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
documentation_path |
str
|
Path to the folder containing the text documents to be ingested. |
typer.Argument(Ellipsis, help='Folder containing the documents.')
|
model_path |
str
|
Path to the folder containing the Llama model. |
typer.Argument(Ellipsis, help='Folder containing the model.')
|
Raises:
Type | Description |
---|---|
Exception
|
If no documents are found inside the |
Notes
This function creates a new folder with the embedding index in the index
directory.