Ankush05 commited on
Commit
491741a
·
1 Parent(s): 8da6c75
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -1,8 +1,9 @@
1
  import streamlit as st
2
  import os
3
  import pandas as pd
4
- import tranformers
5
 
 
6
 
7
 
8
  # Connecting to MongoDB
@@ -16,7 +17,8 @@ col = db["chatbot"]
16
 
17
  def chatbot():
18
  st.title("ChatBot")
19
- message = st.text_input("Enter your query here")
20
- if st.button ("Submit"):
21
- col.insert_one({"message": message})
22
-
 
 
1
  import streamlit as st
2
  import os
3
  import pandas as pd
4
+ from transformers import pipeline, Conversation
5
 
6
+ convo = pipeline("conversational")
7
 
8
 
9
  # Connecting to MongoDB
 
17
 
18
  def chatbot():
19
  st.title("ChatBot")
20
+ if message := st.chat_input("Enter your message"):
21
+ umsg = Conversation(message)
22
+ answer = convo(umsg)
23
+ with st.chat_message("assistant"):
24
+ st.write(answer)