starcoder icon indicating copy to clipboard operation
starcoder copied to clipboard

My device can not run this model, it tip 'Killed'

Open xiashuqin89 opened this issue 2 years ago • 1 comments
trafficstars

xiashuqin89 avatar May 22 '23 02:05 xiashuqin89

try to run it like that:

pipe=pipeline(
            "text-generation",
            model="bigcode/starcoder",
            torch_dtype=torch.bfloat16,
    
            device_map='auto',
        )
        
generation_config = GenerationConfig.from_pretrained(checkpoint)
response = pipe('def main('    , generation_config= GenerationConfig.from_dict(
            {**generation_config.to_dict(), 'max_new_tokens':max_length}
        ))
text = response[0]['generated_text']
print(f'{text}')

mi4uu avatar May 25 '23 23:05 mi4uu

It's probably due to OOM, you can check the hardware requirements at: https://github.com/bigcode-project/starcoder#inference-hardware-requirements

loubnabnl avatar Jun 13 '23 08:06 loubnabnl