Pipeline for text generation
Hello,
* pipelines concise syntax and features are really nice, but there is none for text generation from left context
* `examples/run_generation.py` concise syntax (and some model-specific preprocessing) are really nice, but it is made for use via CLI and not from code

Any chance we see a text generation pipeline (optionally with some of the `run_generation.py` features) coming to 🤗 Transformers ?
There is currently no text generation pipeline, but the `generate` method on both PyTorch/TensorFlow models is here for that purpose!

[Here's](https://huggingface.co/transformers/usage.html#causal-language-modeling) an example using that method for generating from left context :).<|||||>You are right, I thought there was a great deal of abstraction done by the `run_generation.py` script given its length, but it turns out except for a few things, it's just interfacing with the CLI. I will be fine with the vanilla `generate` function!

Thanks for the rapid answer :)

---

For future reference (hey there future me!), "a few things" are:
* tokenizer encoding+decoding
* careful seed initialization
* moving everything to cuda device
* stop token handling
* nice logging
* (padding text for some models)
* (capping generation length)<|||||>@LysandreJik Is there a way to generate text given context in a random position? For example, given a keyword 'window' I'd like to generate text that contains 'window', doesn't matter where. For example:

* she was looking out the window
* cleaning that window was a difficult task