diff --git a/gpt4all-bindings/python/gpt4all/_pyllmodel.py b/gpt4all-bindings/python/gpt4all/_pyllmodel.py index 284d8ab3..4c52a5b1 100644 --- a/gpt4all-bindings/python/gpt4all/_pyllmodel.py +++ b/gpt4all-bindings/python/gpt4all/_pyllmodel.py @@ -6,6 +6,7 @@ import platform import re import subprocess import sys +import textwrap import threading from enum import Enum from queue import Queue @@ -28,6 +29,16 @@ if TYPE_CHECKING: 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 cuda_found = False if platform.system() in ('Linux', 'Windows'): diff --git a/gpt4all-bindings/python/setup.py b/gpt4all-bindings/python/setup.py index 85dbe8ab..4c9c48e1 100644 --- a/gpt4all-bindings/python/setup.py +++ b/gpt4all-bindings/python/setup.py @@ -68,7 +68,7 @@ def get_long_description(): setup( name=package_name, - version="3.0.0", + version="2.8.0.dev0", description="Python bindings for GPT4All", long_description=get_long_description(), long_description_content_type="text/markdown",