iammraat commited on
Commit
e052503
·
verified ·
1 Parent(s): e6e940c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -6,10 +6,10 @@ import os
6
  import time
7
 
8
  # ------------------------------------------------------
9
- # 1. Load the Specialized OCR Model
10
  # ------------------------------------------------------
11
- # ~0.6B parameters. Much faster than Qwen-2B.
12
- MODEL_ID = "stepfun-ai/GOT-OCR2_0"
13
 
14
  print(f"⏳ Loading {MODEL_ID}...")
15
 
@@ -20,7 +20,7 @@ tokenizer = AutoTokenizer.from_pretrained(
20
  )
21
 
22
  # Load Model
23
- # low_cpu_mem_usage=True helps load it fast into your 18GB RAM
24
  model = AutoModel.from_pretrained(
25
  MODEL_ID,
26
  trust_remote_code=True,
@@ -30,7 +30,6 @@ model = AutoModel.from_pretrained(
30
  pad_token_id=tokenizer.eos_token_id
31
  )
32
 
33
- # Ensure model is in float32 for CPU operations (Half-precision crashes CPUs)
34
  model = model.eval().float()
35
  print(f"✅ {MODEL_ID} Loaded! Ready for handwriting.")
36
 
 
6
  import time
7
 
8
  # ------------------------------------------------------
9
+ # 1. Load the CPU-Patched Model
10
  # ------------------------------------------------------
11
+ # This is the specific repo that fixes the "Found no NVIDIA driver" error.
12
+ MODEL_ID = "srimanth-d/GOT_CPU"
13
 
14
  print(f"⏳ Loading {MODEL_ID}...")
15
 
 
20
  )
21
 
22
  # Load Model
23
+ # low_cpu_mem_usage=True is safe here because this repo is patched for CPU.
24
  model = AutoModel.from_pretrained(
25
  MODEL_ID,
26
  trust_remote_code=True,
 
30
  pad_token_id=tokenizer.eos_token_id
31
  )
32
 
 
33
  model = model.eval().float()
34
  print(f"✅ {MODEL_ID} Loaded! Ready for handwriting.")
35