Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -15,12 +15,33 @@ st.sidebar.write("- Applications of GANs")
|
|
15 |
# Centered Title
|
16 |
st.markdown("<h1 style='text-align: center;'>Query Processing App</h1>", unsafe_allow_html=True)
|
17 |
|
18 |
-
# Layout
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
# Left Side - Query Input & Response
|
22 |
with left_col:
|
23 |
-
st.markdown("<div
|
24 |
|
25 |
st.subheader("Enter your Query")
|
26 |
query = st.text_area("Query:", height=100, key="query_input")
|
@@ -42,11 +63,11 @@ with left_col:
|
|
42 |
st.subheader("Response")
|
43 |
st.text_area("Response:", value=st.session_state.get("response", ""), height=100, key="response_box", disabled=True)
|
44 |
|
45 |
-
st.markdown("</div>", unsafe_allow_html=True)
|
46 |
|
47 |
# Right Side - Retrieved Documents
|
48 |
with right_col:
|
49 |
-
st.markdown("<div
|
50 |
|
51 |
if st.button("Show Retrieved Documents"):
|
52 |
st.session_state.retrieved_docs = "Sample Retrieved Documents"
|
@@ -54,10 +75,10 @@ with right_col:
|
|
54 |
st.subheader("Retrieved Documents")
|
55 |
st.text_area("Retrieved Documents:", value=st.session_state.get("retrieved_docs", ""), height=230, key="docs_box", disabled=True)
|
56 |
|
57 |
-
st.markdown("</div>", unsafe_allow_html=True)
|
58 |
|
59 |
# Bottom Section - Metrics
|
60 |
-
st.markdown("<div style='
|
61 |
|
62 |
if st.button("Calculate Metrics"):
|
63 |
st.session_state.metrics = "Sample Metrics: Accuracy 95%"
|
@@ -65,4 +86,4 @@ if st.button("Calculate Metrics"):
|
|
65 |
st.subheader("Metrics")
|
66 |
st.text_area("Metrics:", value=st.session_state.get("metrics", ""), height=100, key="metrics_box", disabled=True)
|
67 |
|
68 |
-
st.markdown("</div>", unsafe_allow_html=True)
|
|
|
15 |
# Centered Title
|
16 |
st.markdown("<h1 style='text-align: center;'>Query Processing App</h1>", unsafe_allow_html=True)
|
17 |
|
18 |
+
# Layout Structure
|
19 |
+
st.markdown(
|
20 |
+
"""
|
21 |
+
<style>
|
22 |
+
.section {
|
23 |
+
border: 2px solid #ddd;
|
24 |
+
border-radius: 10px;
|
25 |
+
padding: 15px;
|
26 |
+
margin-bottom: 10px;
|
27 |
+
background-color: #f9f9f9;
|
28 |
+
height: 100%;
|
29 |
+
}
|
30 |
+
.full-height {
|
31 |
+
display: flex;
|
32 |
+
flex-direction: column;
|
33 |
+
height: 100%;
|
34 |
+
}
|
35 |
+
</style>
|
36 |
+
""",
|
37 |
+
unsafe_allow_html=True,
|
38 |
+
)
|
39 |
+
|
40 |
+
left_col, right_col = st.columns([2, 2])
|
41 |
|
42 |
# Left Side - Query Input & Response
|
43 |
with left_col:
|
44 |
+
st.markdown("<div class='section full-height'>", unsafe_allow_html=True)
|
45 |
|
46 |
st.subheader("Enter your Query")
|
47 |
query = st.text_area("Query:", height=100, key="query_input")
|
|
|
63 |
st.subheader("Response")
|
64 |
st.text_area("Response:", value=st.session_state.get("response", ""), height=100, key="response_box", disabled=True)
|
65 |
|
66 |
+
st.markdown("</div>", unsafe_allow_html=True) # Closing border div
|
67 |
|
68 |
# Right Side - Retrieved Documents
|
69 |
with right_col:
|
70 |
+
st.markdown("<div class='section full-height'>", unsafe_allow_html=True)
|
71 |
|
72 |
if st.button("Show Retrieved Documents"):
|
73 |
st.session_state.retrieved_docs = "Sample Retrieved Documents"
|
|
|
75 |
st.subheader("Retrieved Documents")
|
76 |
st.text_area("Retrieved Documents:", value=st.session_state.get("retrieved_docs", ""), height=230, key="docs_box", disabled=True)
|
77 |
|
78 |
+
st.markdown("</div>", unsafe_allow_html=True) # Closing border div
|
79 |
|
80 |
# Bottom Section - Metrics
|
81 |
+
st.markdown("<div class='section' style='text-align:center;'>", unsafe_allow_html=True)
|
82 |
|
83 |
if st.button("Calculate Metrics"):
|
84 |
st.session_state.metrics = "Sample Metrics: Accuracy 95%"
|
|
|
86 |
st.subheader("Metrics")
|
87 |
st.text_area("Metrics:", value=st.session_state.get("metrics", ""), height=100, key="metrics_box", disabled=True)
|
88 |
|
89 |
+
st.markdown("</div>", unsafe_allow_html=True) # Closing border div
|