Sharathhebbar24
commited on
Commit
•
57b7106
1
Parent(s):
911ef42
Update README.md
Browse files
README.md
CHANGED
@@ -44,7 +44,7 @@ prompt.
|
|
44 |
>>> tokenizer = AutoTokenizer.from_pretrained(model_name)
|
45 |
>>> def generate_text(prompt):
|
46 |
>>> inputs = tokenizer.encode(prompt, return_tensors='pt')
|
47 |
-
>>> outputs =
|
48 |
>>> generated = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
49 |
>>> return generated[:generated.rfind(".")+1]
|
50 |
>>> prompt = "What structure is classified as a definite lie algebra?"
|
|
|
44 |
>>> tokenizer = AutoTokenizer.from_pretrained(model_name)
|
45 |
>>> def generate_text(prompt):
|
46 |
>>> inputs = tokenizer.encode(prompt, return_tensors='pt')
|
47 |
+
>>> outputs = model.generate(inputs, max_length=64, pad_token_id=tokenizer.eos_token_id)
|
48 |
>>> generated = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
49 |
>>> return generated[:generated.rfind(".")+1]
|
50 |
>>> prompt = "What structure is classified as a definite lie algebra?"
|