JiakaiDu commited on
Commit
bc65495
1 Parent(s): 831a5e8

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Test_RAG.py +3 -3
Test_RAG.py CHANGED
@@ -615,13 +615,13 @@ def bot(history, temperature, top_p, top_k, repetition_penalty, hide_full_prompt
615
  if do_rag:
616
  # t1 = Thread(target=rag_chain.invoke, args=({"input": history[-1][0]},))
617
  input_text = history[-1][0]
618
- response = rag_chain.invoke({"input": input_text })
619
  print(response)
620
  else:
621
  input_text = rag_prompt_template.format(input=history[-1][0], context="")
622
  # t1 = Thread(target=llm.invoke, args=(input_text,))
623
  # input_text = history[-1][0]
624
- response = rag_chain.invoke({"input": input_text })
625
  print(response)
626
  # t1.start()
627
 
@@ -903,6 +903,6 @@ demo.queue()
903
  # if you are launching remotely, specify server_name and server_port
904
  # demo.launch(server_port=8082)
905
  # if you have any issue to launch on your platform, you can pass share=True to launch method:
906
- demo.launch(share=True)
907
  # it creates a publicly shareable link for the interface. Read more in the docs: https://gradio.app/docs/
908
  # demo.launch()
 
615
  if do_rag:
616
  # t1 = Thread(target=rag_chain.invoke, args=({"input": history[-1][0]},))
617
  input_text = history[-1][0]
618
+ response = llm.invoke({"input": input_text })
619
  print(response)
620
  else:
621
  input_text = rag_prompt_template.format(input=history[-1][0], context="")
622
  # t1 = Thread(target=llm.invoke, args=(input_text,))
623
  # input_text = history[-1][0]
624
+ response = llm.invoke({"input": input_text })
625
  print(response)
626
  # t1.start()
627
 
 
903
  # if you are launching remotely, specify server_name and server_port
904
  # demo.launch(server_port=8082)
905
  # if you have any issue to launch on your platform, you can pass share=True to launch method:
906
+ demo.launch()
907
  # it creates a publicly shareable link for the interface. Read more in the docs: https://gradio.app/docs/
908
  # demo.launch()