chipling commited on
Commit
ea88869
·
verified ·
1 Parent(s): 3f3da1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -3,8 +3,10 @@ import os
3
  # --- CPU OPTIMIZATION FLAGS (Must be set before importing Paddle) ---
4
  # Hugging Face Free Tier has 2 vCPUs. Limiting threads prevents overhead.
5
  os.environ["OMP_NUM_THREADS"] = "2"
6
- # Enables Intel CPU math acceleration
7
- os.environ["FLAGS_use_mkldnn"] = "1"
 
 
8
 
9
  import shutil
10
  import json
@@ -18,7 +20,7 @@ app = FastAPI(
18
  description="Optimized PaddleOCR-VL extraction"
19
  )
20
 
21
- print("Initializing PaddleOCR-VL Pipeline (MKLDNN Enabled)...")
22
  pipeline = PaddleOCRVL()
23
  print("Pipeline ready!")
24
 
 
3
  # --- CPU OPTIMIZATION FLAGS (Must be set before importing Paddle) ---
4
  # Hugging Face Free Tier has 2 vCPUs. Limiting threads prevents overhead.
5
  os.environ["OMP_NUM_THREADS"] = "2"
6
+
7
+ # DISABLE MKLDNN: PaddleOCR-VL transformer ops are currently incompatible
8
+ # with the oneDNN instruction converter in Paddle's new executor.
9
+ os.environ["FLAGS_use_mkldnn"] = "0"
10
 
11
  import shutil
12
  import json
 
20
  description="Optimized PaddleOCR-VL extraction"
21
  )
22
 
23
+ print("Initializing PaddleOCR-VL Pipeline (MKLDNN Disabled)...")
24
  pipeline = PaddleOCRVL()
25
  print("Pipeline ready!")
26