merve HF staff commited on
Commit
aa93800
1 Parent(s): 7d619b2

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -7,7 +7,7 @@ class EndpointHandler:
7
  def __init__(self, path=""):
8
  # load model and processor from path
9
  self.processor = AutoProcessor.from_pretrained(path)
10
- self.model = Blip2ForConditionalGeneration.from_pretrained(path, torch_dtype=torch.float16).to("cuda")
11
 
12
  def __call__(self, inputs: Dict[str, Any]) -> Dict[str, str]:
13
  """
 
7
  def __init__(self, path=""):
8
  # load model and processor from path
9
  self.processor = AutoProcessor.from_pretrained(path)
10
+ self.model = Blip2ForConditionalGeneration.from_pretrained(path, device_map="auto", load_in_8bit=True).to("cuda")
11
 
12
  def __call__(self, inputs: Dict[str, Any]) -> Dict[str, str]:
13
  """