|
60 | 60 | MT_BENCH_OUTPUT_PATH = path.join(DATA_PVC_MOUNT_PATH, "mt-bench-results.txt")
|
61 | 61 | MT_BENCH_SCORES_PATH = path.join(DATA_PVC_MOUNT_PATH, "mt-bench-best.txt")
|
62 | 62 | MT_BENCH_BRANCH_SCORES_PATH = path.join(DATA_PVC_MOUNT_PATH, "mt-bench-branch-best.txt")
|
| 63 | +MMLU_BRANCH_SCORES_PATH = path.join(DATA_PVC_MOUNT_PATH, "mmlu-branch-best.txt") |
| 64 | +CANDIDATE_MODEL_PATH = path.join( |
| 65 | + DATA_PVC_MOUNT_PATH, "model/output/hf_format/candidate_model" |
| 66 | +) |
63 | 67 | SDG_OBJECT_STORE_SECRET_NAME = "sdg-object-store-credentials"
|
64 | 68 | KFP_MODEL_SERVER_CM = """
|
65 | 69 | # TODO: remove the following line and replace it with the actual ConfigMap/Secret
|
|
268 | 272 | echo "Final data tarball path: $FINAL_DATA_TAR_PATH"
|
269 | 273 | echo "Final data tarball file: $FINAL_DATA_TAR_FILE"
|
270 | 274 | echo "Archiving data before pushing to the object store"
|
271 |
| - tar --create --gzip --verbose --file "$FINAL_DATA_TAR_PATH" {mt_bench_output_path} {mt_bench_scores_path} {mt_bench_branch_scores_path} {data_pvc_mount_path}/model |
| 275 | + tar --create \ |
| 276 | + --gzip \ |
| 277 | + --verbose \ |
| 278 | + --file "$FINAL_DATA_TAR_PATH" {mt_bench_output_path} {mt_bench_scores_path} {mt_bench_branch_scores_path} {mmlu_branch_scores_path} {candidate_model_path} |
272 | 279 | # TODO: change model path for the final model!!!
|
273 | 280 | fi
|
274 | 281 |
|
@@ -843,11 +850,7 @@ def run(
|
843 | 850 | scores = json.loads(scores)
|
844 | 851 | logger.info("Best model: %s", scores.get("best_model"))
|
845 | 852 | ctx.obj["candidate_model"] = scores.get("best_model")
|
846 |
| - |
847 |
| - # Push the best model to S3 |
848 |
| - # TODO |
849 | 853 | logger.info("instructLab Training Finished!")
|
850 |
| - return 0 |
851 | 854 |
|
852 | 855 | # Push the best model to S3
|
853 | 856 | ctx.invoke(upload_trained_model)
|
@@ -1271,6 +1274,8 @@ def data_processing(train_args: TrainingArgs) -> None:
|
1271 | 1274 | mt_bench_output_path=MT_BENCH_OUTPUT_PATH,
|
1272 | 1275 | mt_bench_scores_path=MT_BENCH_SCORES_PATH,
|
1273 | 1276 | mt_bench_branch_scores_path=MT_BENCH_BRANCH_SCORES_PATH,
|
| 1277 | + mmlu_branch_scores_path=MMLU_BRANCH_SCORES_PATH, |
| 1278 | + candidate_model=CANDIDATE_MODEL_PATH, |
1274 | 1279 | )
|
1275 | 1280 | ],
|
1276 | 1281 | volume_mounts=get_vol_mount(),
|
@@ -1843,7 +1848,7 @@ def branch_eval_summary_to_json(
|
1843 | 1848 |
|
1844 | 1849 | # MMLU_BRANCH
|
1845 | 1850 |
|
1846 |
| - # This is very specific to `ilab generate`, necessary because the data generation and |
| 1851 | + # This is very specific to 'ilab generate', necessary because the data generation and |
1847 | 1852 | # model evaluation are taking place in separate environments.
|
1848 | 1853 | def update_test_lines_in_files(base_dir):
|
1849 | 1854 | import os
|
@@ -1889,7 +1894,7 @@ def find_node_dataset_directories(base_dir: str):
|
1889 | 1894 | if regex.search(directory):
|
1890 | 1895 | matching_dirs.append(os.path.join(root, directory))
|
1891 | 1896 |
|
1892 |
| - # From `ilab sdg` the knowledge_*_task.yaml files have a line that references where the SDG took place. |
| 1897 | + # From 'ilab sdg' the knowledge_*_task.yaml files have a line that references where the SDG took place. |
1893 | 1898 | # This needs to be updated to run elsewhere.
|
1894 | 1899 | # The line is:
|
1895 | 1900 | # test: /path/to/where/sdg/occured/node_datasets_*
|
@@ -2117,7 +2122,7 @@ def find_node_dataset_directories(base_dir: str):
|
2117 | 2122 | json.dump(mt_bench_branch_data, f, indent=4)
|
2118 | 2123 | """
|
2119 | 2124 | exec_run_final_eval_op_args = """
|
2120 |
| -run_final_eval_op(candidate_model='/data/model/output/hf_format/candidate_model', taxonomy='/data/taxonomy', tasks='/data/generated', base_branch='', candidate_branch='', device=None, base_model_dir='/model/model', max_workers='auto', merge_system_user_message=False, model_dtype='bfloat16', few_shots=5, batch_size=8) |
| 2125 | +run_final_eval_op(mmlu_branch_output='/data/mmlu-branch-best.txt',mt_bench_branch_output='/data/mt-bench-branch-best.txt',candidate_model='/data/model/output/hf_format/candidate_model', taxonomy='/data/taxonomy', tasks='/data/generate', base_branch='', candidate_branch='', device=None, base_model_dir='/data/model', max_workers='auto', merge_system_user_message=False, model_dtype='bfloat16', few_shots=5, batch_size=8) |
2121 | 2126 | """
|
2122 | 2127 |
|
2123 | 2128 | if eval_type == "mt-bench":
|
|
0 commit comments