{ "cells": [ { "cell_type": "code", "execution_count": 4, "id": "74ee58a0-8c1a-4650-bb45-367214130cde", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Run this to confirm the notebook is working.\n" ] } ], "source": [ "print(\"Run this to confirm the notebook is working.\")" ] }, { "cell_type": "code", "execution_count": null, "id": "0889a582-4903-496f-99e7-7cdcdffe9f29", "metadata": {}, "outputs": [], "source": [ "# Please make sure you are logged in with `huggingface-cli login`" ] }, { "cell_type": "code", "execution_count": 6, "id": "40b30b76-185c-4404-b5ed-157a7c745ce1", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting huggingface_hub\n", " Downloading huggingface_hub-0.23.0-py3-none-any.whl (401 kB)\n", "\u001b[K |████████████████████████████████| 401 kB 25.6 MB/s eta 0:00:01\n", "\u001b[?25hRequirement already satisfied: pyyaml>=5.1 in /home/user/miniconda/lib/python3.9/site-packages (from huggingface_hub) (6.0.1)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/user/miniconda/lib/python3.9/site-packages (from huggingface_hub) (4.11.0)\n", "Collecting filelock\n", " Downloading filelock-3.14.0-py3-none-any.whl (12 kB)\n", "Requirement already satisfied: tqdm>=4.42.1 in /home/user/miniconda/lib/python3.9/site-packages (from huggingface_hub) (4.61.2)\n", "Requirement already satisfied: requests in /home/user/miniconda/lib/python3.9/site-packages (from huggingface_hub) (2.31.0)\n", "Collecting fsspec>=2023.5.0\n", " Downloading fsspec-2024.5.0-py3-none-any.whl (316 kB)\n", "\u001b[K |████████████████████████████████| 316 kB 143.8 MB/s eta 0:00:01\n", "\u001b[?25hRequirement already satisfied: packaging>=20.9 in /home/user/miniconda/lib/python3.9/site-packages (from huggingface_hub) (24.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /home/user/miniconda/lib/python3.9/site-packages (from requests->huggingface_hub) (2.10)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/user/miniconda/lib/python3.9/site-packages (from requests->huggingface_hub) (3.3.2)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/user/miniconda/lib/python3.9/site-packages (from requests->huggingface_hub) (1.26.6)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/user/miniconda/lib/python3.9/site-packages (from requests->huggingface_hub) (2021.5.30)\n", "Installing collected packages: fsspec, filelock, huggingface-hub\n", "Successfully installed filelock-3.14.0 fsspec-2024.5.0 huggingface-hub-0.23.0\n" ] } ], "source": [ "!pip install huggingface_hub" ] }, { "cell_type": "code", "execution_count": 7, "id": "03ad7b5e-24ae-49e5-8fa7-e6b30260012f", "metadata": {}, "outputs": [], "source": [ "from huggingface_hub import HfApi\n", "\n", "api = HfApi()\n" ] }, { "cell_type": "code", "execution_count": null, "id": "f19b7b94-54d9-4c57-ad16-544b694d6d17", "metadata": { "tags": [] }, "outputs": [], "source": [ "uploaded_file_info = api.upload_file(\n", " path_or_fileobj=\"check.ipynb\",\n", " path_in_repo=\"data1/check.ipynb\",\n", " repo_id=\"FlawedLLM/Jupyter_Amex\",\n", " repo_type=\"space\",\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "a7f4ee16-819d-4c43-a904-ed94b5d58a2f", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.5" } }, "nbformat": 4, "nbformat_minor": 5 }