CanerDedeoglu ismailhakki37 commited on
Commit
c35985e
·
verified ·
1 Parent(s): 17e4f3c

- handle (d3dc09a979805102988eebb3b1786bd561185e0d)


Co-authored-by: ismail hakkı özçelik <ismailhakki37@users.noreply.huggingface.co>

Files changed (1) hide show
  1. handler.py +9 -2
handler.py CHANGED
@@ -542,8 +542,15 @@ class EndpointHandler:
542
  print(f"EndpointHandler initialized with model_dir: {model_dir}")
543
 
544
  def __call__(self, payload):
545
- """Main endpoint function - delegates to query function"""
546
- return query(payload)
 
 
 
 
 
 
 
547
 
548
  def health_check(self):
549
  """Health check endpoint"""
 
542
  print(f"EndpointHandler initialized with model_dir: {model_dir}")
543
 
544
  def __call__(self, payload):
545
+ """Main endpoint function - handles Hugging Face payload format"""
546
+ # Hugging Face sends payload in "inputs" wrapper
547
+ if "inputs" in payload:
548
+ # Extract the actual payload from inputs wrapper
549
+ actual_payload = payload["inputs"]
550
+ return query(actual_payload)
551
+ else:
552
+ # Direct payload (for backward compatibility)
553
+ return query(payload)
554
 
555
  def health_check(self):
556
  """Health check endpoint"""