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