8000 Deprecate generate method · coderonion/llama-cpp-python@6cf5876 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6cf5876

Browse files
committed
Deprecate generate method
1 parent b3805bb commit 6cf5876

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llama_cpp/llama.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import uuid
44
import time
55
import math
6+
import warnings
67
import multiprocessing
78
from typing import List, Optional, Union, Generator, Sequence, Iterator
89
from collections import deque
@@ -239,6 +240,11 @@ def generate(
239240
Yields:
240241
The generated tokens.
241242
"""
243+
warnings.warn(
244+
"Llama.generate is deprecated and will be removed in v0.2.0",
245+
DeprecationWarning,
246+
stacklevel=2,
247+
)
242248
assert self.ctx is not None
243249
self.reset()
244250
while True:

0 commit comments

Comments
 (0)
0