multimodalart HF staff Wauplin HF staff commited on
Commit
4c3f7da
β€’
1 Parent(s): 94cc393

Update gallery_history.py (#48)

Browse files

- Update gallery_history.py (ef22f8a5c466e1c029e14420b0ea9338da8b3f61)


Co-authored-by: Lucain Pouget <[email protected]>

Files changed (1) hide show
  1. gallery_history.py +5 -0
gallery_history.py CHANGED
@@ -28,6 +28,11 @@ if _folder is None:
28
  "locally and will be lost when the Space instance is restarted."
29
  )
30
  _folder = Path(__file__).parent / "history"
 
 
 
 
 
31
  HISTORY_FOLDER_PATH = Path(_folder)
32
 
33
  IMAGES_FOLDER_PATH = HISTORY_FOLDER_PATH / "images"
 
28
  "locally and will be lost when the Space instance is restarted."
29
  )
30
  _folder = Path(__file__).parent / "history"
31
+ if _folder.startswith("/data") and not os.path.exists("/data"):
32
+ print(
33
+ f"'HISTORY_FOLDER' environment variable is set to '{_folder}' which doesn't exist. User history will be saved "
34
+ "locally and will be lost when the Space instance is restarted."
35
+ )
36
  HISTORY_FOLDER_PATH = Path(_folder)
37
 
38
  IMAGES_FOLDER_PATH = HISTORY_FOLDER_PATH / "images"