b2u commited on
Commit
22c8159
·
1 Parent(s): b9a9837

debugging webhooks

Browse files
Files changed (1) hide show
  1. model.py +12 -3
model.py CHANGED
@@ -141,12 +141,21 @@ class BertClassifier(LabelStudioMLBase):
141
  logger.info(f"Returning {len(predictions)} predictions")
142
  return predictions
143
 
144
- def fit(self, event, data, **kwargs):
145
  """Train the model on the labeled data."""
146
- logger.info(f"Received event: {event}")
 
 
 
 
 
 
 
 
 
147
 
148
  # Check if the event is one that should trigger training
149
- if event in ['ANNOTATION_CREATED', 'ANNOTATION_UPDATED']:
150
  try:
151
  # Fetch the full annotation data if not included in the payload
152
  task_id = data.get('task_id')
 
141
  logger.info(f"Returning {len(predictions)} predictions")
142
  return predictions
143
 
144
+ def fit(self, event_data, data=None, **kwargs):
145
  """Train the model on the labeled data."""
146
+ # Debug logging for all incoming data
147
+ logger.info("=== WEBHOOK DEBUG INFO ===")
148
+ logger.info(f"event_data type: {type(event_data)}")
149
+ logger.info(f"event_data content: {event_data}")
150
+ logger.info(f"data type: {type(data)}")
151
+ logger.info(f"data content: {data}")
152
+ logger.info(f"kwargs: {kwargs}")
153
+ logger.info("=== END WEBHOOK DEBUG INFO ===")
154
+
155
+ logger.info(f"Received event: {event_data}")
156
 
157
  # Check if the event is one that should trigger training
158
+ if event_data in ['ANNOTATION_CREATED', 'ANNOTATION_UPDATED']:
159
  try:
160
  # Fetch the full annotation data if not included in the payload
161
  task_id = data.get('task_id')