Wauplin HF staff commited on
Commit
ef22f8a
1 Parent(s): 94cc393

Update gallery_history.py

Browse files
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"