this
Browse files
app.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
import pandas as pd
|
| 4 |
-
import
|
| 5 |
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
# Connecting to MongoDB
|
|
@@ -16,7 +17,8 @@ col = db["chatbot"]
|
|
| 16 |
|
| 17 |
def chatbot():
|
| 18 |
st.title("ChatBot")
|
| 19 |
-
message
|
| 20 |
-
|
| 21 |
-
|
| 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)
|