starcoder icon indicating copy to clipboard operation
starcoder copied to clipboard

8bit model output <endoftext>

Open para-lost opened this issue 2 years ago • 2 comments
trafficstars

Hi, I'm using the 8bit version, and tried the demo case. However, I got an output . This is my code: from transformers import AutoModelForCausalLM, AutoTokenizer checkpoint = "bigcode/starcoder" device = "cuda"

tokenizer = AutoTokenizer.from_pretrained(checkpoint) model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map='auto', load_in_8bit=True)

inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device) outputs = model.generate(inputs) print(tokenizer.decode(outputs[0], clean_up_tokenization_spaces=False))

And the output is: def print_hello_world():<|endoftext|>

para-lost avatar Jul 25 '23 17:07 para-lost

Hi. I can not reproduce your error on my side. I tried to run your code and I got

def print_hello_world():
   print("Hello World")

def print_hello_

Can you share your version of transformers, datasets, accelerate & bitsandbytes?

ArmelRandy avatar Aug 01 '23 09:08 ArmelRandy

Hey, I'm using transformers: 4.28.1, datasets: 2.11.0, accelerate: 0.18.0, bitsandbytes: 0.41.0

para-lost avatar Aug 02 '23 23:08 para-lost