Prevent double-closing of tensors in TransformersEmbeddingModel
This commit is contained in:
@@ -341,9 +341,15 @@ public class TransformersEmbeddingModel extends AbstractEmbeddingModel implement
|
||||
}
|
||||
}
|
||||
finally {
|
||||
inputIds.close();
|
||||
attentionMask.close();
|
||||
tokenTypeIds.close();
|
||||
if (!inputIds.isClosed()) {
|
||||
inputIds.close();
|
||||
}
|
||||
if (!attentionMask.isClosed()) {
|
||||
attentionMask.close();
|
||||
}
|
||||
if (!tokenTypeIds.isClosed()) {
|
||||
tokenTypeIds.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user