LuckyHappyFish commited on
Commit
6fdb57d
·
1 Parent(s): 853b45e
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +1 -1
app.py CHANGED
@@ -121,7 +121,7 @@ if 'uploaded_file' in locals() and uploaded_file is not None:
121
  st.subheader("💡 Healthier Alternatives")
122
  try:
123
  response = openai.ChatCompletion.create(
124
- model="gpt-4o", # You can choose the model you prefer
125
  messages=[
126
  {
127
  "role": "system",
@@ -135,7 +135,7 @@ if 'uploaded_file' in locals() and uploaded_file is not None:
135
  max_tokens=200, # Adjust as needed
136
  temperature=0.7, # Adjust creativity level as needed
137
  )
138
- result = response['choices'][0]['message']['content'].strip()
139
  st.write(result)
140
  except Exception as e:
141
  st.error(f"Unable to generate healthier alternatives: {e}")
 
121
  st.subheader("💡 Healthier Alternatives")
122
  try:
123
  response = openai.ChatCompletion.create(
124
+ model="gpt-4", # You can choose the model you prefer
125
  messages=[
126
  {
127
  "role": "system",
 
135
  max_tokens=200, # Adjust as needed
136
  temperature=0.7, # Adjust creativity level as needed
137
  )
138
+ result = response.choices[0].message.content.strip()
139
  st.write(result)
140
  except Exception as e:
141
  st.error(f"Unable to generate healthier alternatives: {e}")
requirements.txt CHANGED
@@ -4,4 +4,4 @@ torch
4
  Pillow
5
  huggingface_hub
6
  gradio_client
7
- openai
 
4
  Pillow
5
  huggingface_hub
6
  gradio_client
7
+ openai>=1.0.0