Skip to content

Commit

Permalink
Add help message for no arguments provided in finetune.py and serve.py (
Browse files Browse the repository at this point in the history
#169)

Signed-off-by: Wu, Xiaochang <[email protected]>
  • Loading branch information
xwu99 authored Apr 1, 2024
1 parent 674b800 commit 6a24d5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llm_on_ray/finetune/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import argparse
import sys
from typing import Any, Dict, Union, Optional

import torch
Expand Down Expand Up @@ -271,6 +272,12 @@ def get_finetune_config():
default=None,
help="The name of the dataset to use (via the datasets library).",
)

# Print help if no arguments were provided
if len(sys.argv) == 1:
parser.print_help(sys.stderr)
sys.exit(1)

args = parser.parse_args()
config_file = args.config_file

Expand Down
5 changes: 5 additions & 0 deletions llm_on_ray/inference/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ def main(argv=None):
"--vllm_max_num_seqs", default=256, type=int, help="The batch size in VLLM."
)

# Print help if no arguments were provided
if len(sys.argv) == 1:
parser.print_help(sys.stderr)
sys.exit(1)

args = parser.parse_args(argv)

ray.init(address="auto")
Expand Down

0 comments on commit 6a24d5e

Please sign in to comment.