Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
·
1d516ba
1
Parent(s):
7e9b0c1
Update Waking-up-takes-about-9min-Sleep-after-15min-of-inactivity
Browse files- Waking-up-takes-about-9min-Sleep-after-15min-of-inactivity +0 -0
- app.py +13 -9
- run_cmd.py +1 -1
Waking-up-takes-about-9min-Sleep-after-15min-of-inactivity
ADDED
|
File without changes
|
app.py
CHANGED
|
@@ -34,8 +34,14 @@ GenerationConfig {
|
|
| 34 |
# pylint: disable=line-too-long, invalid-name, no-member, redefined-outer-name, missing-function-docstring, missing-class-docstring, broad-except,
|
| 35 |
from run_cmd import run_cmd # noqa
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
import gc
|
| 41 |
import os
|
|
@@ -64,22 +70,20 @@ except Exception:
|
|
| 64 |
# Windows
|
| 65 |
logger.warning("Windows, cant run time.tzset()")
|
| 66 |
|
| 67 |
-
|
| 68 |
-
# /home/user/.pyenv/versions/3.10.13/lib/python3.10/site-packages/bitsandbytes
|
| 69 |
-
|
| 70 |
-
|
| 71 |
if True:
|
| 72 |
-
run_cmd(
|
|
|
|
|
|
|
| 73 |
|
| 74 |
logger.info("lsb_release -a")
|
| 75 |
-
ret = sp.run("lsb_release -a", capture_output=1, check=0, shell=1, encoding=
|
| 76 |
if ret.stdout:
|
| 77 |
rich.print(ret.stdout)
|
| 78 |
if ret.stderr:
|
| 79 |
rich.print("[red bold]" + ret.stdout)
|
| 80 |
|
| 81 |
logger.info("nvidia-smi")
|
| 82 |
-
ret = sp.run("nvidia-smi", capture_output=1, check=0, shell=1, encoding=
|
| 83 |
if ret.stdout:
|
| 84 |
rich.print(ret.stdout)
|
| 85 |
if ret.stderr:
|
|
|
|
| 34 |
# pylint: disable=line-too-long, invalid-name, no-member, redefined-outer-name, missing-function-docstring, missing-class-docstring, broad-except,
|
| 35 |
from run_cmd import run_cmd # noqa
|
| 36 |
|
| 37 |
+
# autodl with cuda12 NVIDIA-SMI appears
|
| 38 |
+
# 525.105.17 Driver Version: 525.105.17 CUDA Version: 12.0
|
| 39 |
+
# no fix needed
|
| 40 |
+
|
| 41 |
+
# clumsy fix for hf overwrite libbitsandbytes_cpu.so with libbitsandbytes_cuda118.so
|
| 42 |
+
run_cmd(
|
| 43 |
+
"cd /home/user/.pyenv/versions/3.10.13/lib/python3.10/site-packages/bitsandbytes; cp libbitsandbytes_cuda118.so libbitsandbytes_cpu.so"
|
| 44 |
+
) # noqa
|
| 45 |
|
| 46 |
import gc
|
| 47 |
import os
|
|
|
|
| 70 |
# Windows
|
| 71 |
logger.warning("Windows, cant run time.tzset()")
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
if True:
|
| 74 |
+
run_cmd(
|
| 75 |
+
"ls -rtl /home/user/.pyenv/versions/3.10.13/lib/python3.10/site-packages/bitsandbytes"
|
| 76 |
+
)
|
| 77 |
|
| 78 |
logger.info("lsb_release -a")
|
| 79 |
+
ret = sp.run("lsb_release -a", capture_output=1, check=0, shell=1, encoding="utf8")
|
| 80 |
if ret.stdout:
|
| 81 |
rich.print(ret.stdout)
|
| 82 |
if ret.stderr:
|
| 83 |
rich.print("[red bold]" + ret.stdout)
|
| 84 |
|
| 85 |
logger.info("nvidia-smi")
|
| 86 |
+
ret = sp.run("nvidia-smi", capture_output=1, check=0, shell=1, encoding="utf8")
|
| 87 |
if ret.stdout:
|
| 88 |
rich.print(ret.stdout)
|
| 89 |
if ret.stderr:
|
run_cmd.py
CHANGED
|
@@ -8,7 +8,7 @@ from loguru import logger
|
|
| 8 |
def run_cmd(cmd):
|
| 9 |
"""Execute cmd."""
|
| 10 |
logger.info(f"{cmd=}")
|
| 11 |
-
ret = sp.run(cmd, capture_output=1, check=0, shell=1, encoding=
|
| 12 |
if ret.stdout:
|
| 13 |
rich.print(ret.stdout)
|
| 14 |
if ret.stderr:
|
|
|
|
| 8 |
def run_cmd(cmd):
|
| 9 |
"""Execute cmd."""
|
| 10 |
logger.info(f"{cmd=}")
|
| 11 |
+
ret = sp.run(cmd, capture_output=1, check=0, shell=1, encoding="utf8")
|
| 12 |
if ret.stdout:
|
| 13 |
rich.print(ret.stdout)
|
| 14 |
if ret.stderr:
|