[go: nahoru, domu]

Skip to content

Commit

Permalink
Add flag to disable macOS Metal for llama.cpp when running builds
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed May 28, 2024
1 parent 7f241b0 commit 792f9db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/txtai/vectors/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def loadmodel(self, path):
modelargs = self.config.get("vectors", {})

# Default GPU layers if not already set
modelargs["n_gpu_layers"] = modelargs.get("n_gpu_layers", -1 if modelargs.get("gpu", os.environ.get("LLAMA_NO_METAL") != "1") else 0)
modelargs["n_gpu_layers"] = modelargs.get("n_gpu_layers", -1 if self.config.get("gpu", os.environ.get("LLAMA_NO_METAL") != "1") else 0)

# Create llama.cpp instance
return Llama(path, verbose=modelargs.pop("verbose", False), embedding=True, **modelargs)
Expand Down

0 comments on commit 792f9db

Please sign in to comment.