Illia56 commited on
Commit
adf84bb
·
1 Parent(s): 346b91a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -85,13 +85,13 @@ if prompt := st.chat_input("Ask Palm 2 anything..."):
85
  while current_attempt < MAX_ATTEMPTS:
86
  try:
87
  exec(current_code)
88
- break # If successful, break out of the loop
 
89
  except Exception as e:
90
 
91
  st.error("Error running code...")
92
  new_prompt = f"{prompt} . There was an error executing the code: {e}. The last code you provided was: ```{current_code}```. Can you provide a corrected version?"
93
  new_response = predict(new_prompt)
94
- st.success('Code run succesfully!', icon="✅")
95
 
96
  with st.chat_message("assistant", avatar='🌴'):
97
  st.markdown(new_response['content'])
 
85
  while current_attempt < MAX_ATTEMPTS:
86
  try:
87
  exec(current_code)
88
+ st.success('Code run succesfully!', icon="✅")
89
+ break
90
  except Exception as e:
91
 
92
  st.error("Error running code...")
93
  new_prompt = f"{prompt} . There was an error executing the code: {e}. The last code you provided was: ```{current_code}```. Can you provide a corrected version?"
94
  new_response = predict(new_prompt)
 
95
 
96
  with st.chat_message("assistant", avatar='🌴'):
97
  st.markdown(new_response['content'])