Anti-hero commited on
Commit
2188260
1 Parent(s): 6035dd2

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -0
handler.py CHANGED
@@ -26,6 +26,9 @@ class EndpointHandler():
26
  return self.get_top_k(probs[0], k=k)
27
 
28
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
 
 
 
29
  frame = np.array(data.get("frame"))
30
 
31
  if frame is None:
 
26
  return self.get_top_k(probs[0], k=k)
27
 
28
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
29
+ if isinstance(data, str):
30
+ data = json.loads(data) # Parse JSON string to dictionary
31
+
32
  frame = np.array(data.get("frame"))
33
 
34
  if frame is None: