Upload handler.py
Browse files- handler.py +8 -5
handler.py
CHANGED
|
@@ -20,11 +20,16 @@ class EndpointHandler:
|
|
| 20 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 21 |
logging.info(f"Received data: {data}") # Debugging: Print received data
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Extract input data
|
| 24 |
inputs = data.get("inputs", data)
|
| 25 |
-
modal = inputs.get("modal",
|
| 26 |
-
modal_path = inputs.get("modal_path",
|
| 27 |
-
instruct = inputs.get("instruct",
|
| 28 |
|
| 29 |
logging.info(f"Modal: {modal}, Modal Path: {modal_path}, Instruct: {instruct}") # Debugging: Print extracted values
|
| 30 |
|
|
@@ -42,5 +47,3 @@ class EndpointHandler:
|
|
| 42 |
)
|
| 43 |
|
| 44 |
return [{"output": output}]
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 20 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 21 |
logging.info(f"Received data: {data}") # Debugging: Print received data
|
| 22 |
|
| 23 |
+
# Initialize variables
|
| 24 |
+
modal = None
|
| 25 |
+
modal_path = None
|
| 26 |
+
instruct = None
|
| 27 |
+
|
| 28 |
# Extract input data
|
| 29 |
inputs = data.get("inputs", data)
|
| 30 |
+
modal = inputs.get("modal", "video")
|
| 31 |
+
modal_path = inputs.get("modal_path", "")
|
| 32 |
+
instruct = inputs.get("instruct", "")
|
| 33 |
|
| 34 |
logging.info(f"Modal: {modal}, Modal Path: {modal_path}, Instruct: {instruct}") # Debugging: Print extracted values
|
| 35 |
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
return [{"output": output}]
|
|
|
|
|
|