M17idd commited on
Commit
ba5ef8c
·
verified ·
1 Parent(s): 6099397

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -603,7 +603,9 @@ def remove_stop_words_from_lines(lines, stop_words):
603
  cleaned_lines.append(" ".join(cleaned_words))
604
  return cleaned_lines
605
 
606
- # حالا این رو در کد اصلی استفاده می‌کنیم:
 
 
607
  if query:
608
  # پیدا کردن ۱۰ خط نزدیک‌تر به سوال
609
  closest_lines = find_closest_lines(query, doc_texts, stop_words, top_n=3)
 
603
  cleaned_lines.append(" ".join(cleaned_words))
604
  return cleaned_lines
605
 
606
+ # حفظ تاریخچه چت
607
+ if "chat_history" not in st.session_state:
608
+ st.session_state.chat_history = []
609
  if query:
610
  # پیدا کردن ۱۰ خط نزدیک‌تر به سوال
611
  closest_lines = find_closest_lines(query, doc_texts, stop_words, top_n=3)