Spaces:
Sleeping
Sleeping
Update sherlock2.py
Browse files- sherlock2.py +67 -33
sherlock2.py
CHANGED
@@ -291,52 +291,86 @@ def chat_with_sherlock():
|
|
291 |
with output_container:
|
292 |
display_chat_history()
|
293 |
def main():
|
294 |
-
# ---
|
295 |
-
|
296 |
-
|
297 |
-
# Custom CSS for Styling
|
298 |
-
vintage_css = """
|
299 |
<style>
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
</style>
|
323 |
"""
|
324 |
-
st.markdown(
|
325 |
|
326 |
-
# Title and Header
|
327 |
st.title("AI Detective Sherlock Holmes")
|
328 |
st.header("_'Elementary, my dear Watson!'_")
|
329 |
|
330 |
-
|
|
|
331 |
pages = {
|
332 |
"Investigate a Case": investigate,
|
333 |
"Chat with Sherlock": chat_with_sherlock
|
334 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
|
336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
|
338 |
-
st.sidebar.title("Navigation")
|
339 |
-
page = st.sidebar.radio("Choose an action:", list(pages.keys()))
|
340 |
pages[page]()
|
341 |
|
342 |
if __name__ == "__main__":
|
|
|
291 |
with output_container:
|
292 |
display_chat_history()
|
293 |
def main():
|
294 |
+
# --- Custom CSS for Styling ---
|
295 |
+
custom_css = """
|
|
|
|
|
|
|
296 |
<style>
|
297 |
+
body {
|
298 |
+
background-color: #f8f8f8;
|
299 |
+
color: #333333;
|
300 |
+
font-family: 'Georgia', serif;
|
301 |
+
}
|
302 |
+
h1, h2, h3 {
|
303 |
+
color: #4d4d4d;
|
304 |
+
font-weight: bold;
|
305 |
+
}
|
306 |
+
.stTextInput > div > div > input {
|
307 |
+
border: 1px solid #4d4d4d;
|
308 |
+
border-radius: 5px;
|
309 |
+
padding: 10px;
|
310 |
+
font-size: 16px;
|
311 |
+
width: 100%;
|
312 |
+
box-sizing: border-box;
|
313 |
+
}
|
314 |
+
.stButton > button {
|
315 |
+
background-color: #4d4d4d;
|
316 |
+
color: white;
|
317 |
+
border: none;
|
318 |
+
border-radius: 5px;
|
319 |
+
padding: 10px 20px;
|
320 |
+
font-size: 16px;
|
321 |
+
cursor: pointer;
|
322 |
+
}
|
323 |
+
.stButton > button:hover {
|
324 |
+
background-color: #333333;
|
325 |
+
}
|
326 |
+
.stExpander > div > div {
|
327 |
+
background-color: #f0f0f0;
|
328 |
+
padding: 20px;
|
329 |
+
border-radius: 5px;
|
330 |
+
}
|
331 |
+
.stContainer {
|
332 |
+
padding: 20px;
|
333 |
+
background-color: #ffffff;
|
334 |
+
border-radius: 5px;
|
335 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
336 |
+
}
|
337 |
</style>
|
338 |
"""
|
339 |
+
st.markdown(custom_css, unsafe_allow_html=True) # Apply custom CSS
|
340 |
|
341 |
+
# --- Title and Header ---
|
342 |
st.title("AI Detective Sherlock Holmes")
|
343 |
st.header("_'Elementary, my dear Watson!'_")
|
344 |
|
345 |
+
# --- Sidebar Navigation ---
|
346 |
+
st.sidebar.title("Navigation")
|
347 |
pages = {
|
348 |
"Investigate a Case": investigate,
|
349 |
"Chat with Sherlock": chat_with_sherlock
|
350 |
}
|
351 |
+
page = st.sidebar.radio("Choose an action:", list(pages.keys()))
|
352 |
+
|
353 |
+
# --- Show Intro Popup ---
|
354 |
+
with st.expander("Welcome to AI Detective Sherlock Holmes!"):
|
355 |
+
st.write("""
|
356 |
+
**Meet Sherlock Holmes, the world's most renowned detective!**
|
357 |
|
358 |
+
This application allows you to:
|
359 |
+
|
360 |
+
* **Investigate Cases:** Upload case files and images for Sherlock to analyze. He will use his exceptional deductive reasoning skills to uncover clues and provide insights.
|
361 |
+
* **Chat with Sherlock:** Ask him questions and get his expert opinion on various aspects of the case.
|
362 |
+
|
363 |
+
**To chat with Sherlock, go to the "Chat with Sherlock" page in the sidebar.**
|
364 |
+
|
365 |
+
**Important Note:**
|
366 |
+
|
367 |
+
While the internet can be a valuable resource, it's crucial to be aware that not all information found online is accurate or reliable. To ensure the integrity of our investigation, we prioritize the use of trustworthy sources such as official documents, witness testimonies, and expert analysis.
|
368 |
+
|
369 |
+
Therefore, **we advise against relying solely on internet searches** during the investigation process. Instead, focus on providing Sherlock with concrete evidence and factual information to facilitate his deductions.
|
370 |
+
|
371 |
+
Remember, the truth is often elusive, but with careful observation, logical reasoning, and a discerning eye, we can unravel even the most complex mysteries.
|
372 |
+
""")
|
373 |
|
|
|
|
|
374 |
pages[page]()
|
375 |
|
376 |
if __name__ == "__main__":
|