MohammedNasser commited on
Commit
1e43581
·
verified ·
1 Parent(s): 6d432a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -200,14 +200,14 @@ def validate_pdf(pdf):
200
  return "الملف صالح للدردشة", True
201
 
202
  def upload_pdf(pdf_file):
203
- global vectorstore, chain # Use global variables to store state
204
-
205
  data = load_pdf(pdf_file)
206
  vectorstore = prepare_vectorstore(data)
207
  chain = create_chain(vectorstore)
208
  return "تم تحميل الملف بنجاح !", True
209
 
210
- chat_history = []
211
  def chat(user_input):
212
  global chain chat_history # Access the global chain variable
213
 
 
200
  return "الملف صالح للدردشة", True
201
 
202
  def upload_pdf(pdf_file):
203
+ global vectorstore, chain,chat_history # Use global variables to store state
204
+ chat_history = []
205
  data = load_pdf(pdf_file)
206
  vectorstore = prepare_vectorstore(data)
207
  chain = create_chain(vectorstore)
208
  return "تم تحميل الملف بنجاح !", True
209
 
210
+
211
  def chat(user_input):
212
  global chain chat_history # Access the global chain variable
213