Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,7 +119,7 @@ MODEL_ID_3B = "nanonets/Nanonets-OCR2-3B"
|
|
| 119 |
processor_3b = AutoProcessor.from_pretrained(MODEL_ID_3B, trust_remote_code=True)
|
| 120 |
model_3b = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 121 |
MODEL_ID_3B,
|
| 122 |
-
|
| 123 |
trust_remote_code=True,
|
| 124 |
).to(device).eval()
|
| 125 |
|
|
@@ -128,7 +128,7 @@ MODEL_ID_1_5B = "nanonets/Nanonets-OCR2-1.5B-exp"
|
|
| 128 |
processor_1_5b = AutoProcessor.from_pretrained(MODEL_ID_1_5B, trust_remote_code=True)
|
| 129 |
model_1_5b = AutoModelForImageTextToText.from_pretrained(
|
| 130 |
MODEL_ID_1_5B,
|
| 131 |
-
|
| 132 |
trust_remote_code=True,
|
| 133 |
attn_implementation="flash_attention_2"
|
| 134 |
).to(device).eval()
|
|
|
|
| 119 |
processor_3b = AutoProcessor.from_pretrained(MODEL_ID_3B, trust_remote_code=True)
|
| 120 |
model_3b = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 121 |
MODEL_ID_3B,
|
| 122 |
+
torch_dtype=torch.float16,
|
| 123 |
trust_remote_code=True,
|
| 124 |
).to(device).eval()
|
| 125 |
|
|
|
|
| 128 |
processor_1_5b = AutoProcessor.from_pretrained(MODEL_ID_1_5B, trust_remote_code=True)
|
| 129 |
model_1_5b = AutoModelForImageTextToText.from_pretrained(
|
| 130 |
MODEL_ID_1_5B,
|
| 131 |
+
torch_dtype=torch.float16,
|
| 132 |
trust_remote_code=True,
|
| 133 |
attn_implementation="flash_attention_2"
|
| 134 |
).to(device).eval()
|