Open AI GPT-2 and openFrameworks

I need to generate texts using the most recent Open AI’s GPT-2 model – https://github.com/openai/gpt-2-output-dataset

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 https://akanyaani.github.io/gpt-2-tensorflow2.0/ ?

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 https://github.com/genekogan/ofxRunway 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. https://github.com/runwayml/ofxRunway
I haven’t added the examples for using GPT-2 but I can add it during the weekend. Hope this helps

2 Likes

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 ofxaddons.com
dlib, via ofxDlib might be useful