[Fix] Do not pin memory when in WSL (#312)

This commit is contained in:
Zhuohan Li
2023-06-29 15:00:21 -07:00
committed by GitHub
parent f72297562f
commit 85de093472
2 changed files with 17 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import enum
from platform import uname
import uuid
import psutil
@@ -36,3 +37,7 @@ def get_cpu_memory() -> int:
def random_uuid() -> str:
return str(uuid.uuid4().hex)
def in_wsl() -> bool:
# Reference: https://github.com/microsoft/WSL/issues/4071
return "microsoft" in " ".join(uname()).lower()