adrianpierce commited on
Commit
e0fbf1b
β€’
1 Parent(s): 1b126d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
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
- # with fs.open(f"/generated/{filename}.json", "w") as f:
222
- # json.dump(recipe, f)
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)