Spaces:
Runtime error
Runtime error
Commit
·
e56aa0d
1
Parent(s):
86f4a49
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,8 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
|
|
| 17 |
import torch
|
| 18 |
|
| 19 |
st.set_page_config(layout="wide")
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
def process_answer(instruction, qa_chain):
|
| 23 |
response = ''
|
|
@@ -46,6 +47,8 @@ def data_ingestion():
|
|
| 46 |
|
| 47 |
# create embeddings of the chunked document
|
| 48 |
#embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
|
|
|
|
|
|
| 49 |
embeddings = OpenAIEmbeddings()
|
| 50 |
vectordb = FAISS.from_documents(splits, embeddings)
|
| 51 |
vectordb.save_local("faiss_index")
|
|
|
|
| 17 |
import torch
|
| 18 |
|
| 19 |
st.set_page_config(layout="wide")
|
| 20 |
+
|
| 21 |
+
|
| 22 |
|
| 23 |
def process_answer(instruction, qa_chain):
|
| 24 |
response = ''
|
|
|
|
| 47 |
|
| 48 |
# create embeddings of the chunked document
|
| 49 |
#embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
| 50 |
+
load_dotenv()
|
| 51 |
+
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 52 |
embeddings = OpenAIEmbeddings()
|
| 53 |
vectordb = FAISS.from_documents(splits, embeddings)
|
| 54 |
vectordb.save_local("faiss_index")
|