[Python] FAISS.from_texts() occur ValueError: input not a numpy array

Discussão em 'Python' iniciado por Stack, Março 20, 2025.

  1. Stack

    Stack Membro Participativo

    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


    I check that pdf_chunks is numpy array, but it made error like that I don't know what the problem is and I don't know how to solve it.

    Continue reading...

Compartilhe esta Página