RomeCaesar commited on
Commit
87451ee
·
1 Parent(s): 9d4693d

Enhanced App.

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -47,12 +47,12 @@ if submitted:
47
  ok = 0
48
 
49
 
50
- if question == "":
51
  st.error('We need a question!', icon="🔥")
52
  ok = 0
53
 
54
 
55
- if passage.lower() == "":
56
  st.error('We need something exciting to investigate!', icon="🤖")
57
  ok = 0
58
 
@@ -62,11 +62,9 @@ if submitted:
62
 
63
  model_answer = "true" if torch.sigmoid(model(batch)).item() > 0.5 else "false"
64
 
65
- orig_answer = "true" if answer.lower() == "true" else "false"
66
-
67
  st.markdown("The model's answer is '{}'.".format(model_answer))
68
 
69
- if model_answer == orig_answer:
70
  st.markdown("The model guessed right!")
71
  else:
72
  st.markdown("The model is wrong. We are sorry for the mistake!")
 
47
  ok = 0
48
 
49
 
50
+ if len(question) == 0:
51
  st.error('We need a question!', icon="🔥")
52
  ok = 0
53
 
54
 
55
+ if len(passage) == 0:
56
  st.error('We need something exciting to investigate!', icon="🤖")
57
  ok = 0
58
 
 
62
 
63
  model_answer = "true" if torch.sigmoid(model(batch)).item() > 0.5 else "false"
64
 
 
 
65
  st.markdown("The model's answer is '{}'.".format(model_answer))
66
 
67
+ if model_answer == answer:
68
  st.markdown("The model guessed right!")
69
  else:
70
  st.markdown("The model is wrong. We are sorry for the mistake!")