Various ctransformers fixes (#3556)
--------- Co-authored-by: cal066 <cal066@users.noreply.github.com>
This commit is contained in:
parent
b8df4a436e
commit
66c04c304d
4 changed files with 33 additions and 6 deletions
|
@ -18,6 +18,7 @@ class CtransformersModel:
|
|||
threads=shared.args.threads,
|
||||
gpu_layers=shared.args.n_gpu_layers,
|
||||
batch_size=shared.args.n_batch,
|
||||
context_length=shared.args.n_ctx,
|
||||
stream=True
|
||||
)
|
||||
|
||||
|
@ -31,7 +32,7 @@ class CtransformersModel:
|
|||
return result, result
|
||||
|
||||
def model_type_is_auto(self):
|
||||
return shared.args.model_type == "Auto" or shared.args.model_type == "None"
|
||||
return shared.args.model_type is None or shared.args.model_type == "Auto" or shared.args.model_type == "None"
|
||||
|
||||
def model_dir(self, path):
|
||||
if path.is_file():
|
||||
|
@ -48,7 +49,7 @@ class CtransformersModel:
|
|||
def generate(self, prompt, state, callback=None):
|
||||
prompt = prompt if type(prompt) is str else prompt.decode()
|
||||
# ctransformers uses -1 for random seed
|
||||
generator = self.model._stream(
|
||||
generator = self.model(
|
||||
prompt=prompt,
|
||||
max_new_tokens=state['max_new_tokens'],
|
||||
temperature=state['temperature'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue