Skip to content

AirLLM 2.8T LLM inference with single 4GB GPU

try fix pip not found in jupyter

Kan Cheung122b5c182d7e
diff --git a/air_llm/setup.py b/air_llm/setup.py
index 378272a..2a1516c 100644
--- a/air_llm/setup.py
+++ b/air_llm/setup.py
@@ -1,3 +1,4 @@
+import sys
import setuptools
from setuptools.command.install import install
import subprocess
@@ -6,7 +7,10 @@ import subprocess
class PostInstallCommand(install):
def run(self):
install.run(self)
- subprocess.check_call(["pip", "install", "--upgrade", "transformers"])
+ try:
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "transformers"])
+ except subprocess.CalledProcessError:
+ print("警告:無法升級 transformers 套件。請手動升級。")
# Windows uses a different default encoding (use a consistent encoding)
with open("README.md", "r", encoding="utf-8") as fh: