-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharguments.py
More file actions
148 lines (145 loc) · 6.03 KB
/
Copy patharguments.py
File metadata and controls
148 lines (145 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
from dataclasses import dataclass, field
from typing import Optional, Literal
from transformers import TrainingArguments
@dataclass
class WrappedTrainingArguments(TrainingArguments):
cfg: str = None
# --------------------- meta args ---------------------- #
# llm: Literal['llama3.1', 'qwen2.5-7bf', 'qwen2.5-14bf'] = 'llama3.1'
# lmm: Literal['llava1.6', 'llama3.2', 'qwen2-vl'] = 'llava1.6'
llm: str = field(
default=None,
metadata={"help": "what llm to run. (avail: 'llama3.1-8bf', 'qwen2.5-7bf', 'qwen2.5-14bf')",
}
)
lmm: str = field(
default='llava1.6-7bf,qwen2-vl-7bf',
metadata={"help": "what lmm to run. (avail: 'llava1.5-7bf', 'llava1.5-13bf', 'llava1.6-7bf', 'llava1.6-8bf', 'llava1.6-13bf', 'llama3.2-11bf', 'qwen2-vl-7bf', 'qwen2.5-vl-7bf')",
}
)
which_task : str = field(
default="all",
metadata={"help":"what tasks (datasets) to run.",}
)
split: str = field(
default="test",
metadata={"help":"which dataset split to run inference on",
"choices" : ['train', 'dev', 'test']}
)
load_data_surfix : str = field(
default="-",
metadata={"help":"local dataset file surfix",
"choices" : ["-", 'toy', 'seen', 'unseen', 'seen_ffc', 'unseen_ffc']}
)
scheme : str = field(
default="S1",
metadata={"help":"prompt scheme, the selected prompt formats",}
)
use_resized_img : Optional[bool] = field(
default=False,
metadata={"help": ""}
)
use_greedy_decoding_for_mini_models : Optional[bool] = field(
default=False,
metadata={"help": ""}
)
enable_thinking : Optional[bool] = field(
default=False,
metadata={"help": ""}
)
run_perturb : Optional[bool] = field(
default=False,
metadata={"help": "whether to run perturbation experiments."}
)
run_fewshot : Optional[bool] = field(
default=False,
metadata={"help": "whether to run few-shot experiments."}
)
run_multiprompt : Optional[bool] = field(
default=False,
metadata={"help": "whether to run multiple prompts consecutively."}
)
include_chat_history : Optional[bool] = field(
default=False,
metadata={"help": "whether to include previous chat history to allow for multi-turn chat when running multiple prompts consecutively."}
)
use_mask_img : Optional[bool] = field(
default=False,
metadata={"help": ""}
)
use_dataset_cache: bool = field(
default=False,
metadata={"help":"use cached dataset."}
)
n_shots: int = field(
default=2,
metadata={"help":"N-way K-shot examples to prompt LLMs for few-shot experiments. K examples for each of the N classes."}
)
n_fewshots: int = field(
default=1,
metadata={"help":"N-way K-shot examples to prompt LLMs for few-shot experiments. K examples for each of the N classes."}
)
load_weights_from: Optional[str] = field(
default=None,
metadata={"help": "The directory to load the model weights from."}
)
do_not_save_results: Optional[bool] = field(
default=False,
metadata={"help": ""}
)
quantization:Optional[bool] = field(
default=True,
metadata={"help":"whehter to load quantized model."}
)
# --------------------- Generation-specific args ---------------------- #
### Parameters that control the length of the output
llm_max_new_tokens: Optional[int] = field(
default=256,
metadata={"help":"The maximum numbers of tokens to generate"}
)
lmm_max_new_tokens: Optional[int] = field(
default=256,
metadata={"help":"The maximum numbers of tokens to generate"}
)
use_cache: Optional[bool] = field(
default=True,
metadata={"help": "[optional] Whether or not the model should use the past last key/values attentions Whether or not the model should use the past last key/values attentions (if applicable to the model) to speed up decoding."}
)
### Parameters for manipulation of the model output logits
do_sample: Optional[bool] = field(
default=False,
metadata={"help": "Whether or not to use sampling; If set to False, use greedy decoding otherwise."}
)
top_p: Optional[float] = field(
default=1.0,
metadata={"help": "[optional] If set to float < 1, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are kept for generation. When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens."}
)
temperature: Optional[float] = field(
default=1.0,
metadata={"help": "[optional] The value used to modulate the next token probabilities. Adjusts randomness of outputs, greater than 1 is random and 0 is deterministic, 0.75 is a good starting value."}
)
top_k : Optional[int] = field(
default=50,
metadata={"help": "[optional] The number of highest probability vocabulary tokens to keep for top-k-filtering. When decoding text, samples from the top k most likely tokens; lower to ignore less likely tokens"}
)
repetition_penalty: Optional[float] = field(
default=1.0,
metadata={"help": "The parameter for repetition penalty. 1.0 means no penalty."}
)
length_penalty: Optional[int] = field(
default=1.0,
metadata={"help": "[optional] Exponential penalty to the length that is used with beam-based generation."}
)
# --------------------- Other args ---------------------- #
cache_dir: Optional[str] = field(
default="",
metadata={"help": "Optional directory to store the pre-trained models downloaded from s3 (instread of the default one)"},
)
regen_results : Optional[bool] = field(
default=False,
metadata={"help": ""}
)
target_result_surfix : Optional[str] = field(
default="",
metadata={"help": ""}
)