mrfakename commited on
Commit
99f01ee
1 Parent(s): 331c296
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -124,20 +124,24 @@ def downvote_model(model):
124
  conn.commit()
125
  cursor.close()
126
  def a_is_better(model1, model2):
127
- upvote_model(model1)
128
- downvote_model(model2)
 
129
  return reload(model1, model2)
130
  def b_is_better(model1, model2):
131
- upvote_model(model2)
132
- downvote_model(model1)
 
133
  return reload(model1, model2)
134
  def both_bad(model1, model2):
135
- downvote_model(model1)
136
- downvote_model(model2)
 
137
  return reload(model1, model2)
138
  def both_good(model1, model2):
139
- upvote_model(model1)
140
- upvote_model(model2)
 
141
  return reload(model1, model2)
142
  def reload(chosenmodel1=None, chosenmodel2=None):
143
  # Select random splits
 
124
  conn.commit()
125
  cursor.close()
126
  def a_is_better(model1, model2):
127
+ if model1 and model2:
128
+ upvote_model(model1)
129
+ downvote_model(model2)
130
  return reload(model1, model2)
131
  def b_is_better(model1, model2):
132
+ if model1 and model2:
133
+ upvote_model(model2)
134
+ downvote_model(model1)
135
  return reload(model1, model2)
136
  def both_bad(model1, model2):
137
+ if model1 and model2:
138
+ downvote_model(model1)
139
+ downvote_model(model2)
140
  return reload(model1, model2)
141
  def both_good(model1, model2):
142
+ if model1 and model2:
143
+ upvote_model(model1)
144
+ upvote_model(model2)
145
  return reload(model1, model2)
146
  def reload(chosenmodel1=None, chosenmodel2=None):
147
  # Select random splits