Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
run_transformers_training.py
CHANGED
|
@@ -400,8 +400,13 @@ def load_dataset_with_mapping(dataset_config):
|
|
| 400 |
record = {}
|
| 401 |
record["prompt_number"] = dataset[i].get("prompt_number", "N/A")
|
| 402 |
record["article_id"] = dataset[i].get("article_id", "N/A")
|
| 403 |
-
|
| 404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 405 |
sample_records.append(record)
|
| 406 |
|
| 407 |
logger.info(f"Sample records: {sample_records}")
|
|
|
|
| 400 |
record = {}
|
| 401 |
record["prompt_number"] = dataset[i].get("prompt_number", "N/A")
|
| 402 |
record["article_id"] = dataset[i].get("article_id", "N/A")
|
| 403 |
+
# Safely get conversations length with None check
|
| 404 |
+
conversations = dataset[i].get("conversations")
|
| 405 |
+
if conversations is not None and isinstance(conversations, list):
|
| 406 |
+
record["conversations_length"] = len(conversations)
|
| 407 |
+
else:
|
| 408 |
+
record["conversations_length"] = 0
|
| 409 |
+
logger.warning(f"Invalid conversations for sample {i}: {type(conversations)}")
|
| 410 |
sample_records.append(record)
|
| 411 |
|
| 412 |
logger.info(f"Sample records: {sample_records}")
|