Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Change timeout
Browse files
yourbench_space/evaluation.py
CHANGED
|
@@ -22,7 +22,11 @@ async def run_process(args: list, custom_env = None) -> dict:
|
|
| 22 |
process = await asyncio.create_subprocess_exec(
|
| 23 |
*args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, env=custom_env
|
| 24 |
)
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
stdout = await process.stdout.read()
|
| 27 |
stderr = await process.stderr.read()
|
| 28 |
return {"pid": process.pid, "stdout": stdout.decode(), "stderr": stderr.decode()}
|
|
|
|
| 22 |
process = await asyncio.create_subprocess_exec(
|
| 23 |
*args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, env=custom_env
|
| 24 |
)
|
| 25 |
+
try:
|
| 26 |
+
await asyncio.wait_for(process.wait(), timeout=300)
|
| 27 |
+
except TimeoutError:
|
| 28 |
+
logger.error("Lighteval process Timed Out")
|
| 29 |
+
|
| 30 |
stdout = await process.stdout.read()
|
| 31 |
stderr = await process.stderr.read()
|
| 32 |
return {"pid": process.pid, "stdout": stdout.decode(), "stderr": stderr.decode()}
|