mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-09 15:36:26 +00:00
python: detect Rosetta 2 (#2793)
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
01f51cfa1b
commit
10c3e21147
@ -6,6 +6,7 @@ import platform
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import textwrap
|
||||||
import threading
|
import threading
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
@ -28,6 +29,16 @@ if TYPE_CHECKING:
|
|||||||
EmbeddingsType = TypeVar('EmbeddingsType', bound='list[Any]')
|
EmbeddingsType = TypeVar('EmbeddingsType', bound='list[Any]')
|
||||||
|
|
||||||
|
|
||||||
|
# Detect Rosetta 2
|
||||||
|
if platform.system() == "Darwin" and platform.processor() == "i386":
|
||||||
|
if subprocess.run(
|
||||||
|
"sysctl -n sysctl.proc_translated".split(), check=True, capture_output=True, text=True,
|
||||||
|
).stdout.strip() == "1":
|
||||||
|
raise RuntimeError(textwrap.dedent("""\
|
||||||
|
Running GPT4All under Rosetta is not supported due to CPU feature requirements.
|
||||||
|
Please install GPT4All in an environment that uses a native ARM64 Python interpreter.
|
||||||
|
"""))
|
||||||
|
|
||||||
# Find CUDA libraries from the official packages
|
# Find CUDA libraries from the official packages
|
||||||
cuda_found = False
|
cuda_found = False
|
||||||
if platform.system() in ('Linux', 'Windows'):
|
if platform.system() in ('Linux', 'Windows'):
|
||||||
|
@ -68,7 +68,7 @@ def get_long_description():
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=package_name,
|
name=package_name,
|
||||||
version="3.0.0",
|
version="2.8.0.dev0",
|
||||||
description="Python bindings for GPT4All",
|
description="Python bindings for GPT4All",
|
||||||
long_description=get_long_description(),
|
long_description=get_long_description(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
Loading…
Reference in New Issue
Block a user