Spaces:
Sleeping
Sleeping
OmPrakashSingh1704
commited on
Commit
•
56dfdea
1
Parent(s):
bdb8f99
Update app.py
Browse files
app.py
CHANGED
@@ -276,11 +276,12 @@ if mode:
|
|
276 |
return safe_filename
|
277 |
|
278 |
def save_recipe():
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
|
|
284 |
|
285 |
if st.session_state.recipe is not None:
|
286 |
st.divider()
|
|
|
276 |
return safe_filename
|
277 |
|
278 |
def save_recipe():
|
279 |
+
with st.spinner('WAIT SAVING YOUR DISH...'):
|
280 |
+
filename = create_safe_filename(recipe["name"])
|
281 |
+
os.makedirs('data', exist_ok=True)
|
282 |
+
with open(f'./data/{filename}.pkl', 'wb') as f:
|
283 |
+
pickle.dump(recipe, f)
|
284 |
+
st.session_state.recipe_saved = True
|
285 |
|
286 |
if st.session_state.recipe is not None:
|
287 |
st.divider()
|