Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -178,6 +178,20 @@ def main():
|
|
| 178 |
with st.spinner("Gemini is thinking..."):
|
| 179 |
content_blocks = []
|
| 180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
if st.session_state.conversation:
|
| 182 |
history_text = "\n\n".join(
|
| 183 |
f"Q: {entry[0]}\nA: {entry[1]}"
|
|
@@ -222,4 +236,4 @@ def main():
|
|
| 222 |
)
|
| 223 |
|
| 224 |
if __name__ == "__main__":
|
| 225 |
-
main()
|
|
|
|
| 178 |
with st.spinner("Gemini is thinking..."):
|
| 179 |
content_blocks = []
|
| 180 |
|
| 181 |
+
# System prompt inserted first here:
|
| 182 |
+
content_blocks.append({
|
| 183 |
+
"text": (
|
| 184 |
+
"Your role is to analyze documents, images, and videos to help identify and classify driver states, "
|
| 185 |
+
"including: drowsy, alert, yawning, microsleep, eyes/lips open or closed, and other distractions. "
|
| 186 |
+
"The user may ask for timestamps of events in video, technical explanations from code/docs, "
|
| 187 |
+
"or structured summaries. Prioritize your answers for this use case and act as a helpful assistant "
|
| 188 |
+
"within this domain. "
|
| 189 |
+
"Additionally, your classification may rely on the State Farm Distracted Driver Detection dataset, "
|
| 190 |
+
"which defines 10 distraction categories such as texting, phone use, reaching behind, adjusting the radio, "
|
| 191 |
+
"and safe driving. Use this labeling scheme when interpreting relevant images."
|
| 192 |
+
)
|
| 193 |
+
})
|
| 194 |
+
|
| 195 |
if st.session_state.conversation:
|
| 196 |
history_text = "\n\n".join(
|
| 197 |
f"Q: {entry[0]}\nA: {entry[1]}"
|
|
|
|
| 236 |
)
|
| 237 |
|
| 238 |
if __name__ == "__main__":
|
| 239 |
+
main()
|