Skip to content

Commit

Permalink
fix setup snippet_id
Browse files Browse the repository at this point in the history
  • Loading branch information
reymondzzzz committed Jan 12, 2024
1 parent 6f8a687 commit 7b5b80e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,6 @@ class CompletionMode(
return@streamedInferenceFetch
}

if ((!completionInProgress)
|| (choice.delta.isEmpty() && !choice.finishReason.isNullOrEmpty())) {
return@streamedInferenceFetch
}
val completion: Completion = if (completionLayout?.lastCompletionData == null ||
completionLayout?.lastCompletionData?.createdTs != prediction.created) {
Completion(request.body.inputs.sources.values.toList().first(),
Expand All @@ -243,6 +239,10 @@ class CompletionMode(
if (completion.snippetTelemetryId == null) {
completion.snippetTelemetryId = prediction.snippetTelemetryId
}
if ((!completionInProgress)
|| (choice.delta.isEmpty() && !choice.finishReason.isNullOrEmpty())) {
return@streamedInferenceFetch
}
completion.updateCompletion(choice.delta)
synchronized(this) {
renderCompletion(
Expand Down

0 comments on commit 7b5b80e

Please sign in to comment.