Spaces:
Running
Running
adrianpierce
commited on
Commit
β’
e0fbf1b
1
Parent(s):
1b126d9
Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,6 @@ from openai import OpenAI
|
|
7 |
import secrets
|
8 |
from huggingface_hub import HfFileSystem
|
9 |
|
10 |
-
fs = HfFileSystem()
|
11 |
-
|
12 |
client = OpenAI(
|
13 |
api_key = st.secrets["open_ai_key"]
|
14 |
)
|
@@ -218,6 +216,5 @@ if st.session_state.gpt_response is not None:
|
|
218 |
# st.button("π", on_click=on_copy_click, args=(full_response,))
|
219 |
# write to file
|
220 |
filename = create_safe_filename(recipe["name"])
|
221 |
-
|
222 |
-
|
223 |
-
recipe.to_json(f"/generated/{filename}.json")
|
|
|
7 |
import secrets
|
8 |
from huggingface_hub import HfFileSystem
|
9 |
|
|
|
|
|
10 |
client = OpenAI(
|
11 |
api_key = st.secrets["open_ai_key"]
|
12 |
)
|
|
|
216 |
# st.button("π", on_click=on_copy_click, args=(full_response,))
|
217 |
# write to file
|
218 |
filename = create_safe_filename(recipe["name"])
|
219 |
+
with open(f"/data/generated/{filename}.json", "w") as f:
|
220 |
+
json.dump(recipe, f)
|
|