Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
·
4159401
1
Parent(s):
df9248e
Fix concurrency_count to avoid OOM
Browse files
app.py
CHANGED
|
@@ -473,7 +473,8 @@ with gr.Blocks(
|
|
| 473 |
# CPU cpu_count=2 16G, model 7G
|
| 474 |
# CPU UPGRADE cpu_count=8 32G, model 7G
|
| 475 |
|
| 476 |
-
|
|
|
|
| 477 |
logger.info(f"{concurrency_count=}")
|
| 478 |
|
| 479 |
block.queue(concurrency_count=concurrency_count, max_size=5).launch(debug=True)
|
|
|
|
| 473 |
# CPU cpu_count=2 16G, model 7G
|
| 474 |
# CPU UPGRADE cpu_count=8 32G, model 7G
|
| 475 |
|
| 476 |
+
_ = int(psutil.virtual_memory().total / 10**9 // file_size - 1)
|
| 477 |
+
concurrency_count = max(_, 1)
|
| 478 |
logger.info(f"{concurrency_count=}")
|
| 479 |
|
| 480 |
block.queue(concurrency_count=concurrency_count, max_size=5).launch(debug=True)
|