Is that possible to generate texts from OpenAI GPT-2 using TensorFlowJS?
If not what is the limitation, like model format or ...?
It's possible. Maybe someone finds this useful in 2023:
One way to achieve this is to convert a TF model with tensorflowjs-converter
as Frederik described (possible problem with this approach is missing custom layers)
Use gpt-tfjs - implementation of GPT model in TensorFlow.js. It's possible to load weights directly from HF (example). I developed it to experiment with model training in the browser.
If you just want to generate text without training, you have more options:
transformers
library API. Unfortunately - inference only.