cb1716pics commited on
Commit
ad53611
·
verified ·
1 Parent(s): edb7e49

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -34
app.py CHANGED
@@ -1,43 +1,32 @@
1
  import streamlit as st
2
 
3
- # Set page title
4
- st.set_page_config(page_title="RAG7 - Real Time RAG System", layout="wide")
5
 
6
- # Title and description
7
- st.markdown("## RAG7 - Real World RAG System ")
 
8
 
 
 
 
 
 
9
 
10
- st.markdown("### Hi, What do you want to know today? ")
 
 
11
 
12
- # User input field
13
- question = st.text_input("Please Enter Your Query.", placeholder="Type your question here")
14
 
15
- # Example questions (as buttons)
16
- st.markdown("**Try these examples:**")
17
- col1, col2, col3 = st.columns(3)
18
 
19
- if col1.button("When was the first case of COVID-19 identified?"):
20
- question = "When was the first case of COVID-19 identified?"
21
- if col2.button("Explain the concept of blockchain."):
22
- question = "Explain the concept of blockchain."
23
- if col3.button("What is the capital of France?"):
24
- question = "What is the capital of France?"
25
 
26
- # Submit & Clear buttons
27
- col1, col2 = st.columns([1, 1])
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)