Fix sysctl check on non-arm Macs

Signed-off-by: Frank Murphy <frank@wallaroo.ai>
This commit is contained in:
Frank Murphy 2024-09-25 17:20:06 -04:00
parent 1047c5e038
commit 355d5bc14e

View File

@ -32,7 +32,7 @@ EmbeddingsType = TypeVar('EmbeddingsType', bound='list[Any]')
# Detect Rosetta 2 # Detect Rosetta 2
if platform.system() == "Darwin" and platform.processor() == "i386": if platform.system() == "Darwin" and platform.processor() == "i386":
if subprocess.run( if subprocess.run(
"sysctl -n sysctl.proc_translated".split(), check=True, capture_output=True, text=True, "sysctl -n sysctl.proc_translated".split(), capture_output=True, text=True,
).stdout.strip() == "1": ).stdout.strip() == "1":
raise RuntimeError(textwrap.dedent("""\ raise RuntimeError(textwrap.dedent("""\
Running GPT4All under Rosetta is not supported due to CPU feature requirements. Running GPT4All under Rosetta is not supported due to CPU feature requirements.