Skip to content

Commit

Permalink
Clarify --use-gpu flag -> --force-gpu, and hide on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jul 17, 2024
1 parent f6a4d9f commit bac353e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions autogpt/scripts/llamafile/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@
"--port", type=int, help="Specify the port for the llamafile server to listen on"
)
@click.option(
"--use-gpu", is_flag=True, help="Use an AMD or Nvidia GPU to speed up inference"
"--force-gpu",
is_flag=True,
hidden=platform.system() != "Darwin",
help="Run the model using only the GPU (AMD or Nvidia). "
"Otherwise, both CPU and GPU may be (partially) used.",
)
def main(
llamafile: Optional[Path] = None,
llamafile_url: Optional[str] = None,
host: Optional[str] = None,
port: Optional[int] = None,
use_gpu: bool = False,
force_gpu: bool = False,
):
print(f"type(llamafile) = {type(llamafile)}")
if not llamafile:
Expand Down Expand Up @@ -116,7 +120,7 @@ def main(
base_command.extend(["--host", host])
if port:
base_command.extend(["--port", str(port)])
if use_gpu:
if force_gpu:
base_command.extend(["-ngl", "9999"])

subprocess.run(
Expand Down

0 comments on commit bac353e

Please sign in to comment.