|
1 | 1 | import argparse |
2 | 2 | import inspect |
3 | 3 | import json |
4 | | -import sys |
5 | 4 |
|
6 | 5 |
|
7 | 6 | def main() -> None: |
8 | 7 | parser = argparse.ArgumentParser(prog="llmsql", description="LLMSQL CLI") |
9 | 8 | subparsers = parser.add_subparsers(dest="command") |
10 | 9 |
|
11 | | - # ================================================================ |
12 | | - # Fine-tuning command |
13 | | - # ================================================================ |
14 | | - ft_parser = subparsers.add_parser( |
15 | | - "finetune", |
16 | | - help="Fine-tune a causal LM on the LLMSQL benchmark.", |
17 | | - description="Launch fine-tuning using Hugging Face TRL's SFTTrainer.\n\n" |
18 | | - "You can pass parameters directly on the CLI or provide a YAML " |
19 | | - "config file via --config-file. CLI args take precedence.", |
20 | | - epilog="Example:\n llmsql finetune --config-file examples/example_finetune_args.yaml", |
21 | | - ) |
22 | | - ft_parser.add_argument( |
23 | | - "--config-file", |
24 | | - type=str, |
25 | | - required=True, |
26 | | - help="Path to a YAML config file containing training parameters.", |
27 | | - ) |
28 | | - |
29 | 10 | # ================================================================ |
30 | 11 | # Inference command |
31 | 12 | # ================================================================ |
@@ -88,19 +69,10 @@ def main() -> None: |
88 | 69 | # ================================================================ |
89 | 70 | args, extra = parser.parse_known_args() |
90 | 71 |
|
91 | | - # ------------------------------------------------ |
92 | | - # Fine-tune |
93 | | - # ------------------------------------------------ |
94 | | - if args.command == "finetune": |
95 | | - from llmsql.finetune import finetune |
96 | | - |
97 | | - sys.argv = ["llmsql-finetune"] + extra + ["--config_file", args.config_file] |
98 | | - finetune.run_cli() |
99 | | - |
100 | 72 | # ------------------------------------------------ |
101 | 73 | # Inference |
102 | 74 | # ------------------------------------------------ |
103 | | - elif args.command == "inference": |
| 75 | + if args.command == "inference": |
104 | 76 | if args.method == "vllm": |
105 | 77 | from llmsql import inference_vllm as inference_fn |
106 | 78 | elif args.method == "transformers": |
|
0 commit comments