Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -240,9 +240,7 @@ def display_images_and_wikipedia_summaries():
|
|
240 |
for image_file in image_files:
|
241 |
image = Image.open(image_file)
|
242 |
st.image(image, caption=image_file, use_column_width=True)
|
243 |
-
|
244 |
-
keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
|
245 |
-
|
246 |
# Display Wikipedia and Google search links
|
247 |
wikipedia_url = create_search_url_wikipedia(keyword)
|
248 |
google_url = create_search_url_google(keyword)
|
@@ -255,7 +253,11 @@ def display_images_and_wikipedia_summaries():
|
|
255 |
[YouTube]({youtube_url}) |
|
256 |
[Bing]({bing_url})
|
257 |
"""
|
258 |
-
st.markdown(links_md)
|
|
|
|
|
|
|
|
|
259 |
|
260 |
|
261 |
def get_all_query_params(key):
|
@@ -398,52 +400,6 @@ key = os.getenv('OPENAI_API_KEY')
|
|
398 |
prompt = f"Write instructions to teach discharge planning along with guidelines and patient education. List entities, features and relationships to CCDA and FHIR objects in boldface."
|
399 |
should_save = st.sidebar.checkbox("πΎ Save", value=True, help="Save your session data.")
|
400 |
|
401 |
-
# 2. Prompt label button demo for LLM
|
402 |
-
def add_witty_humor_buttons():
|
403 |
-
with st.expander("Wit and Humor π€£", expanded=True):
|
404 |
-
# Tip about the Dromedary family
|
405 |
-
st.markdown("π¬ **Fun Fact**: Dromedaries, part of the camel family, have a single hump and are adapted to arid environments. Their 'superpowers' include the ability to survive without water for up to 7 days, thanks to their specialized blood cells and water storage in their hump.")
|
406 |
-
|
407 |
-
# Define button descriptions
|
408 |
-
descriptions = {
|
409 |
-
"Generate Limericks π": "Write ten random adult limericks based on quotes that are tweet length and make you laugh π",
|
410 |
-
"Wise Quotes π§": "Generate ten wise quotes that are tweet length π¦",
|
411 |
-
"Funny Rhymes π€": "Create ten funny rhymes that are tweet length πΆ",
|
412 |
-
"Medical Jokes π": "Create ten medical jokes that are tweet length π₯",
|
413 |
-
"Minnesota Humor βοΈ": "Create ten jokes about Minnesota that are tweet length π¨οΈ",
|
414 |
-
"Top Funny Stories π": "Create ten funny stories that are tweet length π",
|
415 |
-
"More Funny Rhymes ποΈ": "Create ten more funny rhymes that are tweet length π΅"
|
416 |
-
}
|
417 |
-
|
418 |
-
# Create columns
|
419 |
-
col1, col2, col3 = st.columns([1, 1, 1], gap="small")
|
420 |
-
|
421 |
-
# Add buttons to columns
|
422 |
-
if col1.button("Wise Limericks π"):
|
423 |
-
StreamLLMChatResponse(descriptions["Generate Limericks π"])
|
424 |
-
|
425 |
-
if col2.button("Wise Quotes π§"):
|
426 |
-
StreamLLMChatResponse(descriptions["Wise Quotes π§"])
|
427 |
-
|
428 |
-
#if col3.button("Funny Rhymes π€"):
|
429 |
-
# StreamLLMChatResponse(descriptions["Funny Rhymes π€"])
|
430 |
-
|
431 |
-
col4, col5, col6 = st.columns([1, 1, 1], gap="small")
|
432 |
-
|
433 |
-
if col4.button("Top Ten Funniest Clean Jokes π"):
|
434 |
-
StreamLLMChatResponse(descriptions["Top Ten Funniest Clean Jokes π"])
|
435 |
-
|
436 |
-
if col5.button("Minnesota Humor βοΈ"):
|
437 |
-
StreamLLMChatResponse(descriptions["Minnesota Humor βοΈ"])
|
438 |
-
|
439 |
-
if col6.button("Origins of Medical Science True Stories"):
|
440 |
-
StreamLLMChatResponse(descriptions["Origins of Medical Science True Stories"])
|
441 |
-
|
442 |
-
col7 = st.columns(1, gap="small")
|
443 |
-
|
444 |
-
if col7[0].button("Top Ten Best Write a streamlit python program prompts to build AI programs. ποΈ"):
|
445 |
-
StreamLLMChatResponse(descriptions["Top Ten Best Write a streamlit python program prompts to build AI programs. ποΈ"])
|
446 |
-
|
447 |
def SpeechSynthesis(result):
|
448 |
documentHTML5='''
|
449 |
<!DOCTYPE html>
|
@@ -905,76 +861,6 @@ def StreamMedChatResponse(topic):
|
|
905 |
|
906 |
|
907 |
|
908 |
-
def add_medical_exam_buttons():
|
909 |
-
# Medical exam terminology descriptions
|
910 |
-
descriptions = {
|
911 |
-
"White Blood Cells π": "3 Q&A with emojis about types, facts, function, inputs and outputs of white blood cells π₯",
|
912 |
-
"CT Imagingπ¦ ": "3 Q&A with emojis on CT Imaging post surgery, how to, what to look for π",
|
913 |
-
"Hematoma π": "3 Q&A with emojis about hematoma and infection care and study including bacteria cultures and tests or labsπͺ",
|
914 |
-
"Post Surgery Wound Care π": "3 Q&A with emojis on wound care, and good bedside manner π©Έ",
|
915 |
-
"Healing and humor π": "3 Q&A with emojis on stories and humor about healing and caregiving π",
|
916 |
-
"Psychology of bedside manner π§¬": "3 Q&A with emojis on bedside manner and how to make patients feel at easeπ ",
|
917 |
-
"CT scan π": "3 Q&A with analysis on infection using CT scan and packing for skin, cellulitus and fascia π©Ί"
|
918 |
-
}
|
919 |
-
|
920 |
-
# Expander for medical topics
|
921 |
-
with st.expander("Medical Licensing Exam Topics π", expanded=False):
|
922 |
-
st.markdown("π©Ί **Important**: Variety of topics for medical licensing exams.")
|
923 |
-
|
924 |
-
# Create buttons for each description with unique keys
|
925 |
-
for idx, (label, content) in enumerate(descriptions.items()):
|
926 |
-
button_key = f"button_{idx}"
|
927 |
-
if st.button(label, key=button_key):
|
928 |
-
st.write(f"Running {label}")
|
929 |
-
input='Create markdown outline for definition of topic ' + label + ' also short quiz with appropriate emojis and definitions for: ' + content
|
930 |
-
response=StreamLLMChatResponse(input)
|
931 |
-
filename = generate_filename(response, 'txt')
|
932 |
-
create_file(filename, input, response, should_save)
|
933 |
-
|
934 |
-
def add_medical_exam_buttons2():
|
935 |
-
with st.expander("Medical Licensing Exam Topics π", expanded=False):
|
936 |
-
st.markdown("π©Ί **Important**: This section provides a variety of medical topics that are often encountered in medical licensing exams.")
|
937 |
-
|
938 |
-
# Define medical exam terminology descriptions
|
939 |
-
descriptions = {
|
940 |
-
"White Blood Cells π": "3 Questions and Answers with emojis about white blood cells π₯",
|
941 |
-
"CT Imagingπ¦ ": "3 Questions and Answers with emojis about CT Imaging of post surgery abscess, hematoma, and cerosanguiness fluid π",
|
942 |
-
"Hematoma π": "3 Questions and Answers with emojis about hematoma and infection and how heat helps white blood cells πͺ",
|
943 |
-
"Post Surgery Wound Care π": "3 Questions and Answers with emojis about wound care and how to help as a caregiverπ©Έ",
|
944 |
-
"Healing and humor π": "3 Questions and Answers with emojis on the use of stories and humor to help patients and family π",
|
945 |
-
"Psychology of bedside manner π§¬": "3 Questions and Answers with emojis about good bedside manner π ",
|
946 |
-
"CT scan π": "3 Questions and Answers with analysis of bacteria and understanding infection using cultures and CT scan π©Ί"
|
947 |
-
}
|
948 |
-
|
949 |
-
# Create columns
|
950 |
-
col1, col2, col3, col4 = st.columns([1, 1, 1, 1], gap="small")
|
951 |
-
|
952 |
-
# Add buttons to columns
|
953 |
-
if col1.button("Ultrasound with Doppler π"):
|
954 |
-
StreamLLMChatResponse(descriptions["Ultrasound with Doppler π"])
|
955 |
-
|
956 |
-
if col2.button("Oseltamivir π¦ "):
|
957 |
-
StreamLLMChatResponse(descriptions["Oseltamivir π¦ "])
|
958 |
-
|
959 |
-
if col3.button("IM Epinephrine π"):
|
960 |
-
StreamLLMChatResponse(descriptions["IM Epinephrine π"])
|
961 |
-
|
962 |
-
if col4.button("Hypokalemia π"):
|
963 |
-
StreamLLMChatResponse(descriptions["Hypokalemia π"])
|
964 |
-
|
965 |
-
col5, col6, col7, col8 = st.columns([1, 1, 1, 1], gap="small")
|
966 |
-
|
967 |
-
if col5.button("Succinylcholine π"):
|
968 |
-
StreamLLMChatResponse(descriptions["Succinylcholine π"])
|
969 |
-
|
970 |
-
if col6.button("Phosphoinositol System π§¬"):
|
971 |
-
StreamLLMChatResponse(descriptions["Phosphoinositol System π§¬"])
|
972 |
-
|
973 |
-
if col7.button("Ramipril π"):
|
974 |
-
StreamLLMChatResponse(descriptions["Ramipril π"])
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
# 17. Main
|
979 |
def main():
|
980 |
prompt = f"Write ten funny jokes that are tweet length stories that make you laugh. Show as markdown outline with emojis for each."
|
@@ -1242,15 +1128,19 @@ def main():
|
|
1242 |
st.markdown('No glossary lookup')
|
1243 |
|
1244 |
# Display the glossary grid
|
|
|
|
|
|
|
|
|
|
|
1245 |
st.title("Card Games Glossary π²")
|
1246 |
display_glossary_grid(roleplaying_glossary)
|
|
|
1247 |
st.title("π²πΊοΈ Card Game Universe")
|
1248 |
st.markdown("## Explore the vast universes of Dungeons and Dragons, Call of Cthulhu, GURPS, and more through interactive storytelling and encyclopedic knowledge.π ")
|
1249 |
|
1250 |
display_buttons_with_scores()
|
1251 |
|
1252 |
-
display_images_and_wikipedia_summaries()
|
1253 |
-
|
1254 |
# Assuming the transhuman_glossary and other setup code remains the same
|
1255 |
#st.write("Current Query Parameters:", st.query_params)
|
1256 |
#st.markdown("### Query Parameters - These Deep Link Map to Remixable Methods, Navigate or Trigger Functionalities")
|
|
|
240 |
for image_file in image_files:
|
241 |
image = Image.open(image_file)
|
242 |
st.image(image, caption=image_file, use_column_width=True)
|
243 |
+
|
|
|
|
|
244 |
# Display Wikipedia and Google search links
|
245 |
wikipedia_url = create_search_url_wikipedia(keyword)
|
246 |
google_url = create_search_url_google(keyword)
|
|
|
253 |
[YouTube]({youtube_url}) |
|
254 |
[Bing]({bing_url})
|
255 |
"""
|
256 |
+
st.markdown("# " + links_md)
|
257 |
+
|
258 |
+
keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
|
259 |
+
|
260 |
+
|
261 |
|
262 |
|
263 |
def get_all_query_params(key):
|
|
|
400 |
prompt = f"Write instructions to teach discharge planning along with guidelines and patient education. List entities, features and relationships to CCDA and FHIR objects in boldface."
|
401 |
should_save = st.sidebar.checkbox("πΎ Save", value=True, help="Save your session data.")
|
402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
def SpeechSynthesis(result):
|
404 |
documentHTML5='''
|
405 |
<!DOCTYPE html>
|
|
|
861 |
|
862 |
|
863 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
864 |
# 17. Main
|
865 |
def main():
|
866 |
prompt = f"Write ten funny jokes that are tweet length stories that make you laugh. Show as markdown outline with emojis for each."
|
|
|
1128 |
st.markdown('No glossary lookup')
|
1129 |
|
1130 |
# Display the glossary grid
|
1131 |
+
|
1132 |
+
|
1133 |
+
|
1134 |
+
display_images_and_wikipedia_summaries()
|
1135 |
+
|
1136 |
st.title("Card Games Glossary π²")
|
1137 |
display_glossary_grid(roleplaying_glossary)
|
1138 |
+
|
1139 |
st.title("π²πΊοΈ Card Game Universe")
|
1140 |
st.markdown("## Explore the vast universes of Dungeons and Dragons, Call of Cthulhu, GURPS, and more through interactive storytelling and encyclopedic knowledge.π ")
|
1141 |
|
1142 |
display_buttons_with_scores()
|
1143 |
|
|
|
|
|
1144 |
# Assuming the transhuman_glossary and other setup code remains the same
|
1145 |
#st.write("Current Query Parameters:", st.query_params)
|
1146 |
#st.markdown("### Query Parameters - These Deep Link Map to Remixable Methods, Navigate or Trigger Functionalities")
|