mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
add in Buffering..
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
parent
efeef0bed6
commit
ecbd956a4c
@ -1345,6 +1345,18 @@ pub(crate) async fn chat_completions(
|
|||||||
model_id.clone(),
|
model_id.clone(),
|
||||||
);
|
);
|
||||||
yield Ok::<Event, Infallible>(event);
|
yield Ok::<Event, Infallible>(event);
|
||||||
|
if stream_token.details.is_some() && stream_options
|
||||||
|
.as_ref()
|
||||||
|
.map(|s| s.include_usage)
|
||||||
|
.unwrap_or(false) {
|
||||||
|
let usage_event = create_usage_event_from_stream_token(
|
||||||
|
stream_token,
|
||||||
|
stream_options.clone(),
|
||||||
|
system_fingerprint.clone(),
|
||||||
|
model_id.clone(),
|
||||||
|
);
|
||||||
|
yield Ok::<Event, Infallible>(usage_event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user