Faiss.from_texts () ESSIGEN VALUEEREERROR: Eingabe nicht ein Numpy -ArrayPython

Python-Programme
Anonymous
 Faiss.from_texts () ESSIGEN VALUEEREERROR: Eingabe nicht ein Numpy -Array

Post by Anonymous »

Code: Select all

vec_multi = embedding.embed_documents(pdf_chunks)

import numpy as np
vec_np = np.array(vec_multi)

print(vec_np.shape)  # (문장 개수, 임베딩 차원)
print(vec_np.dtype)

(2119, 768)
float64

embedding_model_name = "jhgan/ko-sbert-nli"  # 임베딩 모델 선택
embedding = HuggingFaceEmbeddings(model_name=embedding_model_name)
---> pdf_vector_store = FAISS.from_texts(pdf_chunks, embedding=embedding)

ValueError: input not a numpy array
Ich überprüfe, dass PDF_Chunks Numpy Array ist, aber es machte einen solchen Fehler
Ich weiß nicht, was das Problem ist, und ich weiß nicht, wie ich es lösen soll.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post