Spaces:
Running
Running
Merge pull request #7 from umbc-scify/version_0.1_setup
Browse files
app.py
CHANGED
@@ -2,9 +2,9 @@ import streamlit as st
|
|
2 |
import random
|
3 |
import time
|
4 |
|
5 |
-
st.header("
|
6 |
|
7 |
-
st.caption("
|
8 |
|
9 |
# Initialize chat history
|
10 |
if "messages" not in st.session_state:
|
@@ -20,7 +20,7 @@ def retriever(query: str):
|
|
20 |
with st.chat_message("assistant"):
|
21 |
placeholder = st.empty()
|
22 |
text=""
|
23 |
-
message = "
|
24 |
for chunk in message.split():
|
25 |
text += chunk + " "
|
26 |
time.sleep(0.05)
|
@@ -30,7 +30,7 @@ def retriever(query: str):
|
|
30 |
# You could return retrieved info here.
|
31 |
return message
|
32 |
|
33 |
-
def reasoner(info: str):
|
34 |
"""Simulate a 'reasoner' step, thinking about how to answer."""
|
35 |
with st.chat_message("assistant"):
|
36 |
placeholder = st.empty()
|
@@ -46,7 +46,7 @@ def reasoner(info: str):
|
|
46 |
return message
|
47 |
|
48 |
# Accept user input
|
49 |
-
if prompt := st.chat_input("
|
50 |
# Add user message to chat history
|
51 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
52 |
# Display user message in chat message container
|
@@ -54,10 +54,10 @@ if prompt := st.chat_input("40mg/day dosage of folic acid and 2mg/day dosage of
|
|
54 |
st.markdown(prompt)
|
55 |
|
56 |
#Calling retriever
|
57 |
-
retriever(prompt)
|
58 |
|
59 |
#Calling reasoner
|
60 |
-
reasoner(
|
61 |
|
62 |
# Display assistant response in chat message container
|
63 |
with st.chat_message("assistant"):
|
|
|
2 |
import random
|
3 |
import time
|
4 |
|
5 |
+
st.header(" Scientific Claim Verification ")
|
6 |
|
7 |
+
st.caption("Team UMBC-SBU-UT")
|
8 |
|
9 |
# Initialize chat history
|
10 |
if "messages" not in st.session_state:
|
|
|
20 |
with st.chat_message("assistant"):
|
21 |
placeholder = st.empty()
|
22 |
text=""
|
23 |
+
message = "Retrieving the documents related to the claim..."
|
24 |
for chunk in message.split():
|
25 |
text += chunk + " "
|
26 |
time.sleep(0.05)
|
|
|
30 |
# You could return retrieved info here.
|
31 |
return message
|
32 |
|
33 |
+
def reasoner(info: list[str]):
|
34 |
"""Simulate a 'reasoner' step, thinking about how to answer."""
|
35 |
with st.chat_message("assistant"):
|
36 |
placeholder = st.empty()
|
|
|
46 |
return message
|
47 |
|
48 |
# Accept user input
|
49 |
+
if prompt := st.chat_input("Type here"):
|
50 |
# Add user message to chat history
|
51 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
52 |
# Display user message in chat message container
|
|
|
54 |
st.markdown(prompt)
|
55 |
|
56 |
#Calling retriever
|
57 |
+
retrieved_documents=retriever(prompt)
|
58 |
|
59 |
#Calling reasoner
|
60 |
+
reasoning = reasoner(retrieved_documents)
|
61 |
|
62 |
# Display assistant response in chat message container
|
63 |
with st.chat_message("assistant"):
|