minko186 commited on
Commit
2a53cb7
·
1 Parent(s): 439d01d

history auto refresh + rag search term includes topic and context

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -466,9 +466,10 @@ def generate_and_format(
466
  content_string = (
467
  "Use the trusted information here from the URLs and add them as References:\n" + content_string
468
  )
 
469
  article = generate_article(
470
  input_role,
471
- topic,
472
  context,
473
  keywords,
474
  article_length,
@@ -757,14 +758,16 @@ def create_interface():
757
  ai_check_result = gr.Label(label="AI Check Result")
758
  highlighted_text = gr.HTML(label="Sentence Breakdown", visible=False)
759
  humanize_btn = gr.Button("Humanize")
760
- # humanized_output = gr.Textbox(label="Humanized Article", lines=20, elem_classes=["custom-textbox"])
761
- humanized_output = gr.Markdown(label="Humanized Article", value="\n\n\n\n", render=True)
762
  # copy_to_input_btn = gr.Button("Copy to Input for AI Check")
763
 
764
  with gr.Tab("History"):
765
- history_chat = gr.Chatbot(label="Generation History")
 
 
766
  refresh_button = gr.Button("Refresh History")
767
  refresh_button.click(get_history, outputs=history_chat)
 
768
 
769
  def regenerate_visible(text):
770
  if text:
@@ -879,6 +882,10 @@ def create_interface():
879
  outputs=[output_article],
880
  )
881
 
 
 
 
 
882
  return demo
883
 
884
 
 
466
  content_string = (
467
  "Use the trusted information here from the URLs and add them as References:\n" + content_string
468
  )
469
+ topic_context = topic + ", " + context
470
  article = generate_article(
471
  input_role,
472
+ topic_context,
473
  context,
474
  keywords,
475
  article_length,
 
758
  ai_check_result = gr.Label(label="AI Check Result")
759
  highlighted_text = gr.HTML(label="Sentence Breakdown", visible=False)
760
  humanize_btn = gr.Button("Humanize")
761
+ # humanized_output = gr.Markdown(label="Humanized Article", value="\n\n\n\n", render=True)
 
762
  # copy_to_input_btn = gr.Button("Copy to Input for AI Check")
763
 
764
  with gr.Tab("History"):
765
+ history_chat = gr.Chatbot(label="Generation History", height=1000)
766
+ """
767
+ # NOTE: REMOVED REFRESH BUTTON
768
  refresh_button = gr.Button("Refresh History")
769
  refresh_button.click(get_history, outputs=history_chat)
770
+ """
771
 
772
  def regenerate_visible(text):
773
  if text:
 
882
  outputs=[output_article],
883
  )
884
 
885
+ generate_btn.click(get_history, outputs=history_chat)
886
+ regenerate_btn.click(get_history, outputs=history_chat)
887
+ humanize_btn.click(get_history, outputs=history_chat)
888
+
889
  return demo
890
 
891