dhmeltzer commited on
Commit
2b72a19
1 Parent(s): f10d1e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -52,9 +52,12 @@ def main():
52
 
53
  input_data = json.dumps({'inputs':user_input})
54
  r = requests.get(url,data=input_data,headers=headers)
55
- output = r.json()[0]['generated_text']
 
56
 
57
- st.write(f'**{name}**: {output}')
 
 
58
 
59
  model_engine = "gpt-3.5-turbo"
60
  # Max tokens to produce
 
52
 
53
  input_data = json.dumps({'inputs':user_input})
54
  r = requests.get(url,data=input_data,headers=headers)
55
+ try:
56
+ output = r.json()[0]['generated_text']
57
 
58
+ st.write(f'**{name}**: {output}')
59
+ except:
60
+ st.write(f'**{name}**: There was an error when calling the model. Please resubmit the question.')
61
 
62
  model_engine = "gpt-3.5-turbo"
63
  # Max tokens to produce