eagle0504 commited on
Commit
8413cf5
·
1 Parent(s): 3f89a2a

switch L130 to try

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -127,7 +127,7 @@ def main():
127
  st.write(response)
128
 
129
  # Display the response
130
- if response["candidates"][0]["content"]["parts"][0]["text"]:
131
  text_from_response = response["candidates"][0]["content"]["parts"][0][
132
  "text"
133
  ]
@@ -155,7 +155,7 @@ def main():
155
  else:
156
  st.warning("Check gemini's API.")
157
 
158
- else:
159
  st.write("No response from API.")
160
  else:
161
  st.write("API Key is not set. Please set the API Key.")
 
127
  st.write(response)
128
 
129
  # Display the response
130
+ try response["candidates"][0]["content"]["parts"][0]["text"]:
131
  text_from_response = response["candidates"][0]["content"]["parts"][0][
132
  "text"
133
  ]
 
155
  else:
156
  st.warning("Check gemini's API.")
157
 
158
+ except:
159
  st.write("No response from API.")
160
  else:
161
  st.write("API Key is not set. Please set the API Key.")