Fixed TextGenerationPipeline on torch + GPU (#5629)
* Pytorch gpu => cpu proper device * Memoryless XLNet warning + fixed memories during generation * Revert "Memoryless XLNet warning + fixed memories during generation" This reverts commit 3d3251ff * Took the operations on the generated_sequence out of the ensure_device scope
This commit is contained in:
@@ -689,6 +689,8 @@ class TextGenerationPipeline(Pipeline):
|
||||
|
||||
result = []
|
||||
for generated_sequence in output_sequences:
|
||||
if self.framework == "pt" and generated_sequence is not None:
|
||||
generated_sequence = generated_sequence.cpu()
|
||||
generated_sequence = generated_sequence.numpy().tolist()
|
||||
record = {}
|
||||
if return_tensors:
|
||||
|
||||
Reference in New Issue
Block a user