{
  "id": 410130,
  "title": "The way of upload Transformer Repository to Datasets for Internet off notebook.",
  "url": "/competitions/benetech-making-graphs-accessible/discussion/410130",
  "author_name": "",
  "post_date": "2023-05-14T03:21:17.341099100Z",
  "votes": 7,
  "comment_count": 9,
  "views": 0,
  "content": "<p>This competition often requires the latest version of Transformer, which is installed with the following command.</p>\n<pre><code>!pip install git+https://github.com/huggingface/transformers\n</code></pre>\n<p>However, the inference notebook cannot pip install because the internet is turned off. <br>\nAt that time, you can install Transformer from Dataset by executing the following command.</p>\n<hr>\n<p>1 Do the following commands at your local env for making wheel file.</p>\n<pre><code>git  https://github.com/huggingface/transformers.git\n transformers\npip install --upgrade pip setuptools wheel\npython setup.py bdist_wheel\n</code></pre>\n<p>2 You get a file named <code>dist/transformers-4.XX.0.dev0-py3-none-any.whl</code>, upload it to the Kaggle Dataset.</p>\n<p>3 Execute the following commands on the Notebook.</p>\n<pre><code>!pip install /kaggle/input/YOUR_DATASET_NAME/transformers-4.XX.0.dev0-py3-none-any.whl \n</code></pre>\n<hr>\n<p>Please let me know if there is an easier way.</p>",
  "messages": [
    {
      "id": "2258238",
      "postDate": "05/14/2023 03:21:17",
      "content": "<p>This competition often requires the latest version of Transformer, which is installed with the following command.</p>\n<pre><code>!pip install git+https://github.com/huggingface/transformers\n</code></pre>\n<p>However, the inference notebook cannot pip install because the internet is turned off. <br>\nAt that time, you can install Transformer from Dataset by executing the following command.</p>\n<hr>\n<p>1 Do the following commands at your local env for making wheel file.</p>\n<pre><code>git  https://github.com/huggingface/transformers.git\n transformers\npip install --upgrade pip setuptools wheel\npython setup.py bdist_wheel\n</code></pre>\n<p>2 You get a file named <code>dist/transformers-4.XX.0.dev0-py3-none-any.whl</code>, upload it to the Kaggle Dataset.</p>\n<p>3 Execute the following commands on the Notebook.</p>\n<pre><code>!pip install /kaggle/input/YOUR_DATASET_NAME/transformers-4.XX.0.dev0-py3-none-any.whl \n</code></pre>\n<hr>\n<p>Please let me know if there is an easier way.</p>",
      "rawMarkdown": "This competition often requires the latest version of Transformer, which is installed with the following command.\n```sh\n!pip install git+https://github.com/huggingface/transformers\n```\n\nHowever, the inference notebook cannot pip install because the internet is turned off. \nAt that time, you can install Transformer from Dataset by executing the following command.\n\n---\n1 Do the following commands at your local env for making wheel file.\n\n```sh\ngit clone https://github.com/huggingface/transformers.git\ncd transformers\npip install --upgrade pip setuptools wheel\npython setup.py bdist_wheel\n```\n\n2 You get a file named `dist/transformers-4.XX.0.dev0-py3-none-any.whl`, upload it to the Kaggle Dataset.\n\n3 Execute the following commands on the Notebook.\n```sh\n!pip install /kaggle/input/YOUR_DATASET_NAME/transformers-4.XX.0.dev0-py3-none-any.whl \n```\n\n---\n\nPlease let me know if there is an easier way.",
      "votes": null
    },
    {
      "id": "2258335",
      "postDate": "05/14/2023 05:57:45",
      "content": "<p>You can use Notebook output as well.</p>\n<ol>\n<li>Create a Notebook (named <code>XXX</code>) and run <code>!pip download git+https://github.com/huggingface/transformers</code><br>\nEDIT : Also run <code>!pip download wheel</code> and <code>!pip download setuptools</code></li>\n<li>Save this Notebook</li>\n<li>In your inference Notebook, add the output of the above Notebook by <code>Add Data</code> button and run <code>!pip uninstall transformers -y</code> and <code>!python -m pip install --no-index --find-links=/kaggle/input/XXX transformers</code></li>\n</ol>",
      "rawMarkdown": "You can use Notebook output as well.\n\n1. Create a Notebook (named `XXX`) and run `!pip download git+https://github.com/huggingface/transformers`\nEDIT : Also run `!pip download wheel` and `!pip download setuptools`\n2. Save this Notebook\n3. In your inference Notebook, add the output of the above Notebook by `Add Data` button and run `!pip uninstall transformers -y` and `!python -m pip install --no-index --find-links=/kaggle/input/XXX transformers`",
      "votes": null
    },
    {
      "id": "2258384",
      "postDate": "05/14/2023 06:54:59",
      "content": "<p><a href=\"https://www.kaggle.com/tikutiku\" target=\"_blank\">@tikutiku</a> <br>\nI didn't know about that method, thanks!</p>",
      "rawMarkdown": "tikutiku \nI didn't know about that method, thanks!",
      "votes": null
    },
    {
      "id": "2259116",
      "postDate": "05/14/2023 17:34:33",
      "content": "<p>Note that when using the Transformer Repository in an internet-off notebook, you will need to update the file paths to point to the correct locations in the dataset.</p>",
      "rawMarkdown": "Note that when using the Transformer Repository in an internet-off notebook, you will need to update the file paths to point to the correct locations in the dataset.",
      "votes": null
    },
    {
      "id": "2264664",
      "postDate": "05/18/2023 16:06:16",
      "content": "<p>This method does not work for me.. When I try to load the files into a notebook I get the following error.</p>\n<pre><code>  Installing build dependencies ... error\n  error: subprocess-exited-with-error\n\n  × pip subprocess to install build dependencies did not run successfully.\n  │ exit code: 1\n  ╰─&gt; [4 lines of output]\n      Looking in links: /kaggle/input/XXX/\n      ERROR: Could not find a version that satisfies the requirement setuptools&gt;=40.8.0 (from versions: none)\n      ERROR: No matching distribution found for setuptools&gt;=40.8.0\n\n      [end of output]\n</code></pre>",
      "rawMarkdown": "This method does not work for me.. When I try to load the files into a notebook I get the following error.\n```\n  Installing build dependencies ... error\n  error: subprocess-exited-with-error\n  \n  × pip subprocess to install build dependencies did not run successfully.\n  │ exit code: 1\n  ╰─> [4 lines of output]\n      Looking in links: /kaggle/input/XXX/\n      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)\n      ERROR: No matching distribution found for setuptools>=40.8.0\n      \n      [end of output]\n```",
      "votes": null
    },
    {
      "id": "2265047",
      "postDate": "05/19/2023 00:29:11",
      "content": "<p>Good catch. I found that <code>wheel</code> and <code>setuptools</code> should be in the Notebook output as well (usually these are automatically downloaded by <code>!pip download your-package</code>).</p>\n<p>I created Notebooks for demo:<br>\n<a href=\"https://www.kaggle.com/code/tikutiku/benetech-pip\" target=\"_blank\">https://www.kaggle.com/code/tikutiku/benetech-pip</a><br>\n<a href=\"https://www.kaggle.com/code/tikutiku/benetech-install-transformers-w-o-internet\" target=\"_blank\">https://www.kaggle.com/code/tikutiku/benetech-install-transformers-w-o-internet</a></p>\n<p>Hope it helps.</p>",
      "rawMarkdown": "Good catch. I found that `wheel` and `setuptools` should be in the Notebook output as well (usually these are automatically downloaded by `!pip download your-package`).\n\nI created Notebooks for demo:\nhttps://www.kaggle.com/code/tikutiku/benetech-pip\nhttps://www.kaggle.com/code/tikutiku/benetech-install-transformers-w-o-internet\n\nHope it helps.",
      "votes": null
    },
    {
      "id": "2265815",
      "postDate": "05/19/2023 14:28:05",
      "content": "<p>Thanks for sharing this Tom. Very helpful :)</p>",
      "rawMarkdown": "Thanks for sharing this Tom. Very helpful :)",
      "votes": null
    },
    {
      "id": "2267594",
      "postDate": "05/21/2023 05:36:03",
      "content": "<p>Hi Bartley, I have done it many times. Why am I still getting the wrong transformers version?</p>\n<p><strong>import transformers</strong><br>\n<strong>print(\"transformers v\" + transformers.<strong>version</strong>)</strong><br>\n------output---------------<br>\n<em>transformers v4.28.1</em></p>\n<p><strong>!pip uninstall transformers -y</strong><br>\n------output---------------<br>\n<em>Successfully uninstalled transformers-4.28.1</em></p>\n<p><strong>Question 1:</strong> Why I am still getting following result?**<br>\n<strong>import transformers</strong><br>\n<strong>print(\"transformers v\" + transformers.<strong>version</strong>)</strong><br>\n------output---------------<br>\n<em>transformers v4.28.1</em></p>\n<p>===========================================<br>\n<strong>Question 2:</strong> Why I am still getting the following result transformers v4.28.1 after installing 4.30?<br>\n!python -m pip install --no-index --find-links=/kaggle/input/benetech-pip transformers<br>\nSuccessfully installed huggingface-hub-0.14.1 transformers-4.30.0.dev0</p>\n<p><strong>import transformers</strong><br>\n<strong>print(\"transformers v\" + transformers.<strong>version</strong>)</strong><br>\n------output---------------<br>\n<em>transformers v4.28.1</em></p>\n<p>Are these due to following warning. How to avoid this?<br>\n<em>WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: <a href=\"https://pip.pypa.io/warnings/venv\" target=\"_blank\">https://pip.pypa.io/warnings/venv</a> class=\"ansi-yellow-fg\"&gt;</em></p>",
      "rawMarkdown": "Hi Bartley, I have done it many times. Why am I still getting the wrong transformers version?\n\n**import transformers**\n**print(\"transformers v\" + transformers.__version__)**\n------output---------------\n*transformers v4.28.1*\n\n\n**!pip uninstall transformers -y**\n------output---------------\n*Successfully uninstalled transformers-4.28.1*\n\n**Question 1:** Why I am still getting following result?**\n**import transformers**\n**print(\"transformers v\" + transformers.__version__)**\n------output---------------\n*transformers v4.28.1*\n\n===========================================\n**Question 2:** Why I am still getting the following result transformers v4.28.1 after installing 4.30?\n!python -m pip install --no-index --find-links=/kaggle/input/benetech-pip transformers\nSuccessfully installed huggingface-hub-0.14.1 transformers-4.30.0.dev0\n\n**import transformers**\n**print(\"transformers v\" + transformers.__version__)**\n------output---------------\n*transformers v4.28.1*\n\nAre these due to following warning. How to avoid this?\n*WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv class=\"ansi-yellow-fg\">*",
      "votes": null
    },
    {
      "id": "2267616",
      "postDate": "05/21/2023 06:01:18",
      "content": "<p><a href=\"https://www.kaggle.com/pksamantaray\" target=\"_blank\">@pksamantaray</a> <br>\nI think you need to avoid <code>import transformers</code> before you install your preferred version of transformers.</p>",
      "rawMarkdown": "pksamantaray \nI think you need to avoid `import transformers` before you install your preferred version of transformers.",
      "votes": null
    },
    {
      "id": "2300941",
      "postDate": "06/13/2023 14:23:06",
      "content": "<p>Great content in here! Thanks for sharing <a href=\"https://www.kaggle.com/sinchir0\" target=\"_blank\">@sinchir0</a> 🔥💪</p>",
      "rawMarkdown": "Great content in here! Thanks for sharing @sinchir0 🔥💪",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2258335,
      "author_name": "tikutiku",
      "author_url": "",
      "post_date": "05/14/2023 05:57:45",
      "content": "<p>You can use Notebook output as well.</p>\n<ol>\n<li>Create a Notebook (named <code>XXX</code>) and run <code>!pip download git+https://github.com/huggingface/transformers</code><br>\nEDIT : Also run <code>!pip download wheel</code> and <code>!pip download setuptools</code></li>\n<li>Save this Notebook</li>\n<li>In your inference Notebook, add the output of the above Notebook by <code>Add Data</code> button and run <code>!pip uninstall transformers -y</code> and <code>!python -m pip install --no-index --find-links=/kaggle/input/XXX transformers</code></li>\n</ol>",
      "votes": null,
      "replies": [
        {
          "id": 2258384,
          "author_name": "sinchir0",
          "author_url": "",
          "post_date": "05/14/2023 06:54:59",
          "content": "<p><a href=\"https://www.kaggle.com/tikutiku\" target=\"_blank\">@tikutiku</a> <br>\nI didn't know about that method, thanks!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 2264664,
          "author_name": "brendanartley",
          "author_url": "",
          "post_date": "05/18/2023 16:06:16",
          "content": "<p>This method does not work for me.. When I try to load the files into a notebook I get the following error.</p>\n<pre><code>  Installing build dependencies ... error\n  error: subprocess-exited-with-error\n\n  × pip subprocess to install build dependencies did not run successfully.\n  │ exit code: 1\n  ╰─&gt; [4 lines of output]\n      Looking in links: /kaggle/input/XXX/\n      ERROR: Could not find a version that satisfies the requirement setuptools&gt;=40.8.0 (from versions: none)\n      ERROR: No matching distribution found for setuptools&gt;=40.8.0\n\n      [end of output]\n</code></pre>",
          "votes": null,
          "replies": [
            {
              "id": 2265047,
              "author_name": "tikutiku",
              "author_url": "",
              "post_date": "05/19/2023 00:29:11",
              "content": "<p>Good catch. I found that <code>wheel</code> and <code>setuptools</code> should be in the Notebook output as well (usually these are automatically downloaded by <code>!pip download your-package</code>).</p>\n<p>I created Notebooks for demo:<br>\n<a href=\"https://www.kaggle.com/code/tikutiku/benetech-pip\" target=\"_blank\">https://www.kaggle.com/code/tikutiku/benetech-pip</a><br>\n<a href=\"https://www.kaggle.com/code/tikutiku/benetech-install-transformers-w-o-internet\" target=\"_blank\">https://www.kaggle.com/code/tikutiku/benetech-install-transformers-w-o-internet</a></p>\n<p>Hope it helps.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2265815,
                  "author_name": "brendanartley",
                  "author_url": "",
                  "post_date": "05/19/2023 14:28:05",
                  "content": "<p>Thanks for sharing this Tom. Very helpful :)</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2267594,
                      "author_name": "pksamantaray",
                      "author_url": "",
                      "post_date": "05/21/2023 05:36:03",
                      "content": "<p>Hi Bartley, I have done it many times. Why am I still getting the wrong transformers version?</p>\n<p><strong>import transformers</strong><br>\n<strong>print(\"transformers v\" + transformers.<strong>version</strong>)</strong><br>\n------output---------------<br>\n<em>transformers v4.28.1</em></p>\n<p><strong>!pip uninstall transformers -y</strong><br>\n------output---------------<br>\n<em>Successfully uninstalled transformers-4.28.1</em></p>\n<p><strong>Question 1:</strong> Why I am still getting following result?**<br>\n<strong>import transformers</strong><br>\n<strong>print(\"transformers v\" + transformers.<strong>version</strong>)</strong><br>\n------output---------------<br>\n<em>transformers v4.28.1</em></p>\n<p>===========================================<br>\n<strong>Question 2:</strong> Why I am still getting the following result transformers v4.28.1 after installing 4.30?<br>\n!python -m pip install --no-index --find-links=/kaggle/input/benetech-pip transformers<br>\nSuccessfully installed huggingface-hub-0.14.1 transformers-4.30.0.dev0</p>\n<p><strong>import transformers</strong><br>\n<strong>print(\"transformers v\" + transformers.<strong>version</strong>)</strong><br>\n------output---------------<br>\n<em>transformers v4.28.1</em></p>\n<p>Are these due to following warning. How to avoid this?<br>\n<em>WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: <a href=\"https://pip.pypa.io/warnings/venv\" target=\"_blank\">https://pip.pypa.io/warnings/venv</a> class=\"ansi-yellow-fg\"&gt;</em></p>",
                      "votes": null,
                      "replies": [
                        {
                          "id": 2267616,
                          "author_name": "tikutiku",
                          "author_url": "",
                          "post_date": "05/21/2023 06:01:18",
                          "content": "<p><a href=\"https://www.kaggle.com/pksamantaray\" target=\"_blank\">@pksamantaray</a> <br>\nI think you need to avoid <code>import transformers</code> before you install your preferred version of transformers.</p>",
                          "votes": null,
                          "replies": []
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2259116,
      "author_name": "aisuluuulankyzy",
      "author_url": "",
      "post_date": "05/14/2023 17:34:33",
      "content": "<p>Note that when using the Transformer Repository in an internet-off notebook, you will need to update the file paths to point to the correct locations in the dataset.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2300941,
      "author_name": "vladiluzjr",
      "author_url": "",
      "post_date": "06/13/2023 14:23:06",
      "content": "<p>Great content in here! Thanks for sharing <a href=\"https://www.kaggle.com/sinchir0\" target=\"_blank\">@sinchir0</a> 🔥💪</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2258238": "This competition often requires the latest version of Transformer, which is installed with the following command.\n```sh\n!pip install git+https://github.com/huggingface/transformers\n```\n\nHowever, the inference notebook cannot pip install because the internet is turned off. \nAt that time, you can install Transformer from Dataset by executing the following command.\n\n---\n1 Do the following commands at your local env for making wheel file.\n\n```sh\ngit clone https://github.com/huggingface/transformers.git\ncd transformers\npip install --upgrade pip setuptools wheel\npython setup.py bdist_wheel\n```\n\n2 You get a file named `dist/transformers-4.XX.0.dev0-py3-none-any.whl`, upload it to the Kaggle Dataset.\n\n3 Execute the following commands on the Notebook.\n```sh\n!pip install /kaggle/input/YOUR_DATASET_NAME/transformers-4.XX.0.dev0-py3-none-any.whl \n```\n\n---\n\nPlease let me know if there is an easier way.",
    "2258335": "You can use Notebook output as well.\n\n1. Create a Notebook (named `XXX`) and run `!pip download git+https://github.com/huggingface/transformers`\nEDIT : Also run `!pip download wheel` and `!pip download setuptools`\n2. Save this Notebook\n3. In your inference Notebook, add the output of the above Notebook by `Add Data` button and run `!pip uninstall transformers -y` and `!python -m pip install --no-index --find-links=/kaggle/input/XXX transformers`",
    "2258384": "tikutiku \nI didn't know about that method, thanks!",
    "2259116": "Note that when using the Transformer Repository in an internet-off notebook, you will need to update the file paths to point to the correct locations in the dataset.",
    "2264664": "This method does not work for me.. When I try to load the files into a notebook I get the following error.\n```\n  Installing build dependencies ... error\n  error: subprocess-exited-with-error\n  \n  × pip subprocess to install build dependencies did not run successfully.\n  │ exit code: 1\n  ╰─> [4 lines of output]\n      Looking in links: /kaggle/input/XXX/\n      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)\n      ERROR: No matching distribution found for setuptools>=40.8.0\n      \n      [end of output]\n```",
    "2265047": "Good catch. I found that `wheel` and `setuptools` should be in the Notebook output as well (usually these are automatically downloaded by `!pip download your-package`).\n\nI created Notebooks for demo:\nhttps://www.kaggle.com/code/tikutiku/benetech-pip\nhttps://www.kaggle.com/code/tikutiku/benetech-install-transformers-w-o-internet\n\nHope it helps.",
    "2265815": "Thanks for sharing this Tom. Very helpful :)",
    "2267594": "Hi Bartley, I have done it many times. Why am I still getting the wrong transformers version?\n\n**import transformers**\n**print(\"transformers v\" + transformers.__version__)**\n------output---------------\n*transformers v4.28.1*\n\n\n**!pip uninstall transformers -y**\n------output---------------\n*Successfully uninstalled transformers-4.28.1*\n\n**Question 1:** Why I am still getting following result?**\n**import transformers**\n**print(\"transformers v\" + transformers.__version__)**\n------output---------------\n*transformers v4.28.1*\n\n===========================================\n**Question 2:** Why I am still getting the following result transformers v4.28.1 after installing 4.30?\n!python -m pip install --no-index --find-links=/kaggle/input/benetech-pip transformers\nSuccessfully installed huggingface-hub-0.14.1 transformers-4.30.0.dev0\n\n**import transformers**\n**print(\"transformers v\" + transformers.__version__)**\n------output---------------\n*transformers v4.28.1*\n\nAre these due to following warning. How to avoid this?\n*WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv class=\"ansi-yellow-fg\">*",
    "2267616": "pksamantaray \nI think you need to avoid `import transformers` before you install your preferred version of transformers.",
    "2300941": "Great content in here! Thanks for sharing @sinchir0 🔥💪"
  },
  "source": "meta"
}