banao-tech commited on
Commit
1ec8443
·
verified ·
1 Parent(s): cc59622

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -5
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 = AutoModelForCausalLM.from_pretrained(
44
- "banao-tech/OmniParse",
45
- torch_dtype=torch.float16,
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