From 50dfcaa8fa719f99d13703743bbc3ddb9926809a Mon Sep 17 00:00:00 2001 From: Wenjing Margaret Mao Date: Thu, 11 Apr 2024 07:15:18 +0800 Subject: [PATCH 1/2] Update llm-ppl-evaluation.yml -- Update llm-ppl-evaluation.yml -- Update HTML file: change from ppl/update_in_parent_folder into harness/update_in_parent_folder ppl test and harness test are using the same update_in_parent_folder file. To reduce the repetition, change the ppl update HTML file to the same one under the harness folder and delete the HTML file under the ppl folder. --- .github/workflows/llm-ppl-evaluation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/llm-ppl-evaluation.yml b/.github/workflows/llm-ppl-evaluation.yml index 8f549af0..e2f0b92c 100644 --- a/.github/workflows/llm-ppl-evaluation.yml +++ b/.github/workflows/llm-ppl-evaluation.yml @@ -275,5 +275,5 @@ jobs: run: | python ppl_csv_to_html.py -f $ACC_FOLDER if ${{github.event_name == 'schedule'}}; then - python update_html_in_parent_folder.py -f $ACC_FOLDER - fi \ No newline at end of file + python ../harness/update_html_in_parent_folder.py -f $ACC_FOLDER + fi From 9bec233e4de3193720793e257b516d10afab42b8 Mon Sep 17 00:00:00 2001 From: Wenjing Margaret Mao Date: Thu, 11 Apr 2024 07:21:12 +0800 Subject: [PATCH 2/2] Delete python/llm/test/benchmark/perplexity/update_html_in_parent_folder.py Delete due to repetition --- .../update_html_in_parent_folder.py | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 python/llm/test/benchmark/perplexity/update_html_in_parent_folder.py diff --git a/python/llm/test/benchmark/perplexity/update_html_in_parent_folder.py b/python/llm/test/benchmark/perplexity/update_html_in_parent_folder.py deleted file mode 100644 index 9e972e9d..00000000 --- a/python/llm/test/benchmark/perplexity/update_html_in_parent_folder.py +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2016 The BigDL Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Python program to update Html in parent folder - -import os -import shutil -import argparse -from pathlib import Path - -def update_html_in_parent_folder(folder_path): - # Get parent folder - parent_folder = Path(folder_path).parent - - # List all html files under parent folder and delete them - for html_file in parent_folder.glob('*.html'): - html_file.unlink() - - # Find latest html file under folder_path - latest_html_file = max(Path(folder_path).glob('*.html'), key=os.path.getctime, default=None) - - # Copy the latest html file to parent folder - if latest_html_file is not None: - shutil.copy(latest_html_file, parent_folder) - - print(latest_html_file.name) - -def main(): - parser = argparse.ArgumentParser(description="Update HTML in parent folder.") - parser.add_argument("-f", "--folder", type=str, help="Path to the folder") - args = parser.parse_args() - - update_html_in_parent_folder(args.folder) - -if __name__ == "__main__": - main()