Spaces:
Build error
Build error
Create test_layout.py
Browse files- test_layout.py +33 -0
test_layout.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# App Title
|
4 |
+
st.title("π Streamlit Toggle Example")
|
5 |
+
|
6 |
+
# Display main answer
|
7 |
+
st.markdown("## π‘ **Final Answer:**")
|
8 |
+
st.success("This is the final response generated from the system.")
|
9 |
+
|
10 |
+
# Toggle to show/hide details
|
11 |
+
show_details = st.checkbox("π Show More Details")
|
12 |
+
|
13 |
+
if show_details:
|
14 |
+
# Additional details when the toggle is enabled
|
15 |
+
st.markdown("### π **Relevance Analysis**")
|
16 |
+
st.write("β
**Context 1 - Score: 0**")
|
17 |
+
st.write("**Reasoning:** This context contains sufficient information to answer the query.")
|
18 |
+
|
19 |
+
st.write("β
**Context 2 - Score: 1**")
|
20 |
+
st.write("**Reasoning:** This context lacks clarity and does not fully address the query.")
|
21 |
+
|
22 |
+
# Retrieved Contexts
|
23 |
+
st.markdown("### π **Retrieved Contexts**")
|
24 |
+
st.write("πΉ **Context 1:** This is a relevant passage from the document.")
|
25 |
+
st.write("πΉ **Context 2:** This is another relevant passage.")
|
26 |
+
|
27 |
+
# Relevant Context Numbers
|
28 |
+
st.markdown("### π **Relevant Context Numbers**")
|
29 |
+
st.write("[1, 2]")
|
30 |
+
|
31 |
+
# Footer
|
32 |
+
st.markdown("---")
|
33 |
+
st.markdown("π‘ **Toggle the checkbox above to show or hide processing details!**")
|