Update app.py
Browse files
app.py
CHANGED
|
@@ -33,12 +33,13 @@ except Exception:
|
|
| 33 |
|
| 34 |
# ---- Bootstrap pipeline (CPU only) ----
|
| 35 |
pipe = pipeline(
|
| 36 |
-
|
| 37 |
-
model=
|
| 38 |
-
device=DEVICE, # <- forces CPU
|
| 39 |
-
dtype=DTYPE, # <- CPU dtype
|
| 40 |
trust_remote_code=True,
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
| 42 |
)
|
| 43 |
|
| 44 |
def _extract_text(obj):
|
|
|
|
| 33 |
|
| 34 |
# ---- Bootstrap pipeline (CPU only) ----
|
| 35 |
pipe = pipeline(
|
| 36 |
+
"image-text-to-text",
|
| 37 |
+
model="vikhyatk/moondream2",
|
|
|
|
|
|
|
| 38 |
trust_remote_code=True,
|
| 39 |
+
revision="6b714b26eea5cbd9f31e4edb2541c170afa935ba", # pin to a known commit
|
| 40 |
+
device="cpu",
|
| 41 |
+
dtype=torch.float32,
|
| 42 |
+
use_fast=True,
|
| 43 |
)
|
| 44 |
|
| 45 |
def _extract_text(obj):
|