Update eval_lmdeploy.py
Browse files- eval_lmdeploy.py +4 -2
eval_lmdeploy.py
CHANGED
@@ -10,7 +10,7 @@ def main(args):
|
|
10 |
import os
|
11 |
import time
|
12 |
|
13 |
-
|
14 |
|
15 |
os.makedirs("tmp", exist_ok=True)
|
16 |
os.makedirs("evals_res", exist_ok=True)
|
@@ -18,7 +18,7 @@ def main(args):
|
|
18 |
# get base path for eval_file
|
19 |
EVAL_FILE_BASENAME = os.path.basename(EVAL_FILE)
|
20 |
MODEL_NAME_STR = "+".join(args.model.split("/"))
|
21 |
-
SAVED_EVAL_FILE = f"{str(
|
22 |
|
23 |
import os
|
24 |
|
@@ -382,6 +382,8 @@ def main(args):
|
|
382 |
else:
|
383 |
std_outputs = std_outputs + "\nAll predictions match the reference!" + "\n"
|
384 |
|
|
|
|
|
385 |
print(std_outputs)
|
386 |
|
387 |
# write stdoutputs to evals_res/outputs_{SAVED_EVAL_FILE}.log
|
|
|
10 |
import os
|
11 |
import time
|
12 |
|
13 |
+
run_start_time = time.time()
|
14 |
|
15 |
os.makedirs("tmp", exist_ok=True)
|
16 |
os.makedirs("evals_res", exist_ok=True)
|
|
|
18 |
# get base path for eval_file
|
19 |
EVAL_FILE_BASENAME = os.path.basename(EVAL_FILE)
|
20 |
MODEL_NAME_STR = "+".join(args.model.split("/"))
|
21 |
+
SAVED_EVAL_FILE = f"{str(run_start_time)}_{MODEL_NAME_STR}_{EVAL_FILE_BASENAME}_seq{args.num_seqs}_tok{args.tokens}_q{args.quant_policy}_tpp{args.top_p}_mnp{args.min_p}_tpk{args.top_k}"
|
22 |
|
23 |
import os
|
24 |
|
|
|
382 |
else:
|
383 |
std_outputs = std_outputs + "\nAll predictions match the reference!" + "\n"
|
384 |
|
385 |
+
time_taken = time.time() - run_start_time
|
386 |
+
std_outputs = std_outputs + f"Time taken: {time_taken:.2f} seconds" + "\n"
|
387 |
print(std_outputs)
|
388 |
|
389 |
# write stdoutputs to evals_res/outputs_{SAVED_EVAL_FILE}.log
|