Skip to content

Need help in converting json to nodes and store in FAISS vector database #15715

Answered by dosubot bot
mraguth asked this question in Q&A
Discussion options

You must be logged in to vote

To resolve the "ValueError: embedding not set" error and store the FAISS vector database locally, you need to ensure that the embeddings are properly set before adding them to the FAISS index. Additionally, you can use the persist method to save the FAISS index to a specified path.

Here's an updated version of your code:

import json
import faiss
import numpy as np
from llama_index.core import Document, VectorStoreIndex
from llama_index.core.node_parser.text.semantic_splitter import SemanticSplitterNodeParser
from llama_index.embeddings.openai import OpenAIEmbedding  # or your chosen embedding model
from llama_index.legacy.vector_stores.faiss import FaissVectorStore
from llama_index.legacy.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Answer selected by mraguth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant