mirror of
https://github.com/0xSojalSec/airllm.git
synced 2026-03-07 14:24:44 +00:00
Merge pull request #176 from chinkan/main
Fix pip not found when install in Jupyter
This commit is contained in:
@@ -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("Warning: Unable to upgrade transformers package. Please upgrade manually.")
|
||||
|
||||
# Windows uses a different default encoding (use a consistent encoding)
|
||||
with open("README.md", "r", encoding="utf-8") as fh:
|
||||
|
||||
Reference in New Issue
Block a user