Generate Text using OpenAIGPT2 in Python

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • Generate Text using OpenAIGPT2 using Python Pytorch.
    Code used in Video (Taken from huggingface):
    git clone github.com/gra...
    curl --output gpt2-pytorch_model.bin s3.amazonaws.c...
    pip install -r requirements.txt
    python main.py --text "We are living in information age. "

Комментарии • 26

  • @GandenKohkono
    @GandenKohkono 5 лет назад +4

    awesome video. thanks. i hope i can get tutorial to train new text.

  • @hawkkn1220
    @hawkkn1220 4 года назад +1

    Could you just share this Google Colab?

  • @sskkulk1070
    @sskkulk1070 5 лет назад +3

    Very informative, I have one question, I fine tuned BERT for squad dataset, is it possible to further finetune it on my own QA dataset? Also need help on inference side of squad, there are lots of examples on text classification using Bert but not on squad

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад +1

      For retraining, put your data in train.json
      Can you elaborate inference question

    • @sskkulk1070
      @sskkulk1070 5 лет назад +1

      Practical Matter yes, on inference side, if I have one text box (flask route) that contains paragraph(context) and one question related to that paragraph then it gives me output as an answer but, I want to make it like chatbot, means I don’t want to paste context paragraph every time, also can you suggest solution for my second comment? There are many people who formed HuggingFace’s implementation for fine tuning but I don’t know which one is best

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад +1

      Context has to be there.. As network parses question and context together to pay attention.

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад

      Whats the second Comment you are referring to?

    • @sskkulk1070
      @sskkulk1070 5 лет назад

      Practical Matter okay! Thanks for info:)

  • @ravitanwar9537
    @ravitanwar9537 4 года назад +1

    beautiful

  • @sskkulk1070
    @sskkulk1070 5 лет назад +1

    Also how to retrain gpt2 on new text?

  • @krq113
    @krq113 5 лет назад +1

    Thanks

  • @aysenur1445
    @aysenur1445 2 года назад

    Hello, thank you for the video, is there a way i can use it in another language, I couldn't see English being chosen in main.py as well so it must be default, any suggestions?

    • @SandeepBhutani
      @SandeepBhutani  2 года назад

      This is an old code.. Now get latest code from main website, there you may get option to chose other language model

  • @johnnny9
    @johnnny9 4 года назад

    is it possible to train it to rewrite text ?

  • @volotat
    @volotat 5 лет назад +1

    3:35 Am... Does model trying to tell us something?

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад

      In this video it is generating text based on learning... Are you pointing to some specific question?

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад

      Though it is saying we need to manage our time well and learn new things as we are surrounded by so many new state of art models :)

    • @volotat
      @volotat 5 лет назад +2

      ​@@SandeepBhutani No no no.. I pretty clearly see that is saying that it's going to kill us all.

    • @SandeepBhutani
      @SandeepBhutani  4 года назад

      Where are you stuck..

  • @WraithXxXx
    @WraithXxXx 5 лет назад

    Alright so I'm inexperienced and when I tried finally running the last command to print the text it gave me the error "no module named 'torch'" any ideas about what I missed?

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад +1

      You need to install pytorch

    • @WraithXxXx
      @WraithXxXx 5 лет назад +2

      @@SandeepBhutani I figured that out and just decided to use Google Drive instead of trying to download everything on windows. Much easier

    • @SandeepBhutani
      @SandeepBhutani  5 лет назад +1

      Great