Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ from concurrent.futures import ProcessPoolExecutor, as_completed, wait, FIRST_CO
|
|
| 10 |
from datetime import datetime
|
| 11 |
from typing import Any, Dict, List, Tuple
|
| 12 |
from warnings import warn
|
|
|
|
| 13 |
|
| 14 |
import numpy as np
|
| 15 |
|
|
@@ -176,7 +177,12 @@ def evaluate(
|
|
| 176 |
result = future.result()
|
| 177 |
remainings.remove(result["_identifier"])
|
| 178 |
eval_results[result["task_id"]].append(result)
|
|
|
|
|
|
|
| 179 |
|
|
|
|
|
|
|
|
|
|
| 180 |
# sort the results for each problem by completion_id
|
| 181 |
for task_id, task_results in eval_results.items():
|
| 182 |
task_results.sort(key=lambda x: x["completion_id"])
|
|
|
|
| 10 |
from datetime import datetime
|
| 11 |
from typing import Any, Dict, List, Tuple
|
| 12 |
from warnings import warn
|
| 13 |
+
import gc
|
| 14 |
|
| 15 |
import numpy as np
|
| 16 |
|
|
|
|
| 177 |
result = future.result()
|
| 178 |
remainings.remove(result["_identifier"])
|
| 179 |
eval_results[result["task_id"]].append(result)
|
| 180 |
+
del future, result
|
| 181 |
+
gc.collect()
|
| 182 |
|
| 183 |
+
del problems, futures
|
| 184 |
+
gc.collect()
|
| 185 |
+
|
| 186 |
# sort the results for each problem by completion_id
|
| 187 |
for task_id, task_results in eval_results.items():
|
| 188 |
task_results.sort(key=lambda x: x["completion_id"])
|