Hongxuan Li commited on
Commit
9308c9e
·
1 Parent(s): d21a961

add handler

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -10,7 +10,7 @@ class EndpointHandler():
10
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
11
  self.processor = NougatProcessor.from_pretrained(path)
12
  self.model = VisionEncoderDecoderModel.from_pretrained(path)
13
- self.model = model.to(self.device)
14
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
15
  """
16
  Args:
 
10
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
11
  self.processor = NougatProcessor.from_pretrained(path)
12
  self.model = VisionEncoderDecoderModel.from_pretrained(path)
13
+ self.model = self.model.to(self.device)
14
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
15
  """
16
  Args: