Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import tiktoken
|
| 3 |
-
import pickle
|
| 4 |
import faiss
|
| 5 |
|
| 6 |
import os
|
|
@@ -17,6 +16,7 @@ from langchain_openai import OpenAIEmbeddings
|
|
| 17 |
from langchain_openai import ChatOpenAI
|
| 18 |
|
| 19 |
# Load the FAISS index from the .pkl file
|
|
|
|
| 20 |
db = FAISS.load_local("faiss_index", embeddings,allow_dangerous_deserialization=True)
|
| 21 |
|
| 22 |
def get_response_from_query(db, query, k=3):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import tiktoken
|
|
|
|
| 3 |
import faiss
|
| 4 |
|
| 5 |
import os
|
|
|
|
| 16 |
from langchain_openai import ChatOpenAI
|
| 17 |
|
| 18 |
# Load the FAISS index from the .pkl file
|
| 19 |
+
embeddings = OpenAIEmbeddings()
|
| 20 |
db = FAISS.load_local("faiss_index", embeddings,allow_dangerous_deserialization=True)
|
| 21 |
|
| 22 |
def get_response_from_query(db, query, k=3):
|