Spaces:
Runtime error
Runtime error
Commit
·
a528bba
1
Parent(s):
f1cd23d
Update app.py
Browse files
app.py
CHANGED
@@ -286,7 +286,7 @@ def build_embeddings(file_name,file_ext):
|
|
286 |
global EMBEDIDNGS
|
287 |
EMBEDIDNGS = OpenAIEmbeddings(openai_api_key=os.environ['OPENAI_API_KEY'])
|
288 |
docsearch = FAISS.from_texts(texts, EMBEDIDNGS)
|
289 |
-
if not os.path.exists('embeddings'):
|
290 |
os.mkdir('/tmp/embeddings')
|
291 |
docsearch.save_local('/tmp/embeddings')
|
292 |
print('Embeddings created.')
|
@@ -332,12 +332,12 @@ def clear_chat_history(history:list)->list:
|
|
332 |
global DATAFRAME_FILE
|
333 |
DATAFRAME_FILE = None
|
334 |
|
335 |
-
storing_folder = pathlib.Path('/tmp/')
|
336 |
-
for file in storing_folder.iterdir():
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
|
342 |
# global EMBEDIDNGS
|
343 |
# EMBEDIDNGS = None
|
|
|
286 |
global EMBEDIDNGS
|
287 |
EMBEDIDNGS = OpenAIEmbeddings(openai_api_key=os.environ['OPENAI_API_KEY'])
|
288 |
docsearch = FAISS.from_texts(texts, EMBEDIDNGS)
|
289 |
+
if not os.path.exists('/tmp/embeddings'):
|
290 |
os.mkdir('/tmp/embeddings')
|
291 |
docsearch.save_local('/tmp/embeddings')
|
292 |
print('Embeddings created.')
|
|
|
332 |
global DATAFRAME_FILE
|
333 |
DATAFRAME_FILE = None
|
334 |
|
335 |
+
# storing_folder = pathlib.Path('/tmp/')
|
336 |
+
# for file in storing_folder.iterdir():
|
337 |
+
# if file.is_file():
|
338 |
+
# print(f'{file} to be deleted')
|
339 |
+
# file.unlink()
|
340 |
+
# print(f'{file} deleted')
|
341 |
|
342 |
# global EMBEDIDNGS
|
343 |
# EMBEDIDNGS = None
|