Fix example documentation
This commit is contained in:
parent
a836639822
commit
eef627c09c
1 changed files with 5 additions and 4 deletions
|
@ -127,10 +127,11 @@ class Llama:
|
||||||
]:
|
]:
|
||||||
"""Generate tokens.
|
"""Generate tokens.
|
||||||
|
|
||||||
>>> llama = Llama("models/117M")
|
Examples:
|
||||||
>>> tokens = llama.tokenize(b"Hello, world!")
|
>>> llama = Llama("models/ggml-7b.bin")
|
||||||
>>> for token in llama.generate(tokens, top_k=40, top_p=0.95, temp=1.0, repeat_penalty=1.1):
|
>>> tokens = llama.tokenize(b"Hello, world!")
|
||||||
... print(llama.detokenize([token]))
|
>>> for token in llama.generate(tokens, top_k=40, top_p=0.95, temp=1.0, repeat_penalty=1.1):
|
||||||
|
... print(llama.detokenize([token]))
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
tokens: The prompt tokens.
|
tokens: The prompt tokens.
|
||||||
|
|
Loading…
Reference in a new issue