Add debug preset (deterministic, should always give the same responses)
This commit is contained in:
parent
5b60691367
commit
4820379139
2 changed files with 5 additions and 3 deletions
2
presets/Debug-deterministic.txt
Normal file
2
presets/Debug-deterministic.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
do_sample=False,
|
||||||
|
max_new_tokens=tokens,
|
|
@ -136,11 +136,11 @@ def fix_galactica(s):
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def encode(prompt, tokens):
|
def encode(prompt, tokens):
|
||||||
if not args.cpu:
|
if args.cpu:
|
||||||
|
input_ids = tokenizer.encode(str(prompt), return_tensors='pt', truncation=True, max_length=2048-tokens)
|
||||||
|
else:
|
||||||
torch.cuda.empty_cache()
|
torch.cuda.empty_cache()
|
||||||
input_ids = tokenizer.encode(str(prompt), return_tensors='pt', truncation=True, max_length=2048-tokens).cuda()
|
input_ids = tokenizer.encode(str(prompt), return_tensors='pt', truncation=True, max_length=2048-tokens).cuda()
|
||||||
else:
|
|
||||||
input_ids = tokenizer.encode(str(prompt), return_tensors='pt', truncation=True, max_length=2048-tokens)
|
|
||||||
return input_ids
|
return input_ids
|
||||||
|
|
||||||
def decode(output_ids):
|
def decode(output_ids):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue