Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 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 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 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()
|