Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.")
|