Update app.py
Browse files
app.py
CHANGED
@@ -50,40 +50,46 @@ should_save = st.sidebar.checkbox("πΎ Save", value=True)
|
|
50 |
def add_witty_humor_buttons():
|
51 |
with st.expander("Wit and Humor π€£", expanded=True):
|
52 |
|
53 |
-
#
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
#
|
59 |
-
|
60 |
-
if st.button("Wise Quotes π§"):
|
61 |
-
StreamLLMChatResponse(wise_description)
|
62 |
|
63 |
-
#
|
64 |
-
|
65 |
-
|
66 |
-
StreamLLMChatResponse(rhyme_description)
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
if st.button("Medical Jokes π"):
|
71 |
-
StreamLLMChatResponse(medical_description)
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
if st.button("Minnesota Humor βοΈ"):
|
76 |
-
StreamLLMChatResponse(minnesota_description)
|
77 |
|
78 |
-
|
79 |
-
funny_stories_description = "Create ten funny stories that are tweet length π"
|
80 |
-
if st.button("Top Funny Stories π"):
|
81 |
-
StreamLLMChatResponse(funny_stories_description)
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
# Function to Stream Inference Client for Inference Endpoint Responses
|
89 |
def StreamLLMChatResponse(prompt):
|
|
|
50 |
def add_witty_humor_buttons():
|
51 |
with st.expander("Wit and Humor π€£", expanded=True):
|
52 |
|
53 |
+
# Define button descriptions
|
54 |
+
descriptions = {
|
55 |
+
"Generate Limericks π": "Write ten random adult limericks based on quotes that are tweet length and make you laugh π",
|
56 |
+
"Wise Quotes π§": "Generate ten wise quotes that are tweet length π¦",
|
57 |
+
"Funny Rhymes π€": "Create ten funny rhymes that are tweet length πΆ",
|
58 |
+
"Medical Jokes π": "Create ten medical jokes that are tweet length π₯",
|
59 |
+
"Minnesota Humor βοΈ": "Create ten jokes about Minnesota that are tweet length π¨οΈ",
|
60 |
+
"Top Funny Stories π": "Create ten funny stories that are tweet length π",
|
61 |
+
"More Funny Rhymes ποΈ": "Create ten more funny rhymes that are tweet length π΅"
|
62 |
+
}
|
63 |
|
64 |
+
# Create columns
|
65 |
+
col1, col2, col3 = st.columns([1, 1, 1], gap="small")
|
|
|
|
|
66 |
|
67 |
+
# Add buttons to columns
|
68 |
+
if col1.button("Generate Limericks π"):
|
69 |
+
StreamLLMChatResponse(descriptions["Generate Limericks π"])
|
|
|
70 |
|
71 |
+
if col2.button("Wise Quotes π§"):
|
72 |
+
StreamLLMChatResponse(descriptions["Wise Quotes π§"])
|
|
|
|
|
73 |
|
74 |
+
if col3.button("Funny Rhymes π€"):
|
75 |
+
StreamLLMChatResponse(descriptions["Funny Rhymes π€"])
|
|
|
|
|
76 |
|
77 |
+
col4, col5, col6 = st.columns([1, 1, 1], gap="small")
|
|
|
|
|
|
|
78 |
|
79 |
+
if col4.button("Medical Jokes π"):
|
80 |
+
StreamLLMChatResponse(descriptions["Medical Jokes π"])
|
81 |
+
|
82 |
+
if col5.button("Minnesota Humor βοΈ"):
|
83 |
+
StreamLLMChatResponse(descriptions["Minnesota Humor βοΈ"])
|
84 |
+
|
85 |
+
if col6.button("Top Funny Stories π"):
|
86 |
+
StreamLLMChatResponse(descriptions["Top Funny Stories π"])
|
87 |
+
|
88 |
+
col7 = st.columns(1, gap="small")
|
89 |
+
|
90 |
+
if col7[0].button("More Funny Rhymes ποΈ"):
|
91 |
+
StreamLLMChatResponse(descriptions["More Funny Rhymes ποΈ"])
|
92 |
+
|
93 |
|
94 |
# Function to Stream Inference Client for Inference Endpoint Responses
|
95 |
def StreamLLMChatResponse(prompt):
|