Skip to content

Commit 2caf0fa

Browse files
committed
chg: adopt the coderabbit suggestion
Signed-off-by: Chenhan Yu <[email protected]>
1 parent 9e7c1a4 commit 2caf0fa

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

modelopt/torch/utils/plugins/megatron_preprocess_data.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,15 @@ def main():
239239
if args.input_path is None:
240240
args.input_path = []
241241

242-
response = requests.get(
243-
"https://datasets-server.huggingface.co/splits?dataset={}".format(args.dataset),
244-
timeout=10,
245-
)
242+
try:
243+
response = requests.get(
244+
f"https://datasets-server.huggingface.co/splits?dataset={args.dataset}",
245+
timeout=10,
246+
)
247+
response.raise_for_status()
248+
except requests.RequestException as e:
249+
print(f"Failed to fetch dataset splits for {args.dataset}: {e}")
250+
return
246251

247252
for entry in response.json()["splits"]:
248253
skip_processing = False

0 commit comments

Comments
 (0)