IZERE HIRWA Roger commited on
Commit
87cd19e
·
1 Parent(s): da16377
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -397,7 +397,7 @@ def classify_document():
397
  image = Image.open(io.BytesIO(file_content))
398
 
399
  if image is None:
400
- return jsonify({"error": "Failed to process image"}), 400
401
 
402
  embedding = get_clip_embedding(image)
403
  if embedding is None:
@@ -428,6 +428,7 @@ def classify_document():
428
  document_id = str(uuid.uuid4())
429
  conn = sqlite3.connect(DATABASE_PATH)
430
  cursor = conn.cursor()
 
431
  cursor.execute('''
432
  INSERT INTO documents (id, filename, original_filename, category, similarity, ocr_text, upload_date, file_path)
433
  VALUES (?, ?, ?, ?, ?, ?, ?, ?)
 
397
  image = Image.open(io.BytesIO(file_content))
398
 
399
  if image is None:
400
+ return jsonify({"error": "Failed to process image."}), 400
401
 
402
  embedding = get_clip_embedding(image)
403
  if embedding is None:
 
428
  document_id = str(uuid.uuid4())
429
  conn = sqlite3.connect(DATABASE_PATH)
430
  cursor = conn.cursor()
431
+
432
  cursor.execute('''
433
  INSERT INTO documents (id, filename, original_filename, category, similarity, ocr_text, upload_date, file_path)
434
  VALUES (?, ?, ?, ?, ?, ?, ?, ?)