Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -1,43 +1,32 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
#
|
4 |
-
st.
|
5 |
|
6 |
-
#
|
7 |
-
st.
|
|
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
|
|
|
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
|
15 |
-
|
16 |
-
st.markdown("**Try these examples:**")
|
17 |
-
col1, col2, col3 = st.columns(3)
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
question = "What is the capital of France?"
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
submit = col1.button("Submit")
|
29 |
-
clear = col2.button("Clear")
|
30 |
-
|
31 |
-
if clear:
|
32 |
-
question = ""
|
33 |
-
|
34 |
-
# Response area
|
35 |
-
st.text_area("Response", value="(Your answer will appear here)", height=100, disabled=True)
|
36 |
-
|
37 |
-
# Compute Metrics Button
|
38 |
-
st.markdown("---")
|
39 |
-
compute_metrics = st.button("Compute Metrics")
|
40 |
-
|
41 |
-
# Attributes & Metrics sections
|
42 |
-
st.text_area("Attributes", value="", height=80, disabled=True)
|
43 |
-
st.text_area("Metrics", value="", height=80, disabled=True)
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Page Title
|
4 |
+
st.title("Real-Time RAG Pipeline Q&A")
|
5 |
|
6 |
+
# Question Section
|
7 |
+
st.subheader("Ask a Question")
|
8 |
+
question = st.text_input("Enter your question:", placeholder="Type your query here...")
|
9 |
|
10 |
+
# Submit Button
|
11 |
+
if st.button("Submit"):
|
12 |
+
response = f"Response for: {question}" # Placeholder response
|
13 |
+
else:
|
14 |
+
response = ""
|
15 |
|
16 |
+
# Response Section
|
17 |
+
st.subheader("Response")
|
18 |
+
st.text_area("Generated Response:", value=response, height=150, disabled=True)
|
19 |
|
20 |
+
# Metrics Section
|
21 |
+
st.subheader("Metrics")
|
22 |
|
23 |
+
col1, col2 = st.columns([1, 3]) # Creating two columns for button and metrics display
|
|
|
|
|
24 |
|
25 |
+
with col1:
|
26 |
+
if st.button("Calculate Metrics"):
|
27 |
+
metrics = "Accuracy: 90%\nLatency: 50ms\nRelevance Score: 0.85" # Placeholder metrics
|
28 |
+
else:
|
29 |
+
metrics = ""
|
|
|
30 |
|
31 |
+
with col2:
|
32 |
+
st.text_area("Performance Metrics:", value=metrics, height=100, disabled=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|