mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-17 20:55:09 +01:00
Script to wipe all files apart from prompts from benchmark
This commit is contained in:
38
scripts/clean_benchmarks.py
Normal file
38
scripts/clean_benchmarks.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# list all folders in benchmark folder
|
||||
# for each folder, run the benchmark
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import time
|
||||
import datetime
|
||||
import shutil
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typer import run
|
||||
from itertools import islice
|
||||
|
||||
def main(
|
||||
):
|
||||
benchmarks = Path('benchmark')
|
||||
|
||||
for benchmark in benchmarks.iterdir():
|
||||
if benchmark.is_dir():
|
||||
print(f'Cleaning {benchmark}')
|
||||
for path in benchmark.iterdir():
|
||||
if path.name == 'main_prompt':
|
||||
continue
|
||||
|
||||
# Get filename of Path object
|
||||
if path.is_dir():
|
||||
# delete the entire directory
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
# delete the file
|
||||
os.remove(path)
|
||||
|
||||
if __name__ == '__main__':
|
||||
run(main)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user