mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-29 05:52:11 +00:00
Update router/src/server.rs
This commit is contained in:
parent
6777b1075d
commit
9b34930ba1
@ -1287,20 +1287,6 @@ pub(crate) async fn chat_completions(
|
|||||||
match result{
|
match result{
|
||||||
Ok(stream_token) => {
|
Ok(stream_token) => {
|
||||||
let token_text = &stream_token.token.text.clone();
|
let token_text = &stream_token.token.text.clone();
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
let usage = stream_token.details.as_ref().map(|details| {
|
|
||||||
let completion_tokens = details.generated_tokens;
|
|
||||||
let prompt_tokens = details.input_length;
|
|
||||||
let total_tokens = prompt_tokens + completion_tokens;
|
|
||||||
|
|
||||||
Usage {
|
|
||||||
completion_tokens,
|
|
||||||
prompt_tokens,
|
|
||||||
total_tokens,
|
|
||||||
}
|
|
||||||
});
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
match state {
|
match state {
|
||||||
StreamState::Buffering => {
|
StreamState::Buffering => {
|
||||||
json_buffer.push_str(&token_text.replace(" ", ""));
|
json_buffer.push_str(&token_text.replace(" ", ""));
|
||||||
|
Loading…
Reference in New Issue
Block a user