Spaces:
Running
on
Zero
Running
on
Zero
use auth enabled
Browse files- src/app.py +4 -2
src/app.py
CHANGED
|
@@ -114,8 +114,10 @@ sample_data = [
|
|
| 114 |
model_id = "ibm-granite/granite-docling-258M"
|
| 115 |
|
| 116 |
if gr.NO_RELOAD:
|
| 117 |
-
processor = AutoProcessor.from_pretrained(model_id)
|
| 118 |
-
model = Idefics3ForConditionalGeneration.from_pretrained(
|
|
|
|
|
|
|
| 119 |
if not torch.cuda.is_available():
|
| 120 |
model = model.to(device)
|
| 121 |
|
|
|
|
| 114 |
model_id = "ibm-granite/granite-docling-258M"
|
| 115 |
|
| 116 |
if gr.NO_RELOAD:
|
| 117 |
+
processor = AutoProcessor.from_pretrained(model_id, use_auth_token=True)
|
| 118 |
+
model = Idefics3ForConditionalGeneration.from_pretrained(
|
| 119 |
+
model_id, device_map=device, torch_dtype=torch.bfloat16, use_auth_token=True
|
| 120 |
+
)
|
| 121 |
if not torch.cuda.is_available():
|
| 122 |
model = model.to(device)
|
| 123 |
|