Skip to content

Commit

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

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

## PR message
- Description: Invoke callback prior to yielding token in _stream_
method in llms/pai_eas_endpoint.
- Issue: #16913 
- Dependencies: None
  • Loading branch information
Lord-Haji committed Mar 20, 2024
1 parent 140f06e commit 9525e39
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ def _stream(
# yield text, if any
if text:
res = GenerationChunk(text=text)
yield res
if run_manager:
run_manager.on_llm_new_token(res.text)
yield res

# break if stop sequence found
if stop_seq_found:
Expand Down

0 comments on commit 9525e39

Please sign in to comment.