Two new options: truncation length and ban eos token

This commit is contained in:
oobabooga 2023-04-11 18:46:06 -03:00 committed by GitHub
parent 749c08a4ff
commit cacbcda208
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 48 deletions

View file

@ -189,7 +189,6 @@ def load_model(model_name):
pass
else:
tokenizer = AutoTokenizer.from_pretrained(Path(f"{shared.args.model_dir}/{shared.model_name}/"))
tokenizer.truncation_side = 'left'
print(f"Loaded the model in {(time.time()-t0):.2f} seconds.")
return model, tokenizer