mirror of
https://github.com/allenai/olmocr.git
synced 2025-09-26 17:04:02 +00:00
Lints
This commit is contained in:
parent
1e42e5ea9a
commit
f2951f3f78
@ -16,7 +16,6 @@ import json
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
import shutil
|
||||
import sqlite3
|
||||
import threading
|
||||
import unittest
|
||||
@ -28,6 +27,7 @@ from playwright.sync_api import sync_playwright
|
||||
|
||||
# --- New SQLite Cache Implementation ---
|
||||
|
||||
|
||||
class EquationCache:
|
||||
def __init__(self, db_path: Optional[str] = None):
|
||||
if db_path is None:
|
||||
@ -44,14 +44,16 @@ class EquationCache:
|
||||
conn = sqlite3.connect(self.db_path)
|
||||
c = conn.cursor()
|
||||
# Added an 'error' column to store rendering errors
|
||||
c.execute('''
|
||||
c.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS equations (
|
||||
eq_hash TEXT PRIMARY KEY,
|
||||
mathml TEXT,
|
||||
spans TEXT,
|
||||
error TEXT
|
||||
)
|
||||
''')
|
||||
"""
|
||||
)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
@ -126,6 +128,7 @@ equation_cache = EquationCache()
|
||||
# Thread-local storage for Playwright and browser instances
|
||||
_thread_local = threading.local()
|
||||
|
||||
|
||||
@dataclass
|
||||
class BoundingBox:
|
||||
x: float
|
||||
|
Loading…
x
Reference in New Issue
Block a user