sanuth123 commited on
Commit
e416abe
·
verified ·
1 Parent(s): 9193df1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -47,7 +47,7 @@ doc_chain = create_stuff_documents_chain(llm, prompt)
47
  chain = create_retrieval_chain(retriever, doc_chain)
48
 
49
  # Chatbot response function
50
- def respond(
51
  message,
52
  history
53
  ):
@@ -75,10 +75,12 @@ def respond(
75
 
76
  chatbot = gr.Chatbot(placeholder="<strong>Chatbot that answers questions on agile processes</strong><br>Ask Me Anything")
77
  # Gradio Chat Interface
78
- demo = gr.ChatInterface(
79
- fn=respond,
80
- chatbot=chatbot,
81
- type="messages"
82
- )
 
 
83
  if __name__ == "__main__":
84
  demo.launch()
 
47
  chain = create_retrieval_chain(retriever, doc_chain)
48
 
49
  # Chatbot response function
50
+ def answer_query(
51
  message,
52
  history
53
  ):
 
75
 
76
  chatbot = gr.Chatbot(placeholder="<strong>Chatbot that answers questions on agile processes</strong><br>Ask Me Anything")
77
  # Gradio Chat Interface
78
+ with gr.Blocks() as demo:
79
+ gr.HTML("<h1 align = 'center'>Smart Assistant</h1>")
80
+
81
+ chatbot = gr.Chatbot()
82
+ msg = gr.Textbox(label = "Enter your question here")
83
+ msg.submit(answer_query,[msg,chatbot],[msg,chatbot])
84
+
85
  if __name__ == "__main__":
86
  demo.launch()