eBoreal commited on
Commit
b2dff23
·
1 Parent(s): de4c8be

fix and log inputs 2

Browse files
Files changed (2) hide show
  1. handler.py +2 -2
  2. test_inference_endpoint.py +1 -1
handler.py CHANGED
@@ -31,10 +31,10 @@ class EndpointHandler:
31
  A :obj:`list` | `dict`: will be serialized and returned
32
  """
33
  # get inputs
34
- inputs = data.pop("inputs", data)
35
 
36
  if not inputs:
37
- return f"Inputs not in payload got {data.keys()}"
38
 
39
  # get additional date field0
40
  prompt = inputs.pop("prompt", None)
 
31
  A :obj:`list` | `dict`: will be serialized and returned
32
  """
33
  # get inputs
34
+ inputs = data.pop("inputs", None)
35
 
36
  if not inputs:
37
+ return f"Inputs not in payload got {data}"
38
 
39
  # get additional date field0
40
  prompt = inputs.pop("prompt", None)
test_inference_endpoint.py CHANGED
@@ -19,7 +19,7 @@ def call(payload):
19
  response = requests.post(
20
  URL,
21
  headers=headers,
22
- json=json.dumps(payload)
23
  )
24
  print(response)
25
  return response.json()
 
19
  response = requests.post(
20
  URL,
21
  headers=headers,
22
+ json=payload
23
  )
24
  print(response)
25
  return response.json()