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")
|