rehan953 commited on
Commit
34664c8
Β·
verified Β·
1 Parent(s): 7282022

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -13,7 +13,7 @@ logging.basicConfig(level=logging.INFO)
13
  # Loads from HF Hub at runtime β€” no local storage needed in the Space
14
  MERGED_MODEL_DIR = os.environ.get("MODEL_DIR", "SimpleCodeAI/glm-ocr-finetuned")
15
 
16
- RENDER_SCALE = 3.0
17
  PAD_LEFT_FRAC = 0.035
18
  PAD_RIGHT_FRAC = 0.10
19
  PAD_TOP_FRAC = 0.018
@@ -27,8 +27,9 @@ UNSHARP_PERCENT = 76
27
  UNSHARP_THRESHOLD = 1
28
 
29
  PAGE_PNG_COMPRESS_LEVEL = 3
30
- MAX_NEW_TOKENS = 2048
31
- MAX_IMAGE_SIDE = 1344 # resize longest side to this before inference
 
32
 
33
  # ── Model singleton ───────────────────────────────────────────────────────────
34
  _model = None
 
13
  # Loads from HF Hub at runtime β€” no local storage needed in the Space
14
  MERGED_MODEL_DIR = os.environ.get("MODEL_DIR", "SimpleCodeAI/glm-ocr-finetuned")
15
 
16
+
17
  PAD_LEFT_FRAC = 0.035
18
  PAD_RIGHT_FRAC = 0.10
19
  PAD_TOP_FRAC = 0.018
 
27
  UNSHARP_THRESHOLD = 1
28
 
29
  PAGE_PNG_COMPRESS_LEVEL = 3
30
+ RENDER_SCALE = 2.0 # was 3.0 β€” reduce render size so resize isn't as aggressive
31
+ MAX_IMAGE_SIDE = 1568 # was 1344 β€” allow slightly larger input to model
32
+ MAX_NEW_TOKENS = 3000 # resize longest side to this before inference
33
 
34
  # ── Model singleton ───────────────────────────────────────────────────────────
35
  _model = None