bhagwandas commited on
Commit
c77c2e4
Β·
verified Β·
1 Parent(s): fc24d80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -3
app.py CHANGED
@@ -11,7 +11,7 @@ import os
11
 
12
  st.set_page_config(page_title="Smart Factory RAG Assistant", layout="wide")
13
 
14
- st.title("🏠 Industry 5.0 | Smart Factory RAG Assistant (Open Source)")
15
 
16
  # Load open-access model (Zephyr)
17
  @st.cache_resource(show_spinner=True)
@@ -106,7 +106,23 @@ if uploaded_file:
106
  # Role-based Assistant
107
  st.subheader("🧠 Role-Based Decision Assistant")
108
  role = st.selectbox("Select your role", ["Engineer", "Operator"])
109
- question = st.text_input("Ask a question based on the data analysis")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
  if question:
112
  with st.spinner("Generating insights..."):
@@ -142,4 +158,4 @@ Provide a short, focused response in your role.
142
  st.markdown(f"**{answer}**")
143
 
144
  else:
145
- st.info("πŸ“‚ Please upload a factory CSV data file to begin analysis.")
 
11
 
12
  st.set_page_config(page_title="Smart Factory RAG Assistant", layout="wide")
13
 
14
+ st.title("🏠 Industry 5.0 | FactoryGPT")
15
 
16
  # Load open-access model (Zephyr)
17
  @st.cache_resource(show_spinner=True)
 
106
  # Role-based Assistant
107
  st.subheader("🧠 Role-Based Decision Assistant")
108
  role = st.selectbox("Select your role", ["Engineer", "Operator"])
109
+
110
+ predefined_qas = {
111
+ "Engineer": [
112
+ "Which parameters are showing strong correlation?",
113
+ "Are there any indicators of potential equipment failure?",
114
+ "How should we optimize process efficiency based on anomalies?"
115
+ ],
116
+ "Operator": [
117
+ "What is the most critical parameter to monitor today?",
118
+ "Do any sensors show abnormal values?",
119
+ "What immediate steps should I take due to anomalies?"
120
+ ]
121
+ }
122
+
123
+ predefined_q = st.selectbox("Choose a predefined question (optional)", ["None"] + predefined_qas[role])
124
+ manual_q = st.text_input("Or type your own question below:")
125
+ question = manual_q if manual_q.strip() else (predefined_q if predefined_q != "None" else "")
126
 
127
  if question:
128
  with st.spinner("Generating insights..."):
 
158
  st.markdown(f"**{answer}**")
159
 
160
  else:
161
+ st.info("πŸ“‚ Please upload a factory CSV data file to begin analysis.")