Spaces:
Sleeping
Sleeping
Commit
·
7e66262
1
Parent(s):
4b50ba0
Update Home.py
Browse files
Home.py
CHANGED
@@ -223,6 +223,8 @@ if st.session_state.gpt_response is not None:
|
|
223 |
st.markdown(recipe_md)
|
224 |
#st.button("Copy to Clipboard", on_click=on_copy_click, args=(recipe_md,))
|
225 |
# write to file
|
226 |
-
|
227 |
# with open(f"/data/generated/{filename}.json", "w") as f:
|
228 |
-
# json.dump(recipe, f)
|
|
|
|
|
|
223 |
st.markdown(recipe_md)
|
224 |
#st.button("Copy to Clipboard", on_click=on_copy_click, args=(recipe_md,))
|
225 |
# write to file
|
226 |
+
filename = create_safe_filename(recipe["name"])
|
227 |
# with open(f"/data/generated/{filename}.json", "w") as f:
|
228 |
+
# json.dump(recipe, f)
|
229 |
+
with open(f'/data/{filename}.json', 'w') as f:
|
230 |
+
json.dump(recipe, f, indent=4) # `indent=4` is for pretty-printing the JSON file
|