Spaces:
Sleeping
Sleeping
fix: st.write
Browse files
app.py
CHANGED
@@ -102,17 +102,19 @@ st.write("This app searches through scientific papers to answer your questions a
|
|
102 |
query = st.text_input("Please ask me anything about autism ✨")
|
103 |
|
104 |
if query:
|
105 |
-
with st.status("Searching for answers..."):
|
106 |
# Load dataset
|
107 |
df = load_dataset(query)
|
|
|
108 |
# Get relevant context
|
109 |
context = "\n".join([
|
110 |
f"{text[:1000]}" for text in df['text'].head(3)
|
111 |
])
|
112 |
-
|
113 |
# Generate answer
|
114 |
answer = generate_answer(query, context)
|
115 |
-
st.
|
|
|
116 |
label="Search complete!", state="complete", expanded=False
|
117 |
)
|
118 |
if answer and not answer.isspace():
|
|
|
102 |
query = st.text_input("Please ask me anything about autism ✨")
|
103 |
|
104 |
if query:
|
105 |
+
with st.status("Searching for answers...") as status:
|
106 |
# Load dataset
|
107 |
df = load_dataset(query)
|
108 |
+
st.write("Searching for data in PubMed and arXiv...")
|
109 |
# Get relevant context
|
110 |
context = "\n".join([
|
111 |
f"{text[:1000]}" for text in df['text'].head(3)
|
112 |
])
|
113 |
+
st.write("Data found!")
|
114 |
# Generate answer
|
115 |
answer = generate_answer(query, context)
|
116 |
+
st.write("Generating answer...")
|
117 |
+
status.update(
|
118 |
label="Search complete!", state="complete", expanded=False
|
119 |
)
|
120 |
if answer and not answer.isspace():
|