Spaces:
Sleeping
Sleeping
Update sherlock2.py
Browse files- sherlock2.py +5 -4
sherlock2.py
CHANGED
|
@@ -270,12 +270,12 @@ def investigate():
|
|
| 270 |
case_embeddings = generate_embeddings_from_documents(case_text)
|
| 271 |
image_insights = process_images(images)
|
| 272 |
|
| 273 |
-
# Combine information and analyze
|
| 274 |
combined_information = {
|
| 275 |
"case_text": case_text,
|
| 276 |
"image_insights": image_insights,
|
| 277 |
"keywords": keywords
|
| 278 |
}
|
|
|
|
| 279 |
# Convert case_embeddings to a string
|
| 280 |
case_embeddings_str = " ".join(str(embedding) for embedding in case_embeddings)
|
| 281 |
|
|
@@ -285,16 +285,17 @@ def investigate():
|
|
| 285 |
""" + str(combined_information) + "\nCase Embeddings: " + case_embeddings_str
|
| 286 |
|
| 287 |
response = model.generate_content([sherlock_persona, sherlock_guidelines, prompt])
|
| 288 |
-
|
| 289 |
# Display results in an expandable section
|
| 290 |
with st.expander("Sherlock's Analysis and Suggestions:"):
|
| 291 |
st.write(response.text)
|
| 292 |
|
| 293 |
-
#
|
|
|
|
|
|
|
| 294 |
search_options = st.multiselect("Search for additional clues:", ["Wikipedia", "Internet"], default=["Wikipedia"])
|
| 295 |
if st.button("Search"):
|
| 296 |
with st.spinner("Searching for clues..."):
|
| 297 |
-
wikipedia_info = [] # Initialize with an empty list
|
| 298 |
web_search_results = []
|
| 299 |
if "Wikipedia" in search_options:
|
| 300 |
wikipedia_info = search_and_scrape_wikipedia(keywords)
|
|
|
|
| 270 |
case_embeddings = generate_embeddings_from_documents(case_text)
|
| 271 |
image_insights = process_images(images)
|
| 272 |
|
|
|
|
| 273 |
combined_information = {
|
| 274 |
"case_text": case_text,
|
| 275 |
"image_insights": image_insights,
|
| 276 |
"keywords": keywords
|
| 277 |
}
|
| 278 |
+
|
| 279 |
# Convert case_embeddings to a string
|
| 280 |
case_embeddings_str = " ".join(str(embedding) for embedding in case_embeddings)
|
| 281 |
|
|
|
|
| 285 |
""" + str(combined_information) + "\nCase Embeddings: " + case_embeddings_str
|
| 286 |
|
| 287 |
response = model.generate_content([sherlock_persona, sherlock_guidelines, prompt])
|
| 288 |
+
|
| 289 |
# Display results in an expandable section
|
| 290 |
with st.expander("Sherlock's Analysis and Suggestions:"):
|
| 291 |
st.write(response.text)
|
| 292 |
|
| 293 |
+
# Initialize wikipedia_info with an empty list
|
| 294 |
+
wikipedia_info = []
|
| 295 |
+
|
| 296 |
search_options = st.multiselect("Search for additional clues:", ["Wikipedia", "Internet"], default=["Wikipedia"])
|
| 297 |
if st.button("Search"):
|
| 298 |
with st.spinner("Searching for clues..."):
|
|
|
|
| 299 |
web_search_results = []
|
| 300 |
if "Wikipedia" in search_options:
|
| 301 |
wikipedia_info = search_and_scrape_wikipedia(keywords)
|