handle (#24)
Browse files- handle (d3dc09a979805102988eebb3b1786bd561185e0d)
Co-authored-by: ismail hakkı özçelik <ismailhakki37@users.noreply.huggingface.co>
541 unmodified lines542543544545546547548549541 unmodified linesprint(f"EndpointHandler initialized with model_dir: {model_dir}")def __call__(self, payload):"""Main endpoint function - delegates to query function"""return query(payload)def health_check(self):"""Health check endpoint"""541 unmodified lines542543544545546547548549550551552553554555556541 unmodified linesprint(f"EndpointHandler initialized with model_dir: {model_dir}")def __call__(self, payload):"""Main endpoint function - handles Hugging Face payload format"""# Hugging Face sends payload in "inputs" wrapperif "inputs" in payload:# Extract the actual payload from inputs wrapperactual_payload = payload["inputs"]return query(actual_payload)else:# Direct payload (for backward compatibility)return query(payload)def health_check(self):"""Health check endpoint"""
handler.py+9-2