YALCINKAYA commited on
Commit
4c01c10
·
verified ·
1 Parent(s): c124906

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -250,7 +250,7 @@ def handle_upload():
250
  try:
251
  # Save the file to the upload directory
252
  file.save(file_path)
253
-
254
  # Now that the document is uploaded, call load_document_store()
255
  print(f"File uploaded successfully. Calling load_document_store()...")
256
  except Exception as e:
@@ -336,9 +336,7 @@ chat_history = [
336
  ("Can you tell me another joke?", "Why don't scientists trust atoms? Because they make up everything!"),
337
  ]
338
 
339
-
340
- load_document_store()
341
-
342
  def generate_response(user_input, model_id):
343
  try:
344
  model, tokenizer = get_model_and_tokenizer(model_id)
 
250
  try:
251
  # Save the file to the upload directory
252
  file.save(file_path)
253
+ load_document_store() # Reload FAISS index
254
  # Now that the document is uploaded, call load_document_store()
255
  print(f"File uploaded successfully. Calling load_document_store()...")
256
  except Exception as e:
 
336
  ("Can you tell me another joke?", "Why don't scientists trust atoms? Because they make up everything!"),
337
  ]
338
 
339
+
 
 
340
  def generate_response(user_input, model_id):
341
  try:
342
  model, tokenizer = get_model_and_tokenizer(model_id)