Browse Source

[FIX] fix system recognize error, udpate setup

tags/v0.3.2
bxdd 2 years ago
parent
commit
86396300db
2 changed files with 6 additions and 27 deletions
  1. +5
    -6
      learnware/config.py
  2. +1
    -21
      setup.py

+ 5
- 6
learnware/config.py View File

@@ -55,13 +55,12 @@ class SystemType(Enum):

def get_platform():
import platform

sys_platform = platform.platform().lower()
if "windows" in sys_platform:
return SystemType.WINDOWS
elif "macos" in sys_platform:
os_name = platform.system().lower()
if "macos" in os_name or "darwin" in os_name:
return SystemType.MACOS
elif "linux" in sys_platform:
elif "windows" in os_name:
return SystemType.WINDOWS
elif "linux" in os_name:
return SystemType.LINUX
raise SystemError("Learnware only support MACOS/Linux/Windows")



+ 1
- 21
setup.py View File

@@ -29,23 +29,6 @@ VERSION = get_version("learnware/__init__.py")
if os.path.exists("MANIFEST"):
os.remove("MANIFEST")

class SystemType(Enum):
LINUX = 0
MACOS = 1
WINDOWS = 2

def get_platform():
import platform

sys_platform = platform.platform().lower()
if "windows" in sys_platform:
return SystemType.WINDOWS
elif "macos" in sys_platform:
return SystemType.MACOS
elif "linux" in sys_platform:
return SystemType.LINUX
raise SystemError("Learnware only support MACOS/Linux/Windows")


# What packages are required for this module to be executed?
# `estimator` may depend on other packages. In order to reduce dependencies, it is not written here.
@@ -92,14 +75,11 @@ FULL_REQUIRED = [
"torch==2.0.1",
"torchvision==0.15.2",
"torch-optimizer>=0.3.0",
"lightgbm>=3.3.0",
"sentence_transformers==2.2.2",
"fast_pytorch_kmeans==0.2.0.1",
]

# In MACOS, the lightgbm package should be installed with brew.
if get_platform() != SystemType.MACOS:
FULL_REQUIRED += ["lightgbm>=3.3.0"]
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()


Loading…
Cancel
Save