swastik-kapture commited on
Commit
3450292
1 Parent(s): ec8751c

Update to app

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -30,12 +30,10 @@ def main():
30
  # default color
31
  color = "white"
32
  # get the color based on label
33
- if label == "LABEL_0":
34
  color = "green"
35
- label = "No Offense"
36
- elif label == "LABEL_1":
37
  color = "red"
38
- label = "Offensive"
39
  st.session_state.conversation_history.append(('assistant', f"<div style='background-color: {color}; width: auto; height: 50px;'>Label: {label}; Score: {score:.2f}</div>", time.time()))
40
  # Display chat history
41
  for sender, message, timestamp in st.session_state.conversation_history:
 
30
  # default color
31
  color = "white"
32
  # get the color based on label
33
+ if label == "not offensive":
34
  color = "green"
35
+ elif label == "offensive":
 
36
  color = "red"
 
37
  st.session_state.conversation_history.append(('assistant', f"<div style='background-color: {color}; width: auto; height: 50px;'>Label: {label}; Score: {score:.2f}</div>", time.time()))
38
  # Display chat history
39
  for sender, message, timestamp in st.session_state.conversation_history: