Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -10,7 +10,7 @@ import torch
|
|
10 |
import numpy as np
|
11 |
from PIL import Image
|
12 |
from ultralytics import YOLO
|
13 |
-
from transformers import AutoProcessor, AutoModelForCausalLM
|
14 |
|
15 |
# Type definitions
|
16 |
class ProcessResponse(BaseModel):
|
@@ -40,10 +40,9 @@ class ModelManager:
|
|
40 |
trust_remote_code=True
|
41 |
)
|
42 |
|
43 |
-
self.model =
|
44 |
-
|
45 |
-
|
46 |
-
trust_remote_code=True
|
47 |
).to(self.device)
|
48 |
|
49 |
return True
|
|
|
10 |
import numpy as np
|
11 |
from PIL import Image
|
12 |
from ultralytics import YOLO
|
13 |
+
from transformers import AutoProcessor, AutoModelForCausalLM,Blip2ForConditionalGeneration
|
14 |
|
15 |
# Type definitions
|
16 |
class ProcessResponse(BaseModel):
|
|
|
40 |
trust_remote_code=True
|
41 |
)
|
42 |
|
43 |
+
self.model = Blip2ForConditionalGeneration.from_pretrained("banao-tech/OmniParser",torch_dtype=torch.float16,
|
44 |
+
trust_remote_code=True)
|
45 |
+
|
|
|
46 |
).to(self.device)
|
47 |
|
48 |
return True
|