|
9 | 9 |
|
10 | 10 | import torch
|
11 | 11 |
|
| 12 | +default_device = "cpu" |
12 | 13 |
|
13 |
| -default_device = "cpu" # 'cuda' if torch.cuda.is_available() else 'cpu' |
14 |
| - |
15 |
| -strict = False |
16 |
| - |
17 |
| - |
18 |
| -def check_args(args, command_name: str): |
19 |
| - global strict |
20 |
| - |
21 |
| - # chat and generate support the same options |
22 |
| - if command_name in ["generate", "chat", "gui"]: |
23 |
| - # examples, can add more. Note that attributes convert dash to _ |
24 |
| - disallowed_args = ["output_pte_path", "output_dso_path"] |
25 |
| - elif command_name == "export": |
26 |
| - # examples, can add more. Note that attributes convert dash to _ |
27 |
| - disallowed_args = ["pte_path", "dso_path"] |
28 |
| - elif command_name == "eval": |
29 |
| - # TBD |
30 |
| - disallowed_args = [] |
31 |
| - else: |
32 |
| - raise RuntimeError(f"{command_name} is not a valid command") |
33 |
| - |
34 |
| - for disallowed in disallowed_args: |
35 |
| - if hasattr(args, disallowed): |
36 |
| - text = f"command {command_name} does not support option {disallowed.replace('_', '-')}" |
37 |
| - if strict: |
38 |
| - raise RuntimeError(text) |
39 |
| - else: |
40 |
| - print(f"Warning: {text}") |
41 |
| - |
| 14 | +def check_args(args, name: str) -> None: |
| 15 | + pass |
42 | 16 |
|
43 | 17 | def add_arguments_for_generate(parser):
|
44 | 18 | # Only generate specific options should be here
|
@@ -123,12 +97,12 @@ def _add_arguments_common(parser):
|
123 | 97 | default="not_specified",
|
124 | 98 | help="Model checkpoint path.",
|
125 | 99 | )
|
126 |
| - parser.add_argument( |
127 |
| - "--checkpoint-dir", |
128 |
| - type=Path, |
129 |
| - default=None, |
130 |
| - help="Model checkpoint directory.", |
131 |
| - ) |
| 100 | + # parser.add_argument( |
| 101 | + # "--checkpoint-dir", |
| 102 | + # type=Path, |
| 103 | + # default=None, |
| 104 | + # help="Model checkpoint directory.", |
| 105 | + # ) |
132 | 106 | parser.add_argument(
|
133 | 107 | "--params-path",
|
134 | 108 | type=Path,
|
|
0 commit comments