mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-02 09:40:42 +00:00
Do not ignore explicitly passed 4 threads
This commit is contained in:
parent
a2e2a64899
commit
e362e18431
@ -51,12 +51,12 @@ def repl(
|
|||||||
n_threads: Annotated[
|
n_threads: Annotated[
|
||||||
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"),
|
||||||
] = 4,
|
] = None,
|
||||||
):
|
):
|
||||||
gpt4all_instance = GPT4All(model)
|
gpt4all_instance = GPT4All(model)
|
||||||
|
|
||||||
# if threads are passed, set them
|
# if threads are passed, set them
|
||||||
if n_threads != 4:
|
if n_threads is not None:
|
||||||
num_threads = gpt4all_instance.model.thread_count()
|
num_threads = gpt4all_instance.model.thread_count()
|
||||||
print(f"\nAdjusted: {num_threads} →", end="")
|
print(f"\nAdjusted: {num_threads} →", end="")
|
||||||
|
|
||||||
@ -65,7 +65,8 @@ def repl(
|
|||||||
|
|
||||||
num_threads = gpt4all_instance.model.thread_count()
|
num_threads = gpt4all_instance.model.thread_count()
|
||||||
print(f" {num_threads} threads", end="", flush=True)
|
print(f" {num_threads} threads", end="", flush=True)
|
||||||
|
else:
|
||||||
|
print(f"\nUsing {gpt4all_instance.model.thread_count()} threads", end="")
|
||||||
|
|
||||||
# overwrite _response_callback on model
|
# overwrite _response_callback on model
|
||||||
gpt4all_instance.model._response_callback = _cli_override_response_callback
|
gpt4all_instance.model._response_callback = _cli_override_response_callback
|
||||||
|
Loading…
Reference in New Issue
Block a user