Skip to content

Commit

Permalink
community[patch]: Invoke callback prior to yielding token (titan_take…
Browse files Browse the repository at this point in the history
…off_pro) (#18624)

## PR title
community[patch]: Invoke callback prior to yielding token

## PR message
- Description: Invoke callback prior to yielding token in _stream_
method in llms/titan_takeoff_pro.
- Issue: #16913 
- Dependencies: None
  • Loading branch information
Lord-Haji committed Mar 20, 2024
1 parent 455a744 commit 7d216ad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ def _stream(
# Yield any remaining content in the buffer.
if buffer:
chunk = GenerationChunk(text=buffer.replace("</s>", ""))
yield chunk
if run_manager:
run_manager.on_llm_new_token(token=chunk.text)
yield chunk

@property
def _identifying_params(self) -> Mapping[str, Any]:
Expand Down

0 comments on commit 7d216ad

Please sign in to comment.