Bump transformers (16-bit llama must be reconverted/redownloaded)

This commit is contained in:
oobabooga 2023-04-06 16:04:03 -03:00
parent 5f4f38ca5d
commit 113f94b61e
3 changed files with 8 additions and 2 deletions

View file

@ -28,6 +28,10 @@ def encode(prompt, tokens_to_generate=0, add_special_tokens=True):
return input_ids
else:
input_ids = shared.tokenizer.encode(str(prompt), return_tensors='pt', truncation=True, max_length=get_max_prompt_length(tokens_to_generate), add_special_tokens=add_special_tokens)
if type(shared.tokenizer) is transformers.LlamaTokenizer and input_ids[0][0] == 29871:
input_ids = input_ids[:,1:]
if shared.args.cpu:
return input_ids
elif shared.args.flexgen: