|
54 | 54 | app = FastAPI() |
55 | 55 | router = APIRouter() |
56 | 56 |
|
57 | | -IS_CHIPPER_PROCESSING = False |
| 57 | +Is_Chipper_Processing = False |
58 | 58 |
|
59 | 59 | DEFAULT_MIMETYPES = ( |
60 | 60 | "application/pdf,application/msword,image/jpeg,image/png,text/markdown," |
@@ -109,7 +109,7 @@ def get_pdf_splits(pdf_pages: List[PageObject], split_size: int = 1): |
109 | 109 | for page in pdf_pages[offset:end]: |
110 | 110 | new_pdf.add_page(page) |
111 | 111 |
|
112 | | - new_pdf.write(pdf_buffer) |
| 112 | + new_pdf.write(pdf_buffer) # type: ignore |
113 | 113 | pdf_buffer.seek(0) |
114 | 114 |
|
115 | 115 | yield (pdf_buffer.read(), offset) |
@@ -255,19 +255,19 @@ class ChipperMemoryProtection: |
255 | 255 | """ |
256 | 256 |
|
257 | 257 | def __enter__(self): |
258 | | - global IS_CHIPPER_PROCESSING |
259 | | - if IS_CHIPPER_PROCESSING: |
| 258 | + global Is_Chipper_Processing |
| 259 | + if Is_Chipper_Processing: |
260 | 260 | # Log here so we can track how often it happens |
261 | 261 | logger.error("Chipper is already is use") |
262 | 262 | raise HTTPException( |
263 | 263 | status_code=503, detail="Server is under heavy load. Please try again later." |
264 | 264 | ) |
265 | 265 |
|
266 | | - IS_CHIPPER_PROCESSING = True |
| 266 | + Is_Chipper_Processing = True |
267 | 267 |
|
268 | 268 | def __exit__(self, exc_type, exc_value, exc_tb): |
269 | | - global IS_CHIPPER_PROCESSING |
270 | | - IS_CHIPPER_PROCESSING = False |
| 269 | + global Is_Chipper_Processing |
| 270 | + Is_Chipper_Processing = False |
271 | 271 |
|
272 | 272 |
|
273 | 273 | def pipeline_api( |
|
0 commit comments