AmitPress commited on
Commit
dd2d825
1 Parent(s): d95bb26

color change red h

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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
  with col1:
27
- if venomousity.choices[0].text == 'Venomous':
28
- st.markdown(f'<span style="color: red;">{venomousity.choices[0].text}</span>', unsafe_allow_html=True)
29
- else:
30
- st.markdown(f'<span style="color: green;">{venomousity.choices[0].text}</span>', unsafe_allow_html=True)
31
  st.markdown(desc.choices[0].text)
32
  except:
33
  col1.write(f"Error: There might be some network issue")
 
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
+ snake_type = venomousity.choices[0].text
27
  with col1:
28
+ if snake_type == 'Venomous':
29
+ st.markdown(f'<span style="color: red;">{snake_type}</span>', unsafe_allow_html=True)
30
+ elif snake_type == 'Nonvenomous':
31
+ st.markdown(f'<span style="color: green;">{snake_type}</span>', unsafe_allow_html=True)
32
  st.markdown(desc.choices[0].text)
33
  except:
34
  col1.write(f"Error: There might be some network issue")