Spaces:
Runtime error
Runtime error
Update models/langOpen.py
Browse files- models/langOpen.py +2 -2
models/langOpen.py
CHANGED
|
@@ -14,8 +14,6 @@ pages = loader.load_and_split()
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
| 17 |
-
embeddings = OpenAIEmbeddings()
|
| 18 |
-
|
| 19 |
prompt_template = """Answer the question using the given context to the best of your ability.
|
| 20 |
If you don't know, answer I don't know.
|
| 21 |
Context: {context}
|
|
@@ -32,6 +30,8 @@ class LangOpen:
|
|
| 32 |
|
| 33 |
def initialize_index(self, index_name):
|
| 34 |
path = f"./vectorStores/{index_name}"
|
|
|
|
|
|
|
| 35 |
if os.path.exists(path=path):
|
| 36 |
return FAISS.load_local(folder_path=path, embeddings=embeddings)
|
| 37 |
else:
|
|
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
|
|
|
|
|
|
| 17 |
prompt_template = """Answer the question using the given context to the best of your ability.
|
| 18 |
If you don't know, answer I don't know.
|
| 19 |
Context: {context}
|
|
|
|
| 30 |
|
| 31 |
def initialize_index(self, index_name):
|
| 32 |
path = f"./vectorStores/{index_name}"
|
| 33 |
+
embeddings = OpenAIEmbeddings()
|
| 34 |
+
|
| 35 |
if os.path.exists(path=path):
|
| 36 |
return FAISS.load_local(folder_path=path, embeddings=embeddings)
|
| 37 |
else:
|