Skip to content

Commit f5097af

Browse files
authored
fix csv valid_format
1 parent 295dcca commit f5097af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/compare-llama-bench.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ def valid_format(data_files: list[str]) -> bool:
369369
try:
370370
with open(data_file, "r", encoding="utf-8") as fp:
371371
json.load(fp)
372-
continue
373372
except Exception as e:
374373
logger.debug(f'"{data_file}" is not a valid JSON file.', exc_info=e)
375374
return False
@@ -404,8 +403,8 @@ def valid_format(data_files: list[str]) -> bool:
404403
for data_file in data_files:
405404
try:
406405
with open(data_file, "r", encoding="utf-8") as fp:
407-
csv.DictReader(fp)
408-
continue
406+
for parsed in csv.DictReader(fp):
407+
break
409408
except Exception as e:
410409
logger.debug(f'"{data_file}" is not a valid CSV file.', exc_info=e)
411410
return False

0 commit comments

Comments
 (0)