jlynxdev commited on
Commit
8d7aa45
·
1 Parent(s): 818caec

add print statement to handler

Browse files
Files changed (1) hide show
  1. handler.py +5 -4
handler.py CHANGED
@@ -33,10 +33,11 @@ class EndpointHandler:
33
 
34
  def __call__(self, data: dict[str, any]) -> dict[str, str]:
35
  base64_image = data.get('inputs')
36
- image = self._decode_base64_image(base64_image)
37
- output = self.generator(image)
38
- output = output.squeeze(0)
39
- output_image = transforms.ToPILImage()(output)
 
40
  output_image = output_image.convert('RGB')
41
  output_buffer = io.BytesIO()
42
  output_image.save(output_buffer, format="png")
 
33
 
34
  def __call__(self, data: dict[str, any]) -> dict[str, str]:
35
  base64_image = data.get('inputs')
36
+ input_tensor = self._decode_base64_image(base64_image)
37
+ print('Input tensor shape: ' + str(input_tensor.shape))
38
+ output_tensor = self.generator(input_tensor)
39
+ output_tensor = output_tensor.squeeze(0)
40
+ output_image = transforms.ToPILImage()(output_tensor)
41
  output_image = output_image.convert('RGB')
42
  output_buffer = io.BytesIO()
43
  output_image.save(output_buffer, format="png")