Method
__init__
(
self, tokenizer, history: History = None, skip_prompt: bool = False, timeout: Optional[float] = None,
**decode_kwargs
)
Source from the content-addressed store, hash-verified
| 70 | """ |
| 71 | |
| 72 | def __init__( |
| 73 | self, tokenizer, history: History = None, skip_prompt: bool = False, timeout: Optional[float] = None, |
| 74 | **decode_kwargs |
| 75 | ): |
| 76 | |
| 77 | self.tokenizer = tokenizer |
| 78 | self.history = history |
| 79 | self.skip_prompt = skip_prompt |
| 80 | self.timeout = timeout |
| 81 | self.decode_kwargs = decode_kwargs |
| 82 | |
| 83 | self.text_queue = Queue() |
| 84 | self.cache_time = 0 |
| 85 | self.text_until = "" |
| 86 | self.token_until = [] |
| 87 | self.stop_signal = None |
| 88 | self.next_tokens_are_prompt = True |
| 89 | |
| 90 | self.history.append({"role": "bot", "content": self.text_until}) |
| 91 | |
| 92 | def put(self, value): |
| 93 | """ |
Callers
nothing calls this directly
Tested by
no test coverage detected