Update README.md
Browse files
README.md
CHANGED
@@ -47,9 +47,9 @@ model = BloomForCausalLM.from_pretrained(ckpt).to(device)
|
|
47 |
|
48 |
def generate_prompt(text):
|
49 |
inputs = tokenizer(text, return_tensors='pt')
|
50 |
-
input_ids = inputs.input_ids.to(
|
51 |
-
attention_mask = inputs.attention_mask.to(
|
52 |
-
output = model.generate(input_ids, attention_mask=attention_mask, max_length=2048, eos_token_id=tokenizer.eos_token_id)
|
53 |
|
54 |
return tokenizer.decode(output[0], skip_special_tokens=False)
|
55 |
|
|
|
47 |
|
48 |
def generate_prompt(text):
|
49 |
inputs = tokenizer(text, return_tensors='pt')
|
50 |
+
input_ids = inputs.input_ids.to(device)
|
51 |
+
attention_mask = inputs.attention_mask.to(device)
|
52 |
+
output = model.generate(input_ids, attention_mask=attention_mask, max_length=2048, eos_token_id=tokenizer.eos_token_id)
|
53 |
|
54 |
return tokenizer.decode(output[0], skip_special_tokens=False)
|
55 |
|