Small edits

This commit is contained in:
Jake Poznanski 2025-03-19 09:27:41 -07:00
parent 46ffbe9324
commit 14e3f6e97b
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ def init_model(model_name: str = "ds4sd/SmolDocling-256M-preview"):
torch_dtype=torch.bfloat16,
# _attn_implementation="flash_attention_2" if device.type == "cuda" else "eager",
_attn_implementation="eager",
).to(device)
).eval().to(device)
_cached_model = model
_cached_processor = processor

View File

@ -47,7 +47,7 @@ def run_transformers(
if _cached_model is None:
model = Qwen2VLForConditionalGeneration.from_pretrained(model, torch_dtype=torch.bfloat16).eval()
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-7B-Instruct")
model.to(device)
model = model.to(device)
_cached_model = model
_cached_processor = processor