{
  "id": 116896,
  "title": "GPT-2 and BERT Pretrained Weights (pytorch)",
  "url": "/competitions/tensorflow2-question-answering/discussion/116896",
  "author_name": "",
  "post_date": "2019-11-12T06:27:13.849509900Z",
  "votes": 18,
  "comment_count": 10,
  "views": 0,
  "content": "<p>Since we are not allowed internet, you can find weights for BERT and GPT-2 models (pytorch), ready to be used with HuggingFace's Transformers or your own models ;)</p>\n\n<p><a href=\"https://www.kaggle.com/abhishek/bert-pytorch\">https://www.kaggle.com/abhishek/bert-pytorch</a>\n<a href=\"https://www.kaggle.com/abhishek/gpt2-pytorch\">https://www.kaggle.com/abhishek/gpt2-pytorch</a></p>",
  "messages": [
    {
      "id": "671010",
      "postDate": "11/12/2019 06:27:13",
      "content": "<p>Since we are not allowed internet, you can find weights for BERT and GPT-2 models (pytorch), ready to be used with HuggingFace's Transformers or your own models ;)</p>\n\n<p><a href=\"https://www.kaggle.com/abhishek/bert-pytorch\">https://www.kaggle.com/abhishek/bert-pytorch</a>\n<a href=\"https://www.kaggle.com/abhishek/gpt2-pytorch\">https://www.kaggle.com/abhishek/gpt2-pytorch</a></p>",
      "rawMarkdown": "Since we are not allowed internet, you can find weights for BERT and GPT-2 models (pytorch), ready to be used with HuggingFace's Transformers or your own models ;)\n\nhttps://www.kaggle.com/abhishek/bert-pytorch\nhttps://www.kaggle.com/abhishek/gpt2-pytorch",
      "votes": null
    },
    {
      "id": "671205",
      "postDate": "11/12/2019 11:36:19",
      "content": "<p>Thanks for sharing. Is there a way to use pytorch model's weights in tensorflow 2? because according to competition rules, we are only allowed to use tf2.\nI am not sure if we can use <a href=\"https://github.com/huggingface/transformers\">huggingface</a> or not.</p>",
      "rawMarkdown": "Thanks for sharing. Is there a way to use pytorch model's weights in tensorflow 2? because according to competition rules, we are only allowed to use tf2.\nI am not sure if we can use [huggingface](https://github.com/huggingface/transformers) or not.",
      "votes": null
    },
    {
      "id": "671209",
      "postDate": "11/12/2019 11:40:13",
      "content": "<p>where does it say that we are only allowed to use tf2? </p>\n\n<p>btw, here are BERT tf weights: <a href=\"https://www.kaggle.com/abhishek/bert-tensorflow\">https://www.kaggle.com/abhishek/bert-tensorflow</a></p>",
      "rawMarkdown": "where does it say that we are only allowed to use tf2? \n\nbtw, here are BERT tf weights: https://www.kaggle.com/abhishek/bert-tensorflow",
      "votes": null
    },
    {
      "id": "671329",
      "postDate": "11/12/2019 14:31:22",
      "content": "<p>\"To be eligible for the TensorFlow 2.0 prizes, your code must use TensorFlow 2.0. More specifically:</p>\n\n<ul>\n<li><p>it should run with a public release of TensorFlow 2.0 installed, and</p></li>\n<li><p>should not use any tf.compat.v1 module symbols and should not raise deprecation warnings\"</p></li>\n</ul>\n\n<p>thanks for your fast response. </p>",
      "rawMarkdown": "\"To be eligible for the TensorFlow 2.0 prizes, your code must use TensorFlow 2.0. More specifically:\n\n - it should run with a public release of TensorFlow 2.0 installed, and\n\n - should not use any tf.compat.v1 module symbols and should not raise deprecation warnings\"\n\nthanks for your fast response.",
      "votes": null
    },
    {
      "id": "671333",
      "postDate": "11/12/2019 14:37:02",
      "content": "<p>Yes. But there is also normal prize :D For that you can use anything you want. I hope I’m not wrong here.</p>",
      "rawMarkdown": "Yes. But there is also normal prize :D For that you can use anything you want. I hope I’m not wrong here.",
      "votes": null
    },
    {
      "id": "671365",
      "postDate": "11/12/2019 15:18:03",
      "content": "<p>You're right. There are two sets of prizes: one from Kaggle and one from TensorFlow.</p>",
      "rawMarkdown": "You're right. There are two sets of prizes: one from Kaggle and one from TensorFlow.",
      "votes": null
    },
    {
      "id": "671366",
      "postDate": "11/12/2019 15:19:35",
      "content": "<p>Is there a description somewhere how to read and use the bin files? What's the structure and format? Is there an equivalent for TF2.0? Thanks.</p>",
      "rawMarkdown": "Is there a description somewhere how to read and use the bin files? What's the structure and format? Is there an equivalent for TF2.0? Thanks.",
      "votes": null
    },
    {
      "id": "671832",
      "postDate": "11/13/2019 07:55:06",
      "content": "<p>Thank you for the weights!! Surely would be helpful for lot of us. \nHow about creating a baseline kernel(from the king of NLP) showing how to use these weights ?</p>",
      "rawMarkdown": "Thank you for the weights!! Surely would be helpful for lot of us. \nHow about creating a baseline kernel(from the king of NLP) showing how to use these weights ?",
      "votes": null
    },
    {
      "id": "679154",
      "postDate": "11/22/2019 10:31:38",
      "content": "<p>Thanks. As pytorch user, I'll definitely go to pytorch. But as I'm not nlp expert, I wonder is it possible to reproduce bert performance by pytorch? Is there an advantage of using TF over pytorch in nlp competition?</p>",
      "rawMarkdown": "Thanks. As pytorch user, I'll definitely go to pytorch. But as I'm not nlp expert, I wonder is it possible to reproduce bert performance by pytorch? Is there an advantage of using TF over pytorch in nlp competition?",
      "votes": null
    },
    {
      "id": "681177",
      "postDate": "11/25/2019 19:50:27",
      "content": "<p>This link might help you with what you want. I have not used pytorch so I am looking to load a pre-trained BERT and then train a layer on top of that.\n<a href=\"https://colab.research.google.com/drive/1ywsvwO6thOVOrfagjjfuxEf6xVRxbUNO#scrollTo=3UfxtwQy3axu\">https://colab.research.google.com/drive/1ywsvwO6thOVOrfagjjfuxEf6xVRxbUNO#scrollTo=3UfxtwQy3axu</a></p>",
      "rawMarkdown": "This link might help you with what you want. I have not used pytorch so I am looking to load a pre-trained BERT and then train a layer on top of that.\nhttps://colab.research.google.com/drive/1ywsvwO6thOVOrfagjjfuxEf6xVRxbUNO#scrollTo=3UfxtwQy3axu",
      "votes": null
    },
    {
      "id": "718615",
      "postDate": "01/14/2020 15:32:06",
      "content": "<p>Pretrained on  what?</p>",
      "rawMarkdown": "Pretrained on  what?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 671205,
      "author_name": "shervinshervin",
      "author_url": "",
      "post_date": "11/12/2019 11:36:19",
      "content": "<p>Thanks for sharing. Is there a way to use pytorch model's weights in tensorflow 2? because according to competition rules, we are only allowed to use tf2.\nI am not sure if we can use <a href=\"https://github.com/huggingface/transformers\">huggingface</a> or not.</p>",
      "votes": null,
      "replies": [
        {
          "id": 671209,
          "author_name": "abhishek",
          "author_url": "",
          "post_date": "11/12/2019 11:40:13",
          "content": "<p>where does it say that we are only allowed to use tf2? </p>\n\n<p>btw, here are BERT tf weights: <a href=\"https://www.kaggle.com/abhishek/bert-tensorflow\">https://www.kaggle.com/abhishek/bert-tensorflow</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 671329,
          "author_name": "shervinshervin",
          "author_url": "",
          "post_date": "11/12/2019 14:31:22",
          "content": "<p>\"To be eligible for the TensorFlow 2.0 prizes, your code must use TensorFlow 2.0. More specifically:</p>\n\n<ul>\n<li><p>it should run with a public release of TensorFlow 2.0 installed, and</p></li>\n<li><p>should not use any tf.compat.v1 module symbols and should not raise deprecation warnings\"</p></li>\n</ul>\n\n<p>thanks for your fast response. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 671333,
          "author_name": "abhishek",
          "author_url": "",
          "post_date": "11/12/2019 14:37:02",
          "content": "<p>Yes. But there is also normal prize :D For that you can use anything you want. I hope I’m not wrong here.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 671365,
          "author_name": "arvindpdmn",
          "author_url": "",
          "post_date": "11/12/2019 15:18:03",
          "content": "<p>You're right. There are two sets of prizes: one from Kaggle and one from TensorFlow.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 671366,
      "author_name": "arvindpdmn",
      "author_url": "",
      "post_date": "11/12/2019 15:19:35",
      "content": "<p>Is there a description somewhere how to read and use the bin files? What's the structure and format? Is there an equivalent for TF2.0? Thanks.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 671832,
      "author_name": "bibek777",
      "author_url": "",
      "post_date": "11/13/2019 07:55:06",
      "content": "<p>Thank you for the weights!! Surely would be helpful for lot of us. \nHow about creating a baseline kernel(from the king of NLP) showing how to use these weights ?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 679154,
      "author_name": "niuddd",
      "author_url": "",
      "post_date": "11/22/2019 10:31:38",
      "content": "<p>Thanks. As pytorch user, I'll definitely go to pytorch. But as I'm not nlp expert, I wonder is it possible to reproduce bert performance by pytorch? Is there an advantage of using TF over pytorch in nlp competition?</p>",
      "votes": null,
      "replies": [
        {
          "id": 681177,
          "author_name": "kevinehsani",
          "author_url": "",
          "post_date": "11/25/2019 19:50:27",
          "content": "<p>This link might help you with what you want. I have not used pytorch so I am looking to load a pre-trained BERT and then train a layer on top of that.\n<a href=\"https://colab.research.google.com/drive/1ywsvwO6thOVOrfagjjfuxEf6xVRxbUNO#scrollTo=3UfxtwQy3axu\">https://colab.research.google.com/drive/1ywsvwO6thOVOrfagjjfuxEf6xVRxbUNO#scrollTo=3UfxtwQy3axu</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 718615,
      "author_name": "cpmpml",
      "author_url": "",
      "post_date": "01/14/2020 15:32:06",
      "content": "<p>Pretrained on  what?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "671010": "Since we are not allowed internet, you can find weights for BERT and GPT-2 models (pytorch), ready to be used with HuggingFace's Transformers or your own models ;)\n\nhttps://www.kaggle.com/abhishek/bert-pytorch\nhttps://www.kaggle.com/abhishek/gpt2-pytorch",
    "671205": "Thanks for sharing. Is there a way to use pytorch model's weights in tensorflow 2? because according to competition rules, we are only allowed to use tf2.\nI am not sure if we can use [huggingface](https://github.com/huggingface/transformers) or not.",
    "671209": "where does it say that we are only allowed to use tf2? \n\nbtw, here are BERT tf weights: https://www.kaggle.com/abhishek/bert-tensorflow",
    "671329": "\"To be eligible for the TensorFlow 2.0 prizes, your code must use TensorFlow 2.0. More specifically:\n\n - it should run with a public release of TensorFlow 2.0 installed, and\n\n - should not use any tf.compat.v1 module symbols and should not raise deprecation warnings\"\n\nthanks for your fast response.",
    "671333": "Yes. But there is also normal prize :D For that you can use anything you want. I hope I’m not wrong here.",
    "671365": "You're right. There are two sets of prizes: one from Kaggle and one from TensorFlow.",
    "671366": "Is there a description somewhere how to read and use the bin files? What's the structure and format? Is there an equivalent for TF2.0? Thanks.",
    "671832": "Thank you for the weights!! Surely would be helpful for lot of us. \nHow about creating a baseline kernel(from the king of NLP) showing how to use these weights ?",
    "679154": "Thanks. As pytorch user, I'll definitely go to pytorch. But as I'm not nlp expert, I wonder is it possible to reproduce bert performance by pytorch? Is there an advantage of using TF over pytorch in nlp competition?",
    "681177": "This link might help you with what you want. I have not used pytorch so I am looking to load a pre-trained BERT and then train a layer on top of that.\nhttps://colab.research.google.com/drive/1ywsvwO6thOVOrfagjjfuxEf6xVRxbUNO#scrollTo=3UfxtwQy3axu",
    "718615": "Pretrained on  what?"
  },
  "source": "meta"
}