Hi guys, i have a question regarding the input array/tensor size in LlamaIndex with vectorstore index/storage context where i'm getting the following
ValueError: shapes (0,512) and (384,) not aligned: 512 (dim 1) != 384 (dim 0)
with the following code
# We will be using local storage instead of a host qdrant server
client = qdrant_client.QdrantClient(path="./sfa_test",)
client.create_collection(collection_name="SFA",vectors_config=models.VectorParams(size=512,distance=models.Distance.COSINE))
vector_store = QdrantVectorStore(client=client,collection_name="SFA")
storage_context = StorageContext.from_defaults(vector_store=vector_store,)
from llama_index.core import ServiceContext,Document
docs = SimpleDirectoryReader("./data/").load_data()
# docs = docs [150:160]
docs = [Document(text="Hello world"), Document(text="Hello there")]
Settings.embed_model = resolve_embed_model("local:BAAI/bge-small-en-v1.5")
Settings.llm = Ollama(model="mistral")
embed = resolve_embed_model("local:BAAI/bge-small-en-v1.5")
llm = Ollama(model="mistral")
SERVICE_CONTEXT = ServiceContext.from_defaults(embed_model=embed,llm=llm)
pipeline = IngestionPipeline(
transformations=[
KeywordExtractor(llm=llm),
TokenTextSplitter(chunk_size=512,chunk_overlap=256)
],
vector_store=vector_store
)
nodes = pipeline.run(documents=docs,num_workers=16,)
index = VectorStoreIndex.from_vector_store(vector_store=vector_store,embed_model=embed)
query_engine = index.as_query_engine(llm=llm)
response = query_engine.query("Give me a random example")
print(response)
I've tested that the 512 in (0,512) seems to be from the size of models.VectorParams in the line
client.create_collection(collection_name="SFA",vectors_config=models.VectorParams(size=512,distance=models.Distance.COSINE))
but where is the 384 in (382,) coming from?