Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions loongforge/data/multimodal/base/task_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import bisect
import dataclasses
import json
import logging
import re
import os
import sys
import traceback
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
Expand Down Expand Up @@ -762,9 +761,10 @@ def pack_selected_samples(self, samples: List[BaseTaskSample]) -> List[BaseTaskS


def print_error_handler(exc: Exception, key: Optional[str]):
"""Print error handler function called when an exception occurs during loading."""
print(
f"The following exception occurred in the dataloader for sample {key} and is skipped",
file=sys.stderr,
"""Log dataloader sample errors and let Energon skip the sample."""
logging.warning(
"skip dataloader sample %s due to %s: %s",
key,
type(exc).__name__,
exc,
)
traceback.print_exc()
Loading