Skip to content

Commit

Permalink
don't print out 'event:error' in streaming mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Nov 4, 2024
1 parent 85d5a03 commit b3fe64d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions llgtrt/src/routes/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,8 @@ impl ReqInfo {
if !self.is_run {
if let Some(err) = &response.error {
log::error!("received error message: {}", err);
// Corresponds to https://github.com/openai/openai-python/blob/17ac6779958b2b74999c634c4ea4c7b74906027a/src/openai/_streaming.py#L113
return Event::default()
.event("error")
// .event("error")
.json_data(json!({
"error": {
"status_code": 500,
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-infer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ curl -X POST "${TRT_API_BASE}completions" \
"prompt": "Here is a one line joke: ",
"max_tokens": 100,
"temperature": 0.7,
"n": 5
"n": 1
}'
;;

Expand Down

0 comments on commit b3fe64d

Please sign in to comment.