tommy24 commited on
Commit
db929e6
·
1 Parent(s): eac8bc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -38,10 +38,13 @@ def greet(prompt):
38
  top_p=1,
39
  frequency_penalty=0,
40
  presence_penalty=0)
41
- response = response['choices'][0]['text']
42
- response = response.strip()
43
- # response = "\n",response,"\n"
44
- return response
 
 
 
45
 
46
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
47
  iface.launch()
 
38
  top_p=1,
39
  frequency_penalty=0,
40
  presence_penalty=0)
41
+ if response != 500:
42
+ response = response['choices'][0]['text']
43
+ response = response.strip()
44
+ # response = "\n",response,"\n"
45
+ return response
46
+ else:
47
+ return "Model is Down. Our team is working on it 😃"
48
 
49
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
50
  iface.launch()