Spaces:
Running
Running
Fix: Gradio 4.x compatibility - single click handler, remove demo.load
Browse files
app.py
CHANGED
|
@@ -330,7 +330,9 @@ def initialize_demo():
|
|
| 330 |
mnemo.clear()
|
| 331 |
for mem in EXAMPLE_MEMORIES:
|
| 332 |
mnemo.add(mem)
|
| 333 |
-
|
|
|
|
|
|
|
| 334 |
|
| 335 |
|
| 336 |
def add_memory(content: str):
|
|
@@ -429,8 +431,7 @@ with gr.Blocks(title="Mnemo v4 - SLM Memory System", theme=gr.themes.Soft()) as
|
|
| 429 |
clear_btn = gr.Button("🗑️ Clear All")
|
| 430 |
|
| 431 |
add_btn.click(add_memory, inputs=[memory_input], outputs=[add_status, memories_display])
|
| 432 |
-
init_btn.click(initialize_demo, outputs=[add_status])
|
| 433 |
-
init_btn.click(get_all_memories, outputs=[memories_display])
|
| 434 |
clear_btn.click(clear_memories, outputs=[add_status, memories_display])
|
| 435 |
|
| 436 |
with gr.Tab("🔍 Search"):
|
|
@@ -497,8 +498,7 @@ with gr.Blocks(title="Mnemo v4 - SLM Memory System", theme=gr.themes.Soft()) as
|
|
| 497 |
[GitHub](https://huggingface.co/AthelaPerk/mnemo-memory) | MIT License
|
| 498 |
""")
|
| 499 |
|
| 500 |
-
|
| 501 |
-
demo.load(get_all_memories, outputs=[])
|
| 502 |
|
| 503 |
if __name__ == "__main__":
|
| 504 |
demo.launch()
|
|
|
|
| 330 |
mnemo.clear()
|
| 331 |
for mem in EXAMPLE_MEMORIES:
|
| 332 |
mnemo.add(mem)
|
| 333 |
+
status = f"✅ Initialized with {len(EXAMPLE_MEMORIES)} memories, {mnemo.stats['links_created']} links created"
|
| 334 |
+
memories = get_all_memories()
|
| 335 |
+
return status, memories
|
| 336 |
|
| 337 |
|
| 338 |
def add_memory(content: str):
|
|
|
|
| 431 |
clear_btn = gr.Button("🗑️ Clear All")
|
| 432 |
|
| 433 |
add_btn.click(add_memory, inputs=[memory_input], outputs=[add_status, memories_display])
|
| 434 |
+
init_btn.click(initialize_demo, outputs=[add_status, memories_display])
|
|
|
|
| 435 |
clear_btn.click(clear_memories, outputs=[add_status, memories_display])
|
| 436 |
|
| 437 |
with gr.Tab("🔍 Search"):
|
|
|
|
| 498 |
[GitHub](https://huggingface.co/AthelaPerk/mnemo-memory) | MIT License
|
| 499 |
""")
|
| 500 |
|
| 501 |
+
# No auto-load - user clicks "Load Examples" to initialize
|
|
|
|
| 502 |
|
| 503 |
if __name__ == "__main__":
|
| 504 |
demo.launch()
|