Download task/eval/util.py from RoadQAQ/video_llm_template: direct link, hf CLI and curl.
- Browser
- Download file 686 Bytes
-
https://huggingface.co/RoadQAQ/video_llm_template/resolve/main/task/eval/util.py
- Command line
-
hf download hf://RoadQAQ/video_llm_template/task/eval/util.py
-
curl -L -o util.py https://huggingface.co/RoadQAQ/video_llm_template/resolve/main/task/eval/util.py
686 Bytes
| from util.json import save_to_json | |
| from util.text import save_to_text | |
| import os | |
| def save_results(result_list, save_path, experiment_name="test0", description=None): | |
| ''' | |
| Save results into a json file, and save description in a txt file in the same folder | |
| Args: | |
| result_list (list of result dict) | |
| save_path (str) | |
| experiment_name (str) | |
| description (None or string) | |
| ''' | |
| save_file_name = os.path.join(save_path, experiment_name+".json") | |
| save_to_json(result_list, save_file_name) | |
| if description is not None: | |
| save_file_name = os.path.join(save_path, experiment_name+".txt") | |
| save_to_text(description, save_file_name) | |