Ankush05 commited on
Commit
1c5a2c6
·
1 Parent(s): 0c9f179

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -1,18 +1,24 @@
1
  import streamlit as st
2
  import os
3
- from transformers import pipeline, Conversation
 
 
 
 
 
 
 
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 = Conversation(message)
13
- answer = convo(umsg)
14
  with st.chat_message("assistant"):
15
- st.write(answer)
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