Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mrfakename
commited on
Commit
•
63f3958
1
Parent(s):
8e14d20
Update app.py
Browse files
app.py
CHANGED
@@ -359,7 +359,7 @@ def upvote_model(model, uname):
|
|
359 |
cursor.execute('UPDATE model SET upvote = upvote + 1 WHERE name = ?', (model,))
|
360 |
if cursor.rowcount == 0:
|
361 |
cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 1, 0)', (model,))
|
362 |
-
|
363 |
with scheduler.lock:
|
364 |
conn.commit()
|
365 |
cursor.close()
|
@@ -376,7 +376,7 @@ def downvote_model(model, uname):
|
|
376 |
cursor.execute('UPDATE model SET downvote = downvote + 1 WHERE name = ?', (model,))
|
377 |
if cursor.rowcount == 0:
|
378 |
cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 0, 1)', (model,))
|
379 |
-
|
380 |
with scheduler.lock:
|
381 |
conn.commit()
|
382 |
cursor.close()
|
|
|
359 |
cursor.execute('UPDATE model SET upvote = upvote + 1 WHERE name = ?', (model,))
|
360 |
if cursor.rowcount == 0:
|
361 |
cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 1, 0)', (model,))
|
362 |
+
cursor.execute('INSERT INTO vote (username, model, vote) VALUES (?, ?, ?)', (uname, model, 1,))
|
363 |
with scheduler.lock:
|
364 |
conn.commit()
|
365 |
cursor.close()
|
|
|
376 |
cursor.execute('UPDATE model SET downvote = downvote + 1 WHERE name = ?', (model,))
|
377 |
if cursor.rowcount == 0:
|
378 |
cursor.execute('INSERT OR REPLACE INTO model (name, upvote, downvote) VALUES (?, 0, 1)', (model,))
|
379 |
+
cursor.execute('INSERT INTO vote (username, model, vote) VALUES (?, ?, ?)', (uname, model, -1,))
|
380 |
with scheduler.lock:
|
381 |
conn.commit()
|
382 |
cursor.close()
|