diff --git a/src/transformers/pipelines.py b/src/transformers/pipelines.py
index <HASH>..<HASH> 100755
--- a/src/transformers/pipelines.py
+++ b/src/transformers/pipelines.py
@@ -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:
Fixed TextGenerationPipeline on torch + GPU (#<I>)

* Pytorch gpu => cpu proper device



* Memoryless XLNet warning + fixed memories during generation



* Revert "Memoryless XLNet warning + fixed memories during generation"



This reverts commit 3d<I>ff



* Took the operations on the generated_sequence out of the ensure_device scope