Spaces:
Runtime error
Runtime error
AmitPress
commited on
Commit
·
42c3a3e
1
Parent(s):
4fb7029
color change a little bit
Browse files
app.py
CHANGED
|
@@ -23,11 +23,12 @@ if photo:
|
|
| 23 |
genus, species = txt.split(' ')
|
| 24 |
venomousity = openai.Completion.create(engine="text-davinci-003", prompt=f"Is {genus} {species} is venomous? if venomous just say venomous otherwise say nonvenomous", max_tokens=50)
|
| 25 |
desc = openai.Completion.create(engine="text-davinci-003", prompt=f"Give a short description of {genus} {species}", max_tokens=500)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 31 |
except:
|
| 32 |
col1.write(f"Error: There might be some network issue")
|
| 33 |
else:
|
|
|
|
| 23 |
genus, species = txt.split(' ')
|
| 24 |
venomousity = openai.Completion.create(engine="text-davinci-003", prompt=f"Is {genus} {species} is venomous? if venomous just say venomous otherwise say nonvenomous", max_tokens=50)
|
| 25 |
desc = openai.Completion.create(engine="text-davinci-003", prompt=f"Give a short description of {genus} {species}", max_tokens=500)
|
| 26 |
+
with col1:
|
| 27 |
+
if venomousity.choices[0].text == 'Venomous':
|
| 28 |
+
st.markdown(f'<h1 style="color:red;">{venomousity.choices[0].text}</h1>')
|
| 29 |
+
else:
|
| 30 |
+
st.markdown(f'<h1 style="color:green;">{venomousity.choices[0].text}</h1>')
|
| 31 |
+
st.markdown(desc.choices[0].text)
|
| 32 |
except:
|
| 33 |
col1.write(f"Error: There might be some network issue")
|
| 34 |
else:
|