Community
    • Login

    Request: GPT-2 based text generation

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 2 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Zachary MacLeodZ
      Zachary MacLeod
      last edited by

      There’s a website that does what I’m suggesting in a browser page: huggingface’s Write With Transformer. The problem is, it’s in a browser page.

      The general idea is, you press a button, and the last X number of words that come before your cursor are used as a prompt for GPT-2 to generate a small number of tokens, probably stopping when it completes a sentence. Ideally, you could control certain aspects of generation: maximum number of tokens, maximum number of seconds spent generating, maximum prompt size, top_p, temperature, and model size. It would also make sense if you could select a section of text to use that as a prompt.

      I gave creating this plugin an honest shot myself, however GPT-2 is developed in python and I don’t understand its code enough to recreate it using TensorFlowSharp or whatnot. If that were done, I imagine the rest wouldn’t be that hard…?

      I’m fairly certain there’d be a lot of interest in a plugin like this!

      1 Reply Last reply Reply Quote 1
      • Zachary MacLeodZ
        Zachary MacLeod
        last edited by

        If it helps, there’s a C# implementation of GPT-2 here, but it relies on a C# adaptation of tensorflow called Gradient, and I’m not sure if the license would allow its use for an NPP plugin? There’s also TensorFlowSharp, and TensorFlow.NET, but neither of them has a GPT-2 adaptation, and I’m not sure if either is necessarily better for this task.

        1 Reply Last reply Reply Quote 0
        • Victor MilovanovV
          Victor Milovanov
          last edited by

          Hi Zachary,

          I am the author of both Gradient and GPT-2 adaptation for it.
          Unless you are planning to sell your plugin, feel free to use Gradient. If you want to make it open-source, I’d be glad to provide help.

          Note though, that one would have to install Python + TensorFlow to use GPT-2.

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors