Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- ui/interface.py +24 -28
ui/interface.py
CHANGED
|
@@ -190,32 +190,28 @@ def cute_mushroom_garden_html() -> str:
|
|
| 190 |
'''
|
| 191 |
|
| 192 |
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
-
# Simple: Add the attribution line right to the bottom of the text string
|
| 200 |
-
return f"{story}\n\n<sub style='display: block; opacity: 0.6; margin-top: 0.75rem;'>Story generated by Myco AI</sub>"
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
with gr.Tabs():
|
| 204 |
-
with gr.Tab("✨ Magic Mushroom Garden"):
|
| 205 |
-
# The pure animation
|
| 206 |
-
gr.HTML(value=cute_mushroom_garden_html())
|
| 207 |
-
|
| 208 |
-
# Subtle attribution
|
| 209 |
-
gr.Markdown(
|
| 210 |
-
"<sub>*Story generated by Myco AI*</sub>",
|
| 211 |
-
elem_id="ai-attribution"
|
| 212 |
-
)
|
| 213 |
-
|
| 214 |
-
# Define the narrative component ONCE
|
| 215 |
-
narrative = gr.Markdown(
|
| 216 |
-
value="Myco is searching for a story hidden in the moss...",
|
| 217 |
-
elem_id="narrative-card"
|
| 218 |
-
)
|
| 219 |
-
|
| 220 |
-
# Timer updates the ONE narrative component
|
| 221 |
-
gr.Timer(20).tick(fn=get_myco_narrative, outputs=narrative)
|
|
|
|
| 190 |
'''
|
| 191 |
|
| 192 |
|
| 193 |
+
def render_shroom_tab():
|
| 194 |
+
# 1. Assign the block to 'demo' so it can be returned
|
| 195 |
+
with gr.Blocks() as demo:
|
| 196 |
+
with gr.Tabs():
|
| 197 |
+
with gr.Tab("✨ Magic Mushroom Garden"):
|
| 198 |
+
# The pure animation
|
| 199 |
+
gr.HTML(value=cute_mushroom_garden_html())
|
| 200 |
+
|
| 201 |
+
# Subtle attribution
|
| 202 |
+
gr.Markdown(
|
| 203 |
+
"<sub>*Story generated by Myco AI*</sub>",
|
| 204 |
+
elem_id="ai-attribution"
|
| 205 |
+
)
|
| 206 |
+
|
| 207 |
+
# 2. Define the narrative component ONCE
|
| 208 |
+
narrative = gr.Markdown(
|
| 209 |
+
value="Myco is searching for a story hidden in the moss...",
|
| 210 |
+
elem_id="narrative-card"
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
# 3. Timer updates the ONE narrative component
|
| 214 |
+
gr.Timer(20).tick(fn=get_myco_narrative, outputs=narrative)
|
| 215 |
+
|
| 216 |
+
return demo
|
| 217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|