vkao8264 commited on
Commit
9b13dd8
·
verified ·
1 Parent(s): b15ede3

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -36,7 +36,7 @@ class EndpointHandler:
36
  if image_data is None:
37
  return [{"error": "Missing 'inputs' key"}]
38
  # Wake up function to restart the server
39
- elif image_data == "wake":
40
  return [{"status": "woken"}]
41
 
42
  # Generation args
@@ -49,7 +49,7 @@ class EndpointHandler:
49
  # Decode base64 image
50
  try:
51
  image = Image.open(io.BytesIO(base64.b64decode(image_data))).convert("RGB")
52
- image.thumbnail([512,512], Image.LANCZOS)
53
  except Exception as e:
54
  return [{"error": f"Image decoding failed: {str(e)}"}]
55
 
 
36
  if image_data is None:
37
  return [{"error": "Missing 'inputs' key"}]
38
  # Wake up function to restart the server
39
+ if image_data == "wake":
40
  return [{"status": "woken"}]
41
 
42
  # Generation args
 
49
  # Decode base64 image
50
  try:
51
  image = Image.open(io.BytesIO(base64.b64decode(image_data))).convert("RGB")
52
+ image.thumbnail([512,512], Image.BILINEAR)
53
  except Exception as e:
54
  return [{"error": f"Image decoding failed: {str(e)}"}]
55