Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,6 +116,7 @@ MODEL_ID_M = "nanonets/Nanonets-OCR-s"
|
|
| 116 |
processor_m = AutoProcessor.from_pretrained(MODEL_ID_M, trust_remote_code=True)
|
| 117 |
model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 118 |
MODEL_ID_M,
|
|
|
|
| 119 |
trust_remote_code=True,
|
| 120 |
torch_dtype=torch.float16
|
| 121 |
).to(device).eval()
|
|
@@ -130,6 +131,7 @@ processor_g = AutoProcessor.from_pretrained(
|
|
| 130 |
)
|
| 131 |
model_g = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 132 |
MODEL_ID_G,
|
|
|
|
| 133 |
trust_remote_code=True,
|
| 134 |
subfolder=SUBFOLDER,
|
| 135 |
torch_dtype=torch.float16
|
|
@@ -140,6 +142,7 @@ MODEL_ID_L = "scb10x/typhoon-ocr-7b"
|
|
| 140 |
processor_l = AutoProcessor.from_pretrained(MODEL_ID_L, trust_remote_code=True)
|
| 141 |
model_l = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 142 |
MODEL_ID_L,
|
|
|
|
| 143 |
trust_remote_code=True,
|
| 144 |
torch_dtype=torch.float16
|
| 145 |
).to(device).eval()
|
|
@@ -158,6 +161,7 @@ MODEL_ID_N = "Kwai-Keye/Thyme-RL"
|
|
| 158 |
processor_n = AutoProcessor.from_pretrained(MODEL_ID_N, trust_remote_code=True)
|
| 159 |
model_n = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 160 |
MODEL_ID_N,
|
|
|
|
| 161 |
trust_remote_code=True,
|
| 162 |
torch_dtype=torch.float16
|
| 163 |
).to(device).eval()
|
|
|
|
| 116 |
processor_m = AutoProcessor.from_pretrained(MODEL_ID_M, trust_remote_code=True)
|
| 117 |
model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 118 |
MODEL_ID_M,
|
| 119 |
+
attn_implementation="flash_attention_2",
|
| 120 |
trust_remote_code=True,
|
| 121 |
torch_dtype=torch.float16
|
| 122 |
).to(device).eval()
|
|
|
|
| 131 |
)
|
| 132 |
model_g = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 133 |
MODEL_ID_G,
|
| 134 |
+
attn_implementation="flash_attention_2",
|
| 135 |
trust_remote_code=True,
|
| 136 |
subfolder=SUBFOLDER,
|
| 137 |
torch_dtype=torch.float16
|
|
|
|
| 142 |
processor_l = AutoProcessor.from_pretrained(MODEL_ID_L, trust_remote_code=True)
|
| 143 |
model_l = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 144 |
MODEL_ID_L,
|
| 145 |
+
attn_implementation="flash_attention_2",
|
| 146 |
trust_remote_code=True,
|
| 147 |
torch_dtype=torch.float16
|
| 148 |
).to(device).eval()
|
|
|
|
| 161 |
processor_n = AutoProcessor.from_pretrained(MODEL_ID_N, trust_remote_code=True)
|
| 162 |
model_n = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 163 |
MODEL_ID_N,
|
| 164 |
+
attn_implementation="flash_attention_2",
|
| 165 |
trust_remote_code=True,
|
| 166 |
torch_dtype=torch.float16
|
| 167 |
).to(device).eval()
|