Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,6 +103,7 @@ MODEL_ID_M = "nvidia/Cosmos-Reason1-7B"
|
|
| 103 |
processor_m = AutoProcessor.from_pretrained(MODEL_ID_M, trust_remote_code=True)
|
| 104 |
model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 105 |
MODEL_ID_M,
|
|
|
|
| 106 |
trust_remote_code=True,
|
| 107 |
torch_dtype=torch.float16
|
| 108 |
).to(device).eval()
|
|
@@ -112,6 +113,7 @@ MODEL_ID_X = "prithivMLmods/docscopeOCR-7B-050425-exp"
|
|
| 112 |
processor_x = AutoProcessor.from_pretrained(MODEL_ID_X, trust_remote_code=True)
|
| 113 |
model_x = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 114 |
MODEL_ID_X,
|
|
|
|
| 115 |
trust_remote_code=True,
|
| 116 |
torch_dtype=torch.float16
|
| 117 |
).to(device).eval()
|
|
@@ -121,6 +123,7 @@ MODEL_ID_Z = "Ertugrul/Qwen2.5-VL-7B-Captioner-Relaxed"
|
|
| 121 |
processor_z = AutoProcessor.from_pretrained(MODEL_ID_Z, trust_remote_code=True)
|
| 122 |
model_z = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 123 |
MODEL_ID_Z,
|
|
|
|
| 124 |
trust_remote_code=True,
|
| 125 |
torch_dtype=torch.float16
|
| 126 |
).to(device).eval()
|
|
@@ -130,6 +133,7 @@ MODEL_ID_V = "prithivMLmods/visionOCR-3B-061125"
|
|
| 130 |
processor_v = AutoProcessor.from_pretrained(MODEL_ID_V, trust_remote_code=True)
|
| 131 |
model_v = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 132 |
MODEL_ID_V,
|
|
|
|
| 133 |
trust_remote_code=True,
|
| 134 |
torch_dtype=torch.float16
|
| 135 |
).to(device).eval()
|
|
|
|
| 103 |
processor_m = AutoProcessor.from_pretrained(MODEL_ID_M, trust_remote_code=True)
|
| 104 |
model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 105 |
MODEL_ID_M,
|
| 106 |
+
attn_implementation="flash_attention_2",
|
| 107 |
trust_remote_code=True,
|
| 108 |
torch_dtype=torch.float16
|
| 109 |
).to(device).eval()
|
|
|
|
| 113 |
processor_x = AutoProcessor.from_pretrained(MODEL_ID_X, trust_remote_code=True)
|
| 114 |
model_x = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 115 |
MODEL_ID_X,
|
| 116 |
+
attn_implementation="flash_attention_2",
|
| 117 |
trust_remote_code=True,
|
| 118 |
torch_dtype=torch.float16
|
| 119 |
).to(device).eval()
|
|
|
|
| 123 |
processor_z = AutoProcessor.from_pretrained(MODEL_ID_Z, trust_remote_code=True)
|
| 124 |
model_z = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 125 |
MODEL_ID_Z,
|
| 126 |
+
attn_implementation="flash_attention_2",
|
| 127 |
trust_remote_code=True,
|
| 128 |
torch_dtype=torch.float16
|
| 129 |
).to(device).eval()
|
|
|
|
| 133 |
processor_v = AutoProcessor.from_pretrained(MODEL_ID_V, trust_remote_code=True)
|
| 134 |
model_v = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 135 |
MODEL_ID_V,
|
| 136 |
+
attn_implementation="flash_attention_2",
|
| 137 |
trust_remote_code=True,
|
| 138 |
torch_dtype=torch.float16
|
| 139 |
).to(device).eval()
|