diff --git "a/Season2.step_into_llm/03.Decoding/\346\226\207\346\234\254\350\247\243\347\240\201.ipynb" "b/Season2.step_into_llm/03.Decoding/\346\226\207\346\234\254\350\247\243\347\240\201.ipynb" index 22921f5..09111f6 100644 --- "a/Season2.step_into_llm/03.Decoding/\346\226\207\346\234\254\350\247\243\347\240\201.ipynb" +++ "b/Season2.step_into_llm/03.Decoding/\346\226\207\346\234\254\350\247\243\347\240\201.ipynb" @@ -51,216 +51,170 @@ }, { "cell_type": "code", - "execution_count": null, - "id": "5c56827b", - "metadata": {}, - "outputs": [], + "execution_count": 1, + "id": "5593606f", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Looking in indexes: https://repo.huaweicloud.com/repository/pypi/simple\n", + "Collecting mindspore==2.6.0\n", + " Using cached https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.6.0/MindSpore/unified/aarch64/mindspore-2.6.0-cp39-cp39-linux_aarch64.whl (386.7 MB)\n", + "Requirement already satisfied: numpy<2.0.0,>=1.20.0 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (1.26.4)\n", + "Requirement already satisfied: protobuf>=3.13.0 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (6.31.1)\n", + "Requirement already satisfied: asttokens>=2.0.4 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (3.0.0)\n", + "Requirement already satisfied: pillow>=6.2.0 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (11.3.0)\n", + "Requirement already satisfied: scipy>=1.5.4 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (1.13.1)\n", + "Requirement already satisfied: packaging>=20.0 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (25.0)\n", + "Requirement already satisfied: psutil>=5.6.1 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (5.9.8)\n", + "Requirement already satisfied: astunparse>=1.6.3 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (1.6.3)\n", + "Requirement already satisfied: safetensors>=0.4.0 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (0.5.3)\n", + "Requirement already satisfied: dill>=0.3.7 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore==2.6.0) (0.3.8)\n", + "Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from astunparse>=1.6.3->mindspore==2.6.0) (0.45.1)\n", + "Requirement already satisfied: six<2.0,>=1.6.1 in /home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages (from astunparse>=1.6.3->mindspore==2.6.0) (1.17.0)\n", + "\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m25.1.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.2\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n" + ] + } + ], "source": [ - "#安装python 3.9版本的kernel\n", - "#%%capture captured_output\n", - "!/home/ma-user/anaconda3/bin/conda create -n python-3.9.0 python=3.9.0 -y --override-channels --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\n", - "!/home/ma-user/anaconda3/envs/python-3.9.0/bin/pip install ipykernel" + "!pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.6.0/MindSpore/unified/aarch64/mindspore-2.6.0-cp39-cp39-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple" ] }, { "cell_type": "code", - "execution_count": 8, - "id": "c40cdb84", + "execution_count": null, + "id": "b6af9e37-2f95-4daf-b8ff-378b0b0f9fd5", "metadata": {}, "outputs": [], "source": [ - "import json\n", - "import os\n", - "\n", - "data = {\n", - " \"display_name\": \"python-3.9.0\",\n", - " \"env\": {\n", - " \"PATH\": \"/home/ma-user/anaconda3/envs/python-3.9.0/bin:/home/ma-user/anaconda3/envs/python-3.7.10/bin:/modelarts/authoring/notebook-conda/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ma-user/modelarts/ma-cli/bin:/home/ma-user/modelarts/ma-cli/bin\"\n", - " },\n", - " \"language\": \"python\",\n", - " \"argv\": [\n", - " \"/home/ma-user/anaconda3/envs/python-3.9.0/bin/python\",\n", - " \"-m\",\n", - " \"ipykernel\",\n", - " \"-f\",\n", - " \"{connection_file}\"\n", - " ]\n", - "}\n", - "\n", - "if not os.path.exists(\"/home/ma-user/anaconda3/share/jupyter/kernels/python-3.9.0/\"):\n", - " os.mkdir(\"/home/ma-user/anaconda3/share/jupyter/kernels/python-3.9.0/\")\n", - "\n", - "with open('/home/ma-user/anaconda3/share/jupyter/kernels/python-3.9.0/kernel.json', 'w') as f:\n", - " json.dump(data, f, indent=4)" + "!git clone https://github.com/mindspore-lab/mindnlp" ] }, { "cell_type": "code", - "execution_count": 1, - "id": "5593606f", + "execution_count": null, + "id": "90b1a19e-9f32-428a-913b-6c4c00fad34f", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[33mWARNING: Skipping mindspore-gpu as it is not installed.\u001b[0m\n", - "\u001b[33mWARNING: Skipping mindvision as it is not installed.\u001b[0m\n", - "\u001b[33mWARNING: Skipping mindinsight as it is not installed.\u001b[0m\n", - "Looking in indexes: http://pip.modelarts.private.com:8888/repository/pypi/simple\n", - "Processing ./mindnlp-0.4.1-py3-none-any.whl\n", - "Requirement already satisfied: pytest==7.2.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (7.2.0)\n", - "Requirement already satisfied: evaluate in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (0.4.3)\n", - "Requirement already satisfied: regex in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (2024.7.24)\n", - "Requirement already satisfied: safetensors in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (0.4.5)\n", - "Requirement already satisfied: pyctcdecode in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (0.5.0)\n", - "Requirement already satisfied: tokenizers==0.19.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (0.19.1)\n", - "Requirement already satisfied: datasets in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (3.1.0)\n", - "Requirement already satisfied: sentencepiece in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (0.2.0)\n", - "Requirement already satisfied: mindspore>=2.2.14 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (2.4.0)\n", - "Requirement already satisfied: requests in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (2.32.3)\n", - "Requirement already satisfied: pillow>=10.0.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (10.0.1)\n", - "Requirement already satisfied: tqdm in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (4.65.0)\n", - "Requirement already satisfied: addict in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (2.4.0)\n", - "Requirement already satisfied: ml-dtypes in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindnlp==0.4.1) (0.4.0)\n", - "Requirement already satisfied: tomli>=1.0.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.4.1) (2.0.1)\n", - "Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.4.1) (1.2.2)\n", - "Requirement already satisfied: iniconfig in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.4.1) (2.0.0)\n", - "Requirement already satisfied: pluggy<2.0,>=0.12 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.4.1) (1.5.0)\n", - "Requirement already satisfied: attrs>=19.2.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.4.1) (23.2.0)\n", - "Requirement already satisfied: packaging in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.4.1) (24.1)\n", - "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from tokenizers==0.19.1->mindnlp==0.4.1) (0.24.2)\n", - "Requirement already satisfied: pyyaml>=5.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers==0.19.1->mindnlp==0.4.1) (6.0.1)\n", - "Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers==0.19.1->mindnlp==0.4.1) (4.12.2)\n", - "Requirement already satisfied: filelock in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers==0.19.1->mindnlp==0.4.1) (3.15.4)\n", - "Requirement already satisfied: fsspec>=2023.5.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers==0.19.1->mindnlp==0.4.1) (2024.6.1)\n", - "Requirement already satisfied: asttokens>=2.0.4 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore>=2.2.14->mindnlp==0.4.1) (2.4.1)\n", - "Requirement already satisfied: psutil>=5.6.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore>=2.2.14->mindnlp==0.4.1) (5.9.5)\n", - "Requirement already satisfied: numpy<2.0.0,>=1.20.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore>=2.2.14->mindnlp==0.4.1) (1.22.0)\n", - "Requirement already satisfied: scipy>=1.5.4 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore>=2.2.14->mindnlp==0.4.1) (1.10.1)\n", - "Requirement already satisfied: protobuf>=3.13.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore>=2.2.14->mindnlp==0.4.1) (3.20.2)\n", - "Requirement already satisfied: astunparse>=1.6.3 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore>=2.2.14->mindnlp==0.4.1) (1.6.3)\n", - "Requirement already satisfied: six>=1.12.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from asttokens>=2.0.4->mindspore>=2.2.14->mindnlp==0.4.1) (1.16.0)\n", - "Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from astunparse>=1.6.3->mindspore>=2.2.14->mindnlp==0.4.1) (0.38.4)\n", - "Requirement already satisfied: multiprocess<0.70.17 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from datasets->mindnlp==0.4.1) (0.70.16)\n", - "Collecting tqdm\n", - " Downloading http://pip.modelarts.private.com:8888/repository/pypi/packages/tqdm/4.67.1/tqdm-4.67.1-py3-none-any.whl (78 kB)\n", - "\u001b[K |████████████████████████████████| 78 kB 39.9 MB/s eta 0:00:01\n", - "\u001b[?25hRequirement already satisfied: pandas in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from datasets->mindnlp==0.4.1) (1.3.5)\n", - "Requirement already satisfied: xxhash in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from datasets->mindnlp==0.4.1) (3.5.0)\n", - "Requirement already satisfied: aiohttp in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from datasets->mindnlp==0.4.1) (3.11.9)\n", - "Requirement already satisfied: pyarrow>=15.0.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from datasets->mindnlp==0.4.1) (18.1.0)\n", - "Requirement already satisfied: dill<0.3.9,>=0.3.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from datasets->mindnlp==0.4.1) (0.3.8)\n", - "Requirement already satisfied: async-timeout<6.0,>=4.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (5.0.1)\n", - "Requirement already satisfied: propcache>=0.2.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (0.2.1)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (1.3.1)\n", - "Requirement already satisfied: yarl<2.0,>=1.17.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (1.18.3)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (6.1.0)\n", - "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (2.4.4)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.4.1) (1.5.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from requests->mindnlp==0.4.1) (2.10)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from requests->mindnlp==0.4.1) (2.0.12)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from requests->mindnlp==0.4.1) (1.26.7)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from requests->mindnlp==0.4.1) (2024.7.4)\n", - "Requirement already satisfied: python-dateutil>=2.7.3 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pandas->datasets->mindnlp==0.4.1) (2.9.0.post0)\n", - "Requirement already satisfied: pytz>=2017.3 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pandas->datasets->mindnlp==0.4.1) (2024.1)\n", - "Requirement already satisfied: pygtrie<3.0,>=2.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pyctcdecode->mindnlp==0.4.1) (2.5.0)\n", - "Requirement already satisfied: hypothesis<7,>=6.14 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from pyctcdecode->mindnlp==0.4.1) (6.122.1)\n", - "Requirement already satisfied: sortedcontainers<3.0.0,>=2.1.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from hypothesis<7,>=6.14->pyctcdecode->mindnlp==0.4.1) (2.4.0)\n", - "Installing collected packages: tqdm, mindnlp\n", - " Attempting uninstall: tqdm\n", - " Found existing installation: tqdm 4.65.0\n", - " Uninstalling tqdm-4.65.0:\n", - " Successfully uninstalled tqdm-4.65.0\n", - " Attempting uninstall: mindnlp\n", - " Found existing installation: mindnlp 0.3.0\n", - " Uninstalling mindnlp-0.3.0:\n", - " Successfully uninstalled mindnlp-0.3.0\n", - "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", - "modelarts 1.4.28 requires lxml==5.1.0, but you have lxml 4.9.3 which is incompatible.\n", - "modelarts 1.4.28 requires matplotlib==3.5.2, but you have matplotlib 3.5.1 which is incompatible.\n", - "modelarts 1.4.28 requires prettytable<=3.7.0, but you have prettytable 3.10.2 which is incompatible.\n", - "modelarts 1.4.28 requires requests==2.31.0, but you have requests 2.32.3 which is incompatible.\n", - "modelarts 1.4.28 requires tqdm<=4.66.1, but you have tqdm 4.67.1 which is incompatible.\n", - "modelarts 1.4.28 requires typing-extensions==4.7.1, but you have typing-extensions 4.12.2 which is incompatible.\n", - "modelarts 1.4.28 requires urllib3==1.26.18, but you have urllib3 1.26.7 which is incompatible.\u001b[0m\n", - "Successfully installed mindnlp-0.4.1 tqdm-4.67.1\n", - "\u001b[33mWARNING: You are using pip version 21.0.1; however, version 24.3.1 is available.\n", - "You should consider upgrading via the '/home/ma-user/anaconda3/envs/MindSpore/bin/python3.9 -m pip install --upgrade pip' command.\u001b[0m\n", - "env: no_proxy='a.test.com,127.0.0.1,2.2.2.2'\n", - "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n", - "Collecting mindspore==2.4.0\n", - " Using cached https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.4.0/MindSpore/unified/aarch64/mindspore-2.4.0-cp39-cp39-linux_aarch64.whl (333.7 MB)\n", - "Requirement already satisfied: protobuf>=3.13.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (3.20.2)\n", - "Requirement already satisfied: psutil>=5.6.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (5.9.5)\n", - "Requirement already satisfied: astunparse>=1.6.3 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (1.6.3)\n", - "Requirement already satisfied: numpy<2.0.0,>=1.20.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (1.22.0)\n", - "Requirement already satisfied: scipy>=1.5.4 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (1.10.1)\n", - "Requirement already satisfied: pillow>=6.2.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (10.0.1)\n", - "Requirement already satisfied: asttokens>=2.0.4 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (2.4.1)\n", - "Requirement already satisfied: safetensors>=0.4.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (0.4.5)\n", - "Requirement already satisfied: packaging>=20.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from mindspore==2.4.0) (24.1)\n", - "Requirement already satisfied: six>=1.12.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from asttokens>=2.0.4->mindspore==2.4.0) (1.16.0)\n", - "Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages (from astunparse>=1.6.3->mindspore==2.4.0) (0.38.4)\n", - "\u001b[33mWARNING: You are using pip version 21.0.1; however, version 24.3.1 is available.\n", - "You should consider upgrading via the '/home/ma-user/anaconda3/envs/MindSpore/bin/python -m pip install --upgrade pip' command.\u001b[0m\n", - "Note: you may need to restart the kernel to use updated packages.\n" - ] - } - ], + "outputs": [], "source": [ - "#安装mindspore2.4\n", - "!pip uninstall mindspore-gpu -y\n", - "!pip uninstall mindvision -y\n", - "!pip uninstall mindinsight -y\n", - "!pip install mindnlp-0.4.1-py3-none-any.whl\n", - "%env no_proxy='a.test.com,127.0.0.1,2.2.2.2'\n", - "%pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.4.0/MindSpore/unified/aarch64/mindspore-2.4.0-cp39-cp39-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple" + "!cd mindnlp && git checkout 0.4 && bash scripts/build_and_reinstall.sh" ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "54e990b4", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.447.323 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol aclmdlBundleGetModelId failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libascendcl.so: undefined symbol: aclmdlBundleGetModelId\n", - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.447.394 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol aclmdlBundleLoadFromMem failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libascendcl.so: undefined symbol: aclmdlBundleLoadFromMem\n", - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.447.413 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol aclmdlBundleUnload failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libascendcl.so: undefined symbol: aclmdlBundleUnload\n", - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.447.594 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol aclrtGetMemUceInfo failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libascendcl.so: undefined symbol: aclrtGetMemUceInfo\n", - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.447.611 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol aclrtDeviceTaskAbort failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libascendcl.so: undefined symbol: aclrtDeviceTaskAbort\n", - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.447.627 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol aclrtMemUceRepair failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libascendcl.so: undefined symbol: aclrtMemUceRepair\n", - "[WARNING] GE_ADPT(36162,ffff9d7f40b0,python):2024-12-03-21:20:47.449.575 [mindspore/ccsrc/utils/dlopen_macro.h:163] DlsymAscend] Dynamically load symbol acltdtCleanChannel failed, result = /usr/local/Ascend/ascend-toolkit/latest/lib64/libacl_tdt_channel.so: undefined symbol: acltdtCleanChannel\n", - "[WARNING] ME(36162:281473324105904,MainProcess):2024-12-03-21:20:47.589.499 [mindspore/run_check/_check_version.py:396] Can not find the tbe operator implementation(need by mindspore-ascend). Please check whether the Environment Variable PYTHONPATH is set. For details, refer to the installation guidelines: https://www.mindspore.cn/install\n", - "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/numpy/core/getlimits.py:499: UserWarning: The value of the smallest subnormal for type is zero.\n", + "/home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages/numpy/core/getlimits.py:549: UserWarning: The value of the smallest subnormal for type is zero.\n", " setattr(self, word, getattr(machar, word).flat[0])\n", - "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for type is zero.\n", + "/home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for type is zero.\n", " return self._float_to_str(self.smallest_subnormal)\n", - "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/numpy/core/getlimits.py:499: UserWarning: The value of the smallest subnormal for type is zero.\n", + "/home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages/numpy/core/getlimits.py:549: UserWarning: The value of the smallest subnormal for type is zero.\n", " setattr(self, word, getattr(machar, word).flat[0])\n", - "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for type is zero.\n", - " return self._float_to_str(self.smallest_subnormal)\n", - "Building prefix dict from the default dictionary ...\n", - "Loading model from cache /tmp/jieba.cache\n", - "Loading model cost 1.288 seconds.\n", - "Prefix dict has been built successfully.\n", - "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindnlp/transformers/tokenization_utils_base.py:1526: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted, and will be then set to `False` by default. \n", + "/home/mindspore/miniconda/envs/jupyter/lib/python3.9/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for type is zero.\n", + " return self._float_to_str(self.smallest_subnormal)\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1c27169f84f8418492c15c2d1f8d1f13", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + " 0%| | 0.00/26.0 [00:00Next\n" ] } ], @@ -600,9 +552,11 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "5597695d", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -610,7 +564,9 @@ "text": [ "Output:\n", "----------------------------------------------------------------------------------------------------\n", - "I enjoy walking with my cute dog who is very energetic and very friendly. I have a buddy who is a little shy and I'm very lonely. He is always near looking at me and laughing at me and asking me to help him out. I\n" + "I enjoy walking with my cute dog as he walks near the green and the vegetable groves, and I think the beautiful scenery and views will be worth the expense.\n", + "\n", + "My first visit to the plant was when I was 11 years old and I\n" ] } ], @@ -677,9 +633,11 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "id": "f29f4a83", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -687,9 +645,7 @@ "text": [ "Output:\n", "----------------------------------------------------------------------------------------------------\n", - "I enjoy walking with my cute dog. I really enjoy running, but I tend to have to go through school on time. The fact that they make me walk on time is such a cool thing.\n", - "\n", - "I've had a lot of problems that\n" + "I enjoy walking with my cute dog. It's a big step up and I feel excited to get him and be able to do it with her.\"\n" ] } ], @@ -739,9 +695,11 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "id": "a1ba9a9b", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -749,7 +707,7 @@ "text": [ "Output:\n", "----------------------------------------------------------------------------------------------------\n", - "I enjoy walking with my cute dog as much as we do swim. There's also the experience of being in an area of my gym and getting lost and keeping track of how much I missed that thing. We also spend time sorting through some high quality\n" + "I enjoy walking with my cute dog. I'm also overworked, and I'm looking for a permanent home.  I have learned much more by riding my skateboard, bouncing off walls, and calling God than I could by walking with my\n" ] } ], @@ -790,9 +748,11 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "id": "de88d6bd-a9c6-4e29-8e8d-c367947226f9", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -800,17 +760,14 @@ "text": [ "Output:\n", "----------------------------------------------------------------------------------------------------\n", - "0: I enjoy walking with my cute dog,\" says Kelli. \"I love having my dogs with me.\"\n", - "\n", - "The two have two dogs, a Labrador retriever, and an American shepherd.\n", + "0: I enjoy walking with my cute dog. I love the way it is, and it's so easy to get to know him. We are always together, and I have to be careful about how I talk to him. It's really easy to tell\n", + "1: I enjoy walking with my cute dog, but I don't really have the luxury of going on a walk with her.\n", "\n", - "The dogs are both adopted by the Humane Society\n", - "1: I enjoy walking with my cute dog. I like being alone. I enjoy being alone in a room full of people.\"\n", - "2: I enjoy walking with my cute dog and playing with my dog,\" said her mother.\n", + "So I'm going to go on this one, and I want to share some tips for walking with your dog.\n", "\n", - "\"I'm a very loving person and I'm very thankful for all of you who have been so supportive of our little girl,\" she added.\n", + "2: I enjoy walking with my cute dog, and I love the fact that he has a good heart, which I think is great. I also like that he loves to play with his toys and play with his friends.\n", "\n", - "\n" + "My dog, a Labrador\n" ] } ], @@ -872,9 +829,9 @@ "name": "mindspore1.7.0-cuda10.1-py3.7-ubuntu18.04" }, "kernelspec": { - "display_name": "MindSpore", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "mindspore" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -886,7 +843,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.10" + "version": "3.9.23" } }, "nbformat": 4,