M17idd commited on
Commit
5dbb4e9
·
verified ·
1 Parent(s): 27042fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -625,12 +625,7 @@ if query:
625
  for line in closest_lines
626
  ]
627
  summarized_text = summarize_text_by_frequency("\n".join(cleaned_closest_lines), num_sentences=3)
628
- summarized_cleaned = " ".join([
629
- word for word in summarized_text.split()
630
- if word not in stop_words
631
- ])
632
-
633
-
634
 
635
  if summarized_text:
636
  prompt = f"""
@@ -645,9 +640,10 @@ if query:
645
  """
646
 
647
  # ارسال پیام به مدل به صورت صحیح
648
- response = llm([prompt])
649
 
650
- rewritten = clean_text(response['generated_text'].strip()) # اگر خروجی به صورت دیکشنری باشد
 
651
 
652
  # نمایش نتیجه
653
  st.markdown(f'<div class="chat-message">{rewritten}</div>', unsafe_allow_html=True)
 
625
  for line in closest_lines
626
  ]
627
  summarized_text = summarize_text_by_frequency("\n".join(cleaned_closest_lines), num_sentences=3)
628
+ summarized_cleaned = " ".join([word for word in summarized_text.split() if word not in stop_words])
 
 
 
 
 
629
 
630
  if summarized_text:
631
  prompt = f"""
 
640
  """
641
 
642
  # ارسال پیام به مدل به صورت صحیح
643
+ response = llm(prompt) # بدون پارامتر اضافی
644
 
645
+ # فرض بر این است که خروجی مدل به صورت دیکشنری است
646
+ rewritten = clean_text(response[0]['generated_text'].strip()) # اصلاح شده برای خروجی دیکشنری
647
 
648
  # نمایش نتیجه
649
  st.markdown(f'<div class="chat-message">{rewritten}</div>', unsafe_allow_html=True)