mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
Fix index in chat completion chunk
This commit is contained in:
parent
0d9917f744
commit
9a12e141d7
@ -524,7 +524,6 @@ impl ChatCompletionChunk {
|
|||||||
delta: Option<String>,
|
delta: Option<String>,
|
||||||
tool_calls: Option<Vec<String>>,
|
tool_calls: Option<Vec<String>>,
|
||||||
created: u64,
|
created: u64,
|
||||||
index: u32,
|
|
||||||
logprobs: Option<ChatCompletionLogprobs>,
|
logprobs: Option<ChatCompletionLogprobs>,
|
||||||
finish_reason: Option<String>,
|
finish_reason: Option<String>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
@ -535,7 +534,7 @@ impl ChatCompletionChunk {
|
|||||||
model,
|
model,
|
||||||
system_fingerprint,
|
system_fingerprint,
|
||||||
choices: vec![ChatCompletionChoice {
|
choices: vec![ChatCompletionChoice {
|
||||||
index,
|
index: 0,
|
||||||
delta: ChatCompletionDelta {
|
delta: ChatCompletionDelta {
|
||||||
role: "assistant".to_string(),
|
role: "assistant".to_string(),
|
||||||
content: delta,
|
content: delta,
|
||||||
|
@ -895,7 +895,6 @@ async fn chat_completions(
|
|||||||
content,
|
content,
|
||||||
tool_calls,
|
tool_calls,
|
||||||
current_time,
|
current_time,
|
||||||
stream_token.index,
|
|
||||||
logprobs,
|
logprobs,
|
||||||
stream_token.details.map(|d| d.finish_reason.to_string()),
|
stream_token.details.map(|d| d.finish_reason.to_string()),
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user