Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,24 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
-
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
convo = pipeline("conversational")
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
def chatbot():
|
| 10 |
st.title("ChatBot")
|
| 11 |
if message := st.chat_input("Enter your message"):
|
| 12 |
-
umsg =
|
| 13 |
-
answer = convo(umsg)
|
| 14 |
with st.chat_message("assistant"):
|
| 15 |
-
st.write(
|
| 16 |
|
| 17 |
|
| 18 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
from bardapi import Bard
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
bardkey = os.environ.get("BARD_API_KEY")
|
| 8 |
+
|
| 9 |
+
bard = Bard(token=bardkey)
|
| 10 |
+
|
| 11 |
|
| 12 |
+
# convo = pipeline("conversational")
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
def chatbot():
|
| 17 |
st.title("ChatBot")
|
| 18 |
if message := st.chat_input("Enter your message"):
|
| 19 |
+
umsg = bard.get_answer(message)["content"]
|
|
|
|
| 20 |
with st.chat_message("assistant"):
|
| 21 |
+
st.write(umsg)
|
| 22 |
|
| 23 |
|
| 24 |
|