Spaces:
Running
on
Zero
Running
on
Zero
Update gallery_history.py
#48
by
Wauplin
HF staff
- opened
- 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"
|