Spaces:
Build error
Build error
Update app.py
Browse files72 unmodified lines737475767778768077787980818272 unmodified lines embeddings = model(**tokens).last_hidden_state.mean(dim=1).squeeze().numpy() return embeddings
# Create a function that directly returns embeddings embedding_function = lambda x: embed(x)
# Create a FAISS vector store vector_store = FAISS.from_texts(texts=sentences, embedding=embedding_function) vector_store = FAISS.from_texts( texts=sentences, embedding=lambda x: embed(x) )
return vector_store, sentences
app.py+3-4