Update handler.py
Browse files- handler.py +5 -3
handler.py
CHANGED
|
@@ -38,13 +38,15 @@ class EndpointHandler:
|
|
| 38 |
# Determine device
|
| 39 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 40 |
|
| 41 |
-
# Eagle 2.5 uses
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
-
self.processor =
|
| 45 |
model_id,
|
| 46 |
trust_remote_code=True,
|
| 47 |
token=hf_token,
|
|
|
|
| 48 |
)
|
| 49 |
|
| 50 |
# Set padding side for batch processing
|
|
|
|
| 38 |
# Determine device
|
| 39 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 40 |
|
| 41 |
+
# Eagle 2.5 uses Qwen2VL architecture - use AutoProcessor with use_fast=False
|
| 42 |
+
# to avoid the broken Eagle2_5_VLVideoProcessorFast class
|
| 43 |
+
from transformers import AutoProcessor, Qwen2VLForConditionalGeneration
|
| 44 |
|
| 45 |
+
self.processor = AutoProcessor.from_pretrained(
|
| 46 |
model_id,
|
| 47 |
trust_remote_code=True,
|
| 48 |
token=hf_token,
|
| 49 |
+
use_fast=False, # Avoid the broken video processor
|
| 50 |
)
|
| 51 |
|
| 52 |
# Set padding side for batch processing
|