# Gradio save\_state problem and introducing a basic chatbot

**URL:** <https://discuss.huggingface.co/t/gradio-save-state-problem-and-introducing-a-basic-chatbot/12197>\
**Category:** Spaces\
**Created:** [November 23, 2021, 11:32am UTC](https://discuss.huggingface.co/t/gradio-save-state-problem-and-introducing-a-basic-chatbot/12197 "2021-11-23T11:32:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorkemgoknar](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gorkemgoknar](https://discuss.huggingface.co/u/gorkemgoknar)\
**Post date:** [November 23, 2021, 11:32am UTC](https://discuss.huggingface.co/t/gradio-save-state-problem-and-introducing-a-basic-chatbot/12197/1 "2021-11-23T11:32:10Z")

</div>

Hello all,  
I have uploaded a more basic version of my chatbot to [https://huggingface.co/spaces/gorkemgoknar/moviechatbot](https://huggingface.co/spaces/gorkemgoknar/moviechatbot) .

If you checkout app.py code you can see how you can use a transformers model types which is not included in standart interface (do not forget requirements.txt to import modules)

I also shared my model and information to use [https://huggingface.co/gorkemgoknar/gpt2chatbotenglish](https://huggingface.co/gorkemgoknar/gpt2chatbotenglish) 🙂

A more feature rich version (including movie and character selection) is on : [metayazar.com/chatbot](https://metayazar.com/chatbot) with Turkish version on [https://www.metayazar.com/chatbot\_tr](https://www.metayazar.com/chatbot_tr)

While building gradio app I noticed that save\_state(history) get\_state() does not work in embedded application. While gradio app is full screen it works but in HF spaces information is lost (likely due to Flask session not being statefull inside embedded fram).

To overcome this I use a global history but likely this would make models history being shared between different users (not a problem for a demo and it may be fun), yet for information there should be a way to save state if HF Spaces would be a different product.

---

<div class="post-metadata">

**Author:** ![abidlabs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/abidlabs/32/21878_2.png) [@abidlabs](https://discuss.huggingface.co/u/abidlabs)\
**Post date:** [December 22, 2021, 2:02pm UTC](https://discuss.huggingface.co/t/gradio-save-state-problem-and-introducing-a-basic-chatbot/12197/2 "2021-12-22T14:02:48Z")

</div>

Thanks for the detailed feedback @gorkemgoknar! I one of the Gradio developers and I’ll share this feedback with my team so that we can fix it. (We are working on a better `Chatbot` output component altogether!)
