Write to a file in spaces
I am looking for a simple feature where I can log what a user inputs in a text box i.e. save it to a csv/.txt file. Atm, seems like I cannot write to a file and save it to the repo or even cannot open a existing file and append text to it and save it again. Is there some way to record/log user inputs to the repo?
2022-07-13T01:17:47Z
I believe you’re looking for something likethis. It’s using a dataset repo to store and reload persistent data.
2022-07-13T19:00:22Z
Thank you for sharing this. I’ll def try this but expected something simpler. Looks like it uses a sep repo and some additional HF classes. Wonder if there could be a easier approach.
2022-07-15T09:35:10Z
Spaces have no persistent storage, so if you rebuild/restart a space, those files would be lost. That’s why it’s important to handle things in a separate, dataset repo which is designed for storage
2022-07-20T18:33:04Z
Thanks for the clarification.