calinrada1 commited on
Commit
7b68836
·
unverified ·
1 Parent(s): fcbf3ad
Files changed (1) hide show
  1. mappingservice/routers/room.py +5 -4
mappingservice/routers/room.py CHANGED
@@ -139,16 +139,17 @@ async def predict_all(request: Request, room_data: RoomData):
139
  feature_pred_results = feature_future.result()["feature_prediction"]
140
  view_pred_results = view_future.result()["view_prediction"]
141
 
142
- bed_predictions = [
143
- bed_data for bed_data in room_data.beds if bed_data and bed_data.type is not None and bed_data.count is not None # noqa: E501
144
- ]
145
 
146
- if not bed_predictions:
147
  logger.debug("No bed data provided or valid; extracting from description.")
148
  extracted_beds = get_bed_predictions(room_data.room_description)
149
  if extracted_beds:
150
  bed_predictions.extend(extracted_beds)
151
 
 
 
 
152
  end_time = time.time()
153
  total_time = end_time - start_time
154
  logger.info(f"Total processing time: {total_time:.3f} seconds")
 
139
  feature_pred_results = feature_future.result()["feature_prediction"]
140
  view_pred_results = view_future.result()["view_prediction"]
141
 
142
+ bed_predictions = room_data.beds
 
 
143
 
144
+ if not room_data.beds:
145
  logger.debug("No bed data provided or valid; extracting from description.")
146
  extracted_beds = get_bed_predictions(room_data.room_description)
147
  if extracted_beds:
148
  bed_predictions.extend(extracted_beds)
149
 
150
+ if not isinstance(bed_predictions, list):
151
+ bed_predictions = [bed_predictions]
152
+
153
  end_time = time.time()
154
  total_time = end_time - start_time
155
  logger.info(f"Total processing time: {total_time:.3f} seconds")