Spaces:
Runtime error
Runtime error
Commit
·
1bc8269
1
Parent(s):
52e5a28
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,8 +15,7 @@ from langchain.vectorstores import FAISS
|
|
| 15 |
from streamlit_chat import message
|
| 16 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
|
| 17 |
import torch
|
| 18 |
-
|
| 19 |
-
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 20 |
st.set_page_config(layout="wide")
|
| 21 |
|
| 22 |
|
|
@@ -47,9 +46,9 @@ def data_ingestion():
|
|
| 47 |
splits = text_splitter.split_documents(documents)
|
| 48 |
|
| 49 |
# create embeddings of the chunked document
|
| 50 |
-
|
| 51 |
|
| 52 |
-
embeddings = OpenAIEmbeddings()
|
| 53 |
vectordb = FAISS.from_documents(splits, embeddings)
|
| 54 |
vectordb.save_local("faiss_index")
|
| 55 |
|
|
|
|
| 15 |
from streamlit_chat import message
|
| 16 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
|
| 17 |
import torch
|
| 18 |
+
|
|
|
|
| 19 |
st.set_page_config(layout="wide")
|
| 20 |
|
| 21 |
|
|
|
|
| 46 |
splits = text_splitter.split_documents(documents)
|
| 47 |
|
| 48 |
# create embeddings of the chunked document
|
| 49 |
+
embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
| 50 |
|
| 51 |
+
#embeddings = OpenAIEmbeddings()
|
| 52 |
vectordb = FAISS.from_documents(splits, embeddings)
|
| 53 |
vectordb.save_local("faiss_index")
|
| 54 |
|