Add pythonFile
This commit is contained in:
138
QuantizeLLm.ipynb
Normal file
138
QuantizeLLm.ipynb
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "ff0e4797-a126-4008-bef7-ab4bd9c77f9d",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import torch\n",
|
||||||
|
"\n",
|
||||||
|
"print(torch.__version__)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 3,
|
||||||
|
"id": "20fe31d8-00b4-4ebe-8d75-dd6804d86936",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"ename": "ModuleNotFoundError",
|
||||||
|
"evalue": "No module named 'transformers'",
|
||||||
|
"output_type": "error",
|
||||||
|
"traceback": [
|
||||||
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||||
|
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||||
|
"\u001b[0;32m<ipython-input-3-279c49635b32>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mtransformers\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
|
||||||
|
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'transformers'"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 4,
|
||||||
|
"id": "d0fefa74-63d3-4715-8740-a938495c6f92",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Defaulting to user installation because normal site-packages is not writeable\n",
|
||||||
|
"Collecting transformers\n",
|
||||||
|
" Using cached transformers-4.18.0-py3-none-any.whl (4.0 MB)\n",
|
||||||
|
"Collecting filelock\n",
|
||||||
|
" Using cached filelock-3.4.1-py3-none-any.whl (9.9 kB)\n",
|
||||||
|
"Collecting tokenizers!=0.11.3,<0.13,>=0.11.1\n",
|
||||||
|
" Using cached tokenizers-0.12.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.9 MB)\n",
|
||||||
|
"Collecting sacremoses\n",
|
||||||
|
" Using cached sacremoses-0.0.53-py3-none-any.whl\n",
|
||||||
|
"Requirement already satisfied: dataclasses in /home/ais/.local/lib/python3.6/site-packages (from transformers) (0.8)\n",
|
||||||
|
"Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from transformers) (2.18.4)\n",
|
||||||
|
"Requirement already satisfied: packaging>=20.0 in /home/ais/.local/lib/python3.6/site-packages (from transformers) (21.3)\n",
|
||||||
|
"Collecting tqdm>=4.27\n",
|
||||||
|
" Using cached tqdm-4.64.1-py2.py3-none-any.whl (78 kB)\n",
|
||||||
|
"Collecting huggingface-hub<1.0,>=0.1.0\n",
|
||||||
|
" Using cached huggingface_hub-0.4.0-py3-none-any.whl (67 kB)\n",
|
||||||
|
"Requirement already satisfied: importlib-metadata in /home/ais/.local/lib/python3.6/site-packages (from transformers) (4.8.3)\n",
|
||||||
|
"Collecting regex!=2019.12.17\n",
|
||||||
|
" Using cached regex-2023.8.8-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (756 kB)\n",
|
||||||
|
"Collecting numpy>=1.17\n",
|
||||||
|
" Downloading numpy-1.19.5-cp36-cp36m-manylinux2014_aarch64.whl (12.4 MB)\n",
|
||||||
|
" |████████████████████████████████| 12.4 MB 11.9 MB/s \n",
|
||||||
|
"\u001b[?25hRequirement already satisfied: pyyaml>=5.1 in /home/ais/.local/lib/python3.6/site-packages (from transformers) (6.0.1)\n",
|
||||||
|
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/ais/.local/lib/python3.6/site-packages (from huggingface-hub<1.0,>=0.1.0->transformers) (4.1.1)\n",
|
||||||
|
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3/dist-packages (from packaging>=20.0->transformers) (2.2.0)\n",
|
||||||
|
"Collecting importlib-resources\n",
|
||||||
|
" Using cached importlib_resources-5.4.0-py3-none-any.whl (28 kB)\n",
|
||||||
|
"Requirement already satisfied: zipp>=0.5 in /home/ais/.local/lib/python3.6/site-packages (from importlib-metadata->transformers) (3.6.0)\n",
|
||||||
|
"Collecting joblib\n",
|
||||||
|
" Using cached joblib-1.1.1-py2.py3-none-any.whl (309 kB)\n",
|
||||||
|
"Requirement already satisfied: six in /usr/lib/python3/dist-packages (from sacremoses->transformers) (1.11.0)\n",
|
||||||
|
"Requirement already satisfied: click in /usr/lib/python3/dist-packages (from sacremoses->transformers) (6.7)\n",
|
||||||
|
"Installing collected packages: importlib-resources, tqdm, regex, joblib, filelock, tokenizers, sacremoses, numpy, huggingface-hub, transformers\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",
|
||||||
|
"uff 0.6.9 requires protobuf>=3.3.0, but you have protobuf 3.0.0 which is incompatible.\u001b[0m\n",
|
||||||
|
"Successfully installed filelock-3.4.1 huggingface-hub-0.4.0 importlib-resources-5.4.0 joblib-1.1.1 numpy-1.19.5 regex-2023.8.8 sacremoses-0.0.53 tokenizers-0.12.1 tqdm-4.64.1 transformers-4.18.0\n",
|
||||||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"%pip install transformers\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 7,
|
||||||
|
"id": "3c95edd1-8a29-4ae4-bdf2-d9b993cadd67",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"4.18.0\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import transformers\n",
|
||||||
|
"print(transformers.__version__)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "8b5739a4-241d-416f-93d3-1acd17cce8bd",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3",
|
||||||
|
"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.6.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
Reference in New Issue
Block a user