Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -109,9 +109,11 @@ def delete_file(path_: str):
|
|
109 |
if os.path.exists(path_):
|
110 |
os.remove(path_)
|
111 |
|
112 |
-
|
113 |
def get_upload_path():
|
114 |
upload_file_path = os.path.join('.', 'uploads')
|
|
|
|
|
115 |
upload_filename = "input.jpg"
|
116 |
upload_file_path = os.path.join(upload_file_path, upload_filename)
|
117 |
return upload_file_path
|
|
|
109 |
if os.path.exists(path_):
|
110 |
os.remove(path_)
|
111 |
|
112 |
+
@st.cache_resource
|
113 |
def get_upload_path():
|
114 |
upload_file_path = os.path.join('.', 'uploads')
|
115 |
+
if not os.path.exists(upload_file_path):
|
116 |
+
os.makedirs(upload_file_path)
|
117 |
upload_filename = "input.jpg"
|
118 |
upload_file_path = os.path.join(upload_file_path, upload_filename)
|
119 |
return upload_file_path
|