Open AI GPT-2 and openFrameworks

I need to generate texts using the most recent Open AI’s GPT-2 model –

It could be possible to use it in openframeworks for real time generation? What could be a good set of addons/tools? @memo 's ofxTensorflow could work in this case using something like ?

Thanks for any hint!

One of the easiest ways to do this is to use RunwayML. They have the newest 1.5B parameter checkpoint available already. You can communicate between RunwayML and openFrameworks in a number of ways, including via osc or the REST api. You might see if is working. Otherwise, you can wrap your own example pretty easily via OSC.

I can’t be online for this. It’s possible to run it locally?

Yes. You should be able to run it locally on the CPU (Windows / macOS / Linux). You can run it on a NVidia GPU locally on Linux.

1 Like

Hi, you can run gpt2 locally using runway. I am currently working on updating the openframeworks addon for it as gene’s was a bit outdated.
I haven’t added the examples for using GPT-2 but I can add it during the weekend. Hope this helps


The Runway ML option is the only one for running AI/ML models in oF?
If I would like something running in the same app, natively
–any ideas about how to achieve that?
–if not, using tensor flow via python could be possible? how?

You can run whatever you want to in OF. As it is C++ and most libraries are built on C++ it is quite possible. Take a look at the available addons in
dlib, via ofxDlib might be useful