make argparse nicer and fix reference to model
Browse files- run_model.py +10 -2
run_model.py
CHANGED
@@ -160,20 +160,28 @@ def run_model_on_data(model_path, tokenizer_name, arguments):
|
|
160 |
if __name__ == "__main__":
|
161 |
# Parse the arguments
|
162 |
parser = argparse.ArgumentParser()
|
163 |
-
parser.add_argument(
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
parser.add_argument(
|
165 |
"--input-file",
|
166 |
type=str,
|
|
|
167 |
help="The path to the input file with data to be corrected",
|
168 |
)
|
169 |
parser.add_argument(
|
170 |
"--output-file",
|
171 |
type=str,
|
|
|
172 |
help="The path to the output file where the corrected data will be saved",
|
173 |
)
|
174 |
args = parser.parse_args()
|
175 |
|
176 |
-
model_path = "
|
177 |
tokenizer_name = "AI-Sweden-Models/gpt-sw3-6.7b"
|
178 |
|
179 |
set_seed(42)
|
|
|
160 |
if __name__ == "__main__":
|
161 |
# Parse the arguments
|
162 |
parser = argparse.ArgumentParser()
|
163 |
+
parser.add_argument(
|
164 |
+
"--task",
|
165 |
+
type=int,
|
166 |
+
choices=(1,2,3),
|
167 |
+
required=True,
|
168 |
+
help="The task type (1, 2, or 3)",
|
169 |
+
)
|
170 |
parser.add_argument(
|
171 |
"--input-file",
|
172 |
type=str,
|
173 |
+
required=True,
|
174 |
help="The path to the input file with data to be corrected",
|
175 |
)
|
176 |
parser.add_argument(
|
177 |
"--output-file",
|
178 |
type=str,
|
179 |
+
required=True,
|
180 |
help="The path to the output file where the corrected data will be saved",
|
181 |
)
|
182 |
args = parser.parse_args()
|
183 |
|
184 |
+
model_path = "."
|
185 |
tokenizer_name = "AI-Sweden-Models/gpt-sw3-6.7b"
|
186 |
|
187 |
set_seed(42)
|