How to persist Gradio state externally
Is there a way to persist Gradio’sgr.State()externally in a way that makes it work:across deploysacross replicasacross sessionsOur use case is launching a prototype chatbot for internal use, but the limitation on state being stored per-session in memory causes the following problems:the app cannot have more than one replica running at a time, as if traffic goes to “the other instance”, it has no state and the chat is resetwhenever the app is deployed, state is reset for all userswhenever a user refreshes, state is resetIdeally, there would be a way to persistgr.Statein some external datastore (e.g. Redis, DB, even a just a cookie could work), or swap it out for another object with an appropriate interface.