mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-05 11:36:16 +00:00
app.py: add --device option for GPU support (#1769)
Signed-off-by: Daniel Salvatierra <dsalvat1@gmail.com> Co-authored-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
528eb1e7ad
commit
c72c73a94f
@ -59,9 +59,13 @@ def repl(
|
|||||||
int,
|
int,
|
||||||
typer.Option("--n-threads", "-t", help="Number of threads to use for chatbot"),
|
typer.Option("--n-threads", "-t", help="Number of threads to use for chatbot"),
|
||||||
] = None,
|
] = None,
|
||||||
|
device: Annotated[
|
||||||
|
str,
|
||||||
|
typer.Option("--device", "-d", help="Device to use for chatbot, e.g. gpu, amd, nvidia, intel. Defaults to CPU."),
|
||||||
|
] = None,
|
||||||
):
|
):
|
||||||
"""The CLI read-eval-print loop."""
|
"""The CLI read-eval-print loop."""
|
||||||
gpt4all_instance = GPT4All(model)
|
gpt4all_instance = GPT4All(model, device=device)
|
||||||
|
|
||||||
# if threads are passed, set them
|
# if threads are passed, set them
|
||||||
if n_threads is not None:
|
if n_threads is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user