Skip to content

Commit

Permalink
Merge pull request #69 from sunhailin-Leo/dev
Browse files Browse the repository at this point in the history
fix missing variable for grpc request
  • Loading branch information
sunhailin-Leo authored May 27, 2024
2 parents 411b960 + fdb012c commit fbc830d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/transformers/bert.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,21 @@ func (m *BertModelService) generateGRPCRequest(
m.grpcSliceToLittleEndianByteSlice(
m.MaxSeqLength, feature.TypeIDs, inferInputTensor[j].Datatype)...,
)
inferInputTensor[j].Shape = []int64{int64(len(inferDataArr)), int64(m.MaxSeqLength)}
case ModelBertModelInputIdsKey:
inputIdsBytes = append(
inputIdsBytes,
m.grpcSliceToLittleEndianByteSlice(
m.MaxSeqLength, feature.TokenIDs, inferInputTensor[j].Datatype)...,
)
inferInputTensor[j].Shape = []int64{int64(len(inferDataArr)), int64(m.MaxSeqLength)}
case ModelBertModelInputMaskKey:
inputMaskBytes = append(
inputMaskBytes,
m.grpcSliceToLittleEndianByteSlice(
m.MaxSeqLength, feature.Mask, inferInputTensor[j].Datatype)...,
)
inferInputTensor[j].Shape = []int64{int64(len(inferDataArr)), int64(m.MaxSeqLength)}
}
}
batchModelInputObjs[i] = inputObject
Expand Down

0 comments on commit fbc830d

Please sign in to comment.