Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

[fix] streamlit app init by caching it (#1047)

Sidharth Mohanty6d2389de1c84
diff --git a/examples/mistral-streamlit/app.py b/examples/mistral-streamlit/app.py
index 8c5ebd43d..a5a68c064 100644
--- a/examples/mistral-streamlit/app.py
+++ b/examples/mistral-streamlit/app.py
@@ -4,6 +4,12 @@ import streamlit as st
from embedchain import Pipeline as App
+
+def ec_app():
+ return App.from_config(config_path="config.yaml")
+
+
with st.sidebar:
huggingface_access_token = st.text_input("Hugging face Token", key="chatbot_api_key", type="password")
"[Get Hugging Face Access Token](https://huggingface.co/settings/tokens)"
@@ -34,7 +40,7 @@ if prompt := st.chat_input("Ask me anything!"):
st.stop()
os.environ["HUGGINGFACE_ACCESS_TOKEN"] = st.session_state.chatbot_api_key
- app = App.from_config(config_path="config.yaml")
+ app = ec_app()
if prompt.startswith("/add"):
with st.chat_message("user"):