Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
56 |
|
57 |
-
|
|
|
|
|
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
|