zesquirrelnator commited on
Commit
d8e9490
·
verified ·
1 Parent(s): 64978c1

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -4
handler.py CHANGED
@@ -23,10 +23,11 @@ class EndpointHandler:
23
  def handle(self, event, context):
24
  """Handle the incoming request."""
25
  try:
26
- # Extract the base64-encoded image and question from the event
27
- inputs = event.get('inputs', {})
28
- input_image = inputs.get('image', '')
29
- question = inputs.get('question', "move to the red ball")
 
30
 
31
  # Preprocess the image
32
  img = self.preprocess_image(input_image)
 
23
  def handle(self, event, context):
24
  """Handle the incoming request."""
25
  try:
26
+ # Extract the inputs from the event
27
+ data = event['body']
28
+ inputs = data.pop("inputs", data)
29
+ input_image = inputs['image']
30
+ question = inputs['question']
31
 
32
  # Preprocess the image
33
  img = self.preprocess_image(input_image)