diff --git "a/classification.ipynb" "b/classification.ipynb" new file mode 100644--- /dev/null +++ "b/classification.ipynb" @@ -0,0 +1,3234 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4ix4ndo8G_DS", + "outputId": "9cf82a2b-117f-45b1-aa84-9c11708ce2e5" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Requirement already satisfied: datasets in /usr/local/lib/python3.10/dist-packages (2.13.0)\n", + "Requirement already satisfied: transformers in /usr/local/lib/python3.10/dist-packages (4.30.2)\n", + "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from datasets) (1.22.4)\n", + "Requirement already satisfied: pyarrow>=8.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (9.0.0)\n", + "Requirement already satisfied: dill<0.3.7,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.3.6)\n", + "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets) (1.5.3)\n", + "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (2.27.1)\n", + "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (4.65.0)\n", + "Requirement already satisfied: xxhash in /usr/local/lib/python3.10/dist-packages (from datasets) (3.2.0)\n", + "Requirement already satisfied: multiprocess in /usr/local/lib/python3.10/dist-packages (from datasets) (0.70.14)\n", + "Requirement already satisfied: fsspec[http]>=2021.11.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (2023.4.0)\n", + "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets) (3.8.4)\n", + "Requirement already satisfied: huggingface-hub<1.0.0,>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from datasets) (0.15.1)\n", + "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from datasets) (23.1)\n", + "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from datasets) (6.0)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.12.0)\n", + "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (2022.10.31)\n", + "Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.13.3)\n", + "Requirement already satisfied: safetensors>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.3.1)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (23.1.0)\n", + "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (2.0.12)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (6.0.4)\n", + "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (4.0.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.9.2)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.3.3)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets) (1.3.1)\n", + "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0.0,>=0.11.0->datasets) (4.5.0)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (1.26.15)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (2022.12.7)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->datasets) (3.4)\n", + "Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2.8.2)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets) (2022.7.1)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.1->pandas->datasets) (1.16.0)\n" + ] + } + ], + "source": [ + "! pip install datasets transformers" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 145, + "referenced_widgets": [ + "f4f375cb67ec492aadfa84f5c5e44d1a", + "1f36ebb77de5480790d0ca81b73039c2", + "0ea1b2f95c4c442cad02a47ccc836edf", + "6efc4794133b4c25ad68fe0745a36ae8", + "19f024c975a8409c810fec1702e45489", + "4280d81e3b9d4ac98df99218f6d19d02", + "b736e0e3997a4beeb8f25f75666ba144", + "1b78736ca5284374895d3d6a5f31f705", + "d8c38362899c46668bc9d53d0dba0746", + "dbc3fc557c134bab96c6c5577971f778", + "a70b46b2c9684fa0ab466c1b07b6c62a", + "16352130ab5641159adceaff6ab253b1", + "0038da35f9894a2e82f86d7a85ba5cf9", + "2331b5971ba8428bb689943709f8c5de", + "aabf5d439dd64650843da3dfc7a0e7da", + "a58577667843450e90ea0569d5fbc1cd", + "8b6c863c39ba469cbca4506a76a29611", + "82055ce6d98a4f32a8c45dc5e24538aa", + "9c25297d51ec474db309281256a57935", + "9608f10bd9e9426a897b3574124580d5", + "38a8bcfc53fc47acb52326105c76338a", + "3f789b24b3a64d4e964b54e7a0526fb5", + "d15a974bfbb147a1a329151053041aaa", + "3c2010543a82497ea61b6a9b594f583e", + "9cd3b0f4414d4d0fb0911efef7db72a0", + "f18665904c344723830eb49601640845", + "1d12f0722286441ab69689b1a911ac9f", + "71f12ad3da9d454fa7ace08b77684860", + "11eef0724c7d43acba7668461ded86cc", + "32bca44ab7624f8b90c2d89d881f415b", + "80904326191b4f12a4ce35e1962d7e1b", + "ea118f09d17b4352a76827b394d60805" + ] + }, + "id": "ieWXJ51CHboM", + "outputId": "8d6c94fa-2936-4bf0-bb45-1da0624db5c9" + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "VBox(children=(HTML(value='
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n", + "│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py:259 in │\n", + "│ hf_raise_for_status │\n", + "│ │\n", + "│ 256 │ </Tip> │\n", + "│ 257 │ \"\"\" │\n", + "│ 258 │ try: │\n", + "│ ❱ 259 │ │ response.raise_for_status() │\n", + "│ 260 │ except HTTPError as e: │\n", + "│ 261 │ │ error_code = response.headers.get(\"X-Error-Code\") │\n", + "│ 262 │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/requests/models.py:960 in raise_for_status │\n", + "│ │\n", + "│ 957 │ │ │ http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, rea │\n", + "│ 958 │ │ │\n", + "│ 959 │ │ if http_error_msg: │\n", + "│ ❱ 960 │ │ │ raise HTTPError(http_error_msg, response=self) │\n", + "│ 961 │ │\n", + "│ 962 │ def close(self): │\n", + "│ 963 │ │ \"\"\"Releases the connection back to the pool. Once this method has been │\n", + "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "HTTPError: 404 Client Error: Not Found for url: \n", + "https://huggingface.co/Varun1808/classification/resolve/main/config.json\n", + "\n", + "The above exception was the direct cause of the following exception:\n", + "\n", + "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n", + "│ /usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py:417 in cached_file │\n", + "│ │\n", + "│ 414 │ user_agent = http_user_agent(user_agent) │\n", + "│ 415 │ try: │\n", + "│ 416 │ │ # Load from URL or cache if already cached │\n", + "│ ❱ 417 │ │ resolved_file = hf_hub_download( │\n", + "│ 418 │ │ │ path_or_repo_id, │\n", + "│ 419 │ │ │ filename, │\n", + "│ 420 │ │ │ subfolder=None if len(subfolder) == 0 else subfolder, │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py:118 in _inner_fn │\n", + "│ │\n", + "│ 115 │ │ if check_use_auth_token: │\n", + "│ 116 │ │ │ kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=ha │\n", + "│ 117 │ │ │\n", + "│ ❱ 118 │ │ return fn(*args, **kwargs) │\n", + "│ 119 │ │\n", + "│ 120 │ return _inner_fn # type: ignore │\n", + "│ 121 │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1195 in hf_hub_download │\n", + "│ │\n", + "│ 1192 │ if not local_files_only: │\n", + "│ 1193 │ │ try: │\n", + "│ 1194 │ │ │ try: │\n", + "│ ❱ 1195 │ │ │ │ metadata = get_hf_file_metadata( │\n", + "│ 1196 │ │ │ │ │ url=url, │\n", + "│ 1197 │ │ │ │ │ token=token, │\n", + "│ 1198 │ │ │ │ │ proxies=proxies, │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py:118 in _inner_fn │\n", + "│ │\n", + "│ 115 │ │ if check_use_auth_token: │\n", + "│ 116 │ │ │ kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=ha │\n", + "│ 117 │ │ │\n", + "│ ❱ 118 │ │ return fn(*args, **kwargs) │\n", + "│ 119 │ │\n", + "│ 120 │ return _inner_fn # type: ignore │\n", + "│ 121 │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1541 in │\n", + "│ get_hf_file_metadata │\n", + "│ │\n", + "│ 1538 │ │ proxies=proxies, │\n", + "│ 1539 │ │ timeout=timeout, │\n", + "│ 1540 │ ) │\n", + "│ ❱ 1541 │ hf_raise_for_status(r) │\n", + "│ 1542 │ │\n", + "│ 1543 │ # Return │\n", + "│ 1544 │ return HfFileMetadata( │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py:269 in │\n", + "│ hf_raise_for_status │\n", + "│ │\n", + "│ 266 │ │ │\n", + "│ 267 │ │ elif error_code == \"EntryNotFound\": │\n", + "│ 268 │ │ │ message = f\"{response.status_code} Client Error.\" + \"\\n\\n\" + f\"Entry Not Fou │\n", + "│ ❱ 269 │ │ │ raise EntryNotFoundError(message, response) from e │\n", + "│ 270 │ │ │\n", + "│ 271 │ │ elif error_code == \"GatedRepo\": │\n", + "│ 272 │ │ │ message = ( │\n", + "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "EntryNotFoundError: 404 Client Error. (Request ID: Root=1-648ad550-629bcb426d446ce2081986de)\n", + "\n", + "Entry Not Found for url: https://huggingface.co/Varun1808/classification/resolve/main/config.json.\n", + "\n", + "During handling of the above exception, another exception occurred:\n", + "\n", + "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n", + "│ in <cell line: 5>:5 │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/transformers/pipelines/__init__.py:705 in pipeline │\n", + "│ │\n", + "│ 702 │ │ config = AutoConfig.from_pretrained(config, _from_pipeline=task, **hub_kwargs, * │\n", + "│ 703 │ │ hub_kwargs[\"_commit_hash\"] = config._commit_hash │\n", + "│ 704 │ elif config is None and isinstance(model, str): │\n", + "│ ❱ 705 │ │ config = AutoConfig.from_pretrained(model, _from_pipeline=task, **hub_kwargs, ** │\n", + "│ 706 │ │ hub_kwargs[\"_commit_hash\"] = config._commit_hash │\n", + "│ 707 │ │\n", + "│ 708 │ custom_tasks = {} │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration_auto.py:944 in │\n", + "│ from_pretrained │\n", + "│ │\n", + "│ 941 │ │ kwargs[\"_from_auto\"] = True │\n", + "│ 942 │ │ kwargs[\"name_or_path\"] = pretrained_model_name_or_path │\n", + "│ 943 │ │ trust_remote_code = kwargs.pop(\"trust_remote_code\", None) │\n", + "│ ❱ 944 │ │ config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_n │\n", + "│ 945 │ │ has_remote_code = \"auto_map\" in config_dict and \"AutoConfig\" in config_dict[\"aut │\n", + "│ 946 │ │ has_local_code = \"model_type\" in config_dict and config_dict[\"model_type\"] in CO │\n", + "│ 947 │ │ trust_remote_code = resolve_trust_remote_code( │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py:574 in │\n", + "│ get_config_dict │\n", + "│ │\n", + "│ 571 │ │ \"\"\" │\n", + "│ 572 │ │ original_kwargs = copy.deepcopy(kwargs) │\n", + "│ 573 │ │ # Get config dict associated with the base config file │\n", + "│ ❱ 574 │ │ config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwar │\n", + "│ 575 │ │ if \"_commit_hash\" in config_dict: │\n", + "│ 576 │ │ │ original_kwargs[\"_commit_hash\"] = config_dict[\"_commit_hash\"] │\n", + "│ 577 │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py:629 in │\n", + "│ _get_config_dict │\n", + "│ │\n", + "│ 626 │ │ │ │\n", + "│ 627 │ │ │ try: │\n", + "│ 628 │ │ │ │ # Load from local folder or from cache or download from model Hub and ca │\n", + "│ ❱ 629 │ │ │ │ resolved_config_file = cached_file( │\n", + "│ 630 │ │ │ │ │ pretrained_model_name_or_path, │\n", + "│ 631 │ │ │ │ │ configuration_file, │\n", + "│ 632 │ │ │ │ │ cache_dir=cache_dir, │\n", + "│ │\n", + "│ /usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py:463 in cached_file │\n", + "│ │\n", + "│ 460 │ │ │ return None │\n", + "│ 461 │ │ if revision is None: │\n", + "│ 462 │ │ │ revision = \"main\" │\n", + "│ ❱ 463 │ │ raise EnvironmentError( │\n", + "│ 464 │ │ │ f\"{path_or_repo_id} does not appear to have a file named {full_filename}. Ch │\n", + "│ 465 │ │ │ f\"'https://huggingface.co/{path_or_repo_id}/{revision}' for available files. │\n", + "│ 466 │ │ ) │\n", + "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "OSError: Varun1808/classification does not appear to have a file named config.json. Checkout \n", + "'https://huggingface.co/Varun1808/classification/main' for available files.\n", + "\n" + ] + }, + "metadata": {} + } + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "f4f375cb67ec492aadfa84f5c5e44d1a": { + "model_module": "@jupyter-widgets/controls", + "model_name": "VBoxModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "VBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "VBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_38a8bcfc53fc47acb52326105c76338a", + "IPY_MODEL_3f789b24b3a64d4e964b54e7a0526fb5", + "IPY_MODEL_d15a974bfbb147a1a329151053041aaa", + "IPY_MODEL_3c2010543a82497ea61b6a9b594f583e" + ], + "layout": "IPY_MODEL_b736e0e3997a4beeb8f25f75666ba144" + } + }, + "1f36ebb77de5480790d0ca81b73039c2": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_1b78736ca5284374895d3d6a5f31f705", + "placeholder": "", + "style": "IPY_MODEL_d8c38362899c46668bc9d53d0dba0746", + "value": "