Update app/utils.py
Browse files- app/utils.py +2 -2
app/utils.py
CHANGED
@@ -13,7 +13,7 @@ class OCRModel:
|
|
13 |
|
14 |
def initialize(self):
|
15 |
# تحميل النموذج مرة واحدة وتخزينه محلياً
|
16 |
-
model_path = os.getenv('MODEL_PATH', '
|
17 |
|
18 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
19 |
model_path,
|
@@ -25,7 +25,7 @@ class OCRModel:
|
|
25 |
model_path,
|
26 |
trust_remote_code=True,
|
27 |
low_cpu_mem_usage=True,
|
28 |
-
device_map='
|
29 |
use_safetensors=True,
|
30 |
pad_token_id=self.tokenizer.eos_token_id
|
31 |
)
|
|
|
13 |
|
14 |
def initialize(self):
|
15 |
# تحميل النموذج مرة واحدة وتخزينه محلياً
|
16 |
+
model_path = os.getenv('MODEL_PATH', 'RufusRubin777/GOT-OCR2_0_CPU')
|
17 |
|
18 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
19 |
model_path,
|
|
|
25 |
model_path,
|
26 |
trust_remote_code=True,
|
27 |
low_cpu_mem_usage=True,
|
28 |
+
device_map='cpu', # سيختار أفضل جهاز متاح
|
29 |
use_safetensors=True,
|
30 |
pad_token_id=self.tokenizer.eos_token_id
|
31 |
)
|