AmitPress commited on
Commit
4fb7029
·
1 Parent(s): fd89b64

color change

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -23,7 +23,10 @@ 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
- col1.write(venomousity.choices[0].text)
 
 
 
27
  col1.write(desc.choices[0].text)
28
  except:
29
  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
+ if venomousity.choices[0].text == 'venomous':
27
+ col1.write(f':red {venomousity.choices[0].text}')
28
+ else:
29
+ col1.write(f':green {venomousity.choices[0].text}')
30
  col1.write(desc.choices[0].text)
31
  except:
32
  col1.write(f"Error: There might be some network issue")