remove hard coded thread count
This commit is contained in:
parent
b6705b3762
commit
123531059e
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
from ctransformers import AutoModelForCausalLM, AutoConfig
|
from ctransformers import AutoModelForCausalLM, AutoConfig
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,7 +32,7 @@ def generate(llm, system_prompt, user_prompt):
|
||||||
seed=42,
|
seed=42,
|
||||||
reset=True, # reset history (cache)
|
reset=True, # reset history (cache)
|
||||||
stream=True, # streaming per word/token
|
stream=True, # streaming per word/token
|
||||||
threads=24, # adjust for your CPU
|
threads=os.cpu_count() / 2, # adjust for your CPU
|
||||||
stop=["<|im_end|>", "|<"],
|
stop=["<|im_end|>", "|<"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue