Skip to content

Commit

Permalink
fix odps quota in hitrate.py & refine error info of CsvReader and Par…
Browse files Browse the repository at this point in the history
…quetReader (#67)
  • Loading branch information
tiankongdeguiji authored Dec 19, 2024
1 parent 28b1b7d commit 3503355
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tzrec/datasets/csv_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def __init__(
self._input_files = []
for input_path in self._input_path.split(","):
self._input_files.extend(glob.glob(input_path))
if len(self._input_files) == 0:
raise RuntimeError(f"No csv files exist in {self._input_path}.")
dataset = ds.dataset(self._input_files[0], format=self._csv_fmt)
self.schema = []
self._ordered_cols = None
Expand Down
2 changes: 2 additions & 0 deletions tzrec/datasets/parquet_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def __init__(
self._input_files = []
for input_path in self._input_path.split(","):
self._input_files.extend(glob.glob(input_path))
if len(self._input_files) == 0:
raise RuntimeError(f"No parquet files exist in {self._input_path}.")
dataset = ds.dataset(self._input_files[0], format="parquet")
if self._selected_cols:
self._ordered_cols = []
Expand Down
1 change: 1 addition & 0 deletions tzrec/tools/hitrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def batch_hitrate(
batch_size=args.batch_size,
ivf_nlist=args.ivf_nlist,
reader_type=args.reader_type,
odps_data_quota_name=args.odps_data_quota_name,
)
index.nprobe = args.ivf_nprobe

Expand Down

0 comments on commit 3503355

Please sign in to comment.