KSuhas commited on
Commit
338ca5f
·
verified ·
1 Parent(s): c1f1511

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -192,7 +192,7 @@ def demo_chat_response(message, history, uploaded_pdf_path, request: Optional[Gr
192
  oldest_key = next(iter(rag_engine_cache))
193
  del rag_engine_cache[oldest_key]
194
  print(f"Deleted old cache entry: {oldest_key}")
195
-
196
  current_engine = rag_engine_cache[uploaded_pdf_path]
197
 
198
  elif default_rag_engine:
@@ -857,18 +857,16 @@ with gr.Blocks(theme = gr.themes.Soft(), css = app_css, title = "Suhas’ KI-Por
857
 
858
  msg_box.submit(
859
  fn = portfolio_chat_response,
860
- inputs = [msg_box, chatbot],
861
  outputs = [msg_box, chatbot],
862
  queue = True,
863
- preprocess = lambda *args: (args[0], args[1], gr.Request())
864
  )
865
 
866
  submit_btn.click(
867
  fn = portfolio_chat_response,
868
- inputs = [msg_box, chatbot],
869
  outputs = [msg_box, chatbot],
870
  queue = True,
871
- preprocess = lambda *args: (args[0], args[1], gr.Request())
872
  )
873
 
874
  demo_btn.click(
@@ -886,22 +884,20 @@ with gr.Blocks(theme = gr.themes.Soft(), css = app_css, title = "Suhas’ KI-Por
886
 
887
  demo_msg_box.submit(
888
  fn = demo_chat_response_wrapper,
889
- inputs = [demo_msg_box, demo_chatbot, uploaded_file_path],
890
  outputs = [demo_msg_box, demo_chatbot],
891
  api_name = False,
892
  queue = True,
893
  trigger_mode = 'once',
894
- preprocess = lambda *args: (args[0], args[1], args[2], gr.Request())
895
  )
896
 
897
  demo_submit_btn.click(
898
  fn = demo_chat_response_wrapper,
899
- inputs = [demo_msg_box, demo_chatbot, uploaded_file_path],
900
  outputs = [demo_msg_box, demo_chatbot],
901
  api_name = False,
902
  queue = True,
903
  trigger_mode = 'once',
904
- preprocess = lambda *args: (args[0], args[1], args[2], gr.Request())
905
  )
906
 
907
 
 
192
  oldest_key = next(iter(rag_engine_cache))
193
  del rag_engine_cache[oldest_key]
194
  print(f"Deleted old cache entry: {oldest_key}")
195
+
196
  current_engine = rag_engine_cache[uploaded_pdf_path]
197
 
198
  elif default_rag_engine:
 
857
 
858
  msg_box.submit(
859
  fn = portfolio_chat_response,
860
+ inputs = [msg_box, chatbot, gr.Request()],
861
  outputs = [msg_box, chatbot],
862
  queue = True,
 
863
  )
864
 
865
  submit_btn.click(
866
  fn = portfolio_chat_response,
867
+ inputs = [msg_box, chatbot, gr.Request()],
868
  outputs = [msg_box, chatbot],
869
  queue = True,
 
870
  )
871
 
872
  demo_btn.click(
 
884
 
885
  demo_msg_box.submit(
886
  fn = demo_chat_response_wrapper,
887
+ inputs = [demo_msg_box, demo_chatbot, uploaded_file_path, gr.Request()],
888
  outputs = [demo_msg_box, demo_chatbot],
889
  api_name = False,
890
  queue = True,
891
  trigger_mode = 'once',
 
892
  )
893
 
894
  demo_submit_btn.click(
895
  fn = demo_chat_response_wrapper,
896
+ inputs = [demo_msg_box, demo_chatbot, uploaded_file_path, gr.Request()],
897
  outputs = [demo_msg_box, demo_chatbot],
898
  api_name = False,
899
  queue = True,
900
  trigger_mode = 'once',
 
901
  )
902
 
903