mrfakename commited on
Commit
0899fcd
1 Parent(s): 4b50099

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -192,7 +192,7 @@ def upvote_model(model, uname):
192
  cursor.execute('UPDATE model SET upvote = upvote + 1 WHERE name = ?', (model,))
193
  if cursor.rowcount == 0:
194
  cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 1, 0)', (model,))
195
- cursor.execute('INSERT INTO vote (username, model, vote)', (uname, model, 1))
196
  conn.commit()
197
  cursor.close()
198
 
@@ -203,7 +203,7 @@ def downvote_model(model, uname):
203
  cursor.execute('UPDATE model SET downvote = downvote + 1 WHERE name = ?', (model,))
204
  if cursor.rowcount == 0:
205
  cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 0, 1)', (model,))
206
- cursor.execute('INSERT INTO vote (username, model, vote)', (uname, model, -1))
207
  conn.commit()
208
  cursor.close()
209
  def a_is_better(model1, model2, profile: gr.OAuthProfile | None):
 
192
  cursor.execute('UPDATE model SET upvote = upvote + 1 WHERE name = ?', (model,))
193
  if cursor.rowcount == 0:
194
  cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 1, 0)', (model,))
195
+ cursor.execute('INSERT INTO vote (username, model, vote)', (uname, model, 1,))
196
  conn.commit()
197
  cursor.close()
198
 
 
203
  cursor.execute('UPDATE model SET downvote = downvote + 1 WHERE name = ?', (model,))
204
  if cursor.rowcount == 0:
205
  cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 0, 1)', (model,))
206
+ cursor.execute('INSERT INTO vote (username, model, vote)', (uname, model, -1,))
207
  conn.commit()
208
  cursor.close()
209
  def a_is_better(model1, model2, profile: gr.OAuthProfile | None):