Aktualizovat sk1/backend/app.py
This commit is contained in:
parent
71e32912cd
commit
55dc649360
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
from flask import Flask, request, jsonify, Response, send_from_directory
|
from flask import Flask, request, jsonify, Response, send_from_directory
|
||||||
from flask_cors import CORS
|
from flask_cors import CORS
|
||||||
from flask_caching import Cache
|
from flask_caching import Cache
|
||||||
@ -64,7 +63,6 @@ def sync_history_file():
|
|||||||
def save_to_history(text, prediction_label):
|
def save_to_history(text, prediction_label):
|
||||||
timestamp = get_current_time()
|
timestamp = get_current_time()
|
||||||
try:
|
try:
|
||||||
# Проверка на дубликат
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"SELECT 1 FROM history WHERE text = %s AND prediction = %s",
|
"SELECT 1 FROM history WHERE text = %s AND prediction = %s",
|
||||||
(text, prediction_label)
|
(text, prediction_label)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user