Update app.py
Browse files
app.py
CHANGED
@@ -38,10 +38,13 @@ def greet(prompt):
|
|
38 |
top_p=1,
|
39 |
frequency_penalty=0,
|
40 |
presence_penalty=0)
|
41 |
-
response
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
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()
|