Agon H
commited on
Commit
·
96f0c6b
1
Parent(s):
75d4baf
Upload run this model.ipynb
Browse files- run this model.ipynb +326 -0
run this model.ipynb
ADDED
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "aba711ad-331a-4c27-b732-be5886f70599",
|
7 |
+
"metadata": {
|
8 |
+
"tags": []
|
9 |
+
},
|
10 |
+
"outputs": [],
|
11 |
+
"source": [
|
12 |
+
"!pip install -q -U transformers peft accelerate optimum"
|
13 |
+
]
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"cell_type": "code",
|
17 |
+
"execution_count": 2,
|
18 |
+
"id": "2fa956a0-882e-4df7-8af4-30a91efb1fb2",
|
19 |
+
"metadata": {
|
20 |
+
"tags": []
|
21 |
+
},
|
22 |
+
"outputs": [
|
23 |
+
{
|
24 |
+
"name": "stdout",
|
25 |
+
"output_type": "stream",
|
26 |
+
"text": [
|
27 |
+
"Requirement already satisfied: auto-gptq in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (0.4.2+cu117)\n",
|
28 |
+
"Requirement already satisfied: accelerate>=0.19.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (0.22.0)\n",
|
29 |
+
"Requirement already satisfied: torch>=1.13.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (2.0.1)\n",
|
30 |
+
"Requirement already satisfied: transformers>=4.31.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (4.32.1)\n",
|
31 |
+
"Requirement already satisfied: datasets in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (2.14.4)\n",
|
32 |
+
"Requirement already satisfied: peft in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (0.5.0)\n",
|
33 |
+
"Requirement already satisfied: numpy in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (1.25.2)\n",
|
34 |
+
"Requirement already satisfied: rouge in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (1.0.1)\n",
|
35 |
+
"Requirement already satisfied: safetensors in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from auto-gptq) (0.3.3)\n",
|
36 |
+
"Requirement already satisfied: psutil in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from accelerate>=0.19.0->auto-gptq) (5.9.5)\n",
|
37 |
+
"Requirement already satisfied: pyyaml in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from accelerate>=0.19.0->auto-gptq) (6.0)\n",
|
38 |
+
"Requirement already satisfied: packaging>=20.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from accelerate>=0.19.0->auto-gptq) (23.1)\n",
|
39 |
+
"Requirement already satisfied: filelock in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (3.12.3)\n",
|
40 |
+
"Requirement already satisfied: nvidia-cuda-cupti-cu11==11.7.101 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.7.101)\n",
|
41 |
+
"Requirement already satisfied: nvidia-cusparse-cu11==11.7.4.91 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.7.4.91)\n",
|
42 |
+
"Requirement already satisfied: nvidia-cuda-nvrtc-cu11==11.7.99 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.7.99)\n",
|
43 |
+
"Requirement already satisfied: nvidia-nccl-cu11==2.14.3 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (2.14.3)\n",
|
44 |
+
"Requirement already satisfied: nvidia-cuda-runtime-cu11==11.7.99 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.7.99)\n",
|
45 |
+
"Requirement already satisfied: nvidia-cublas-cu11==11.10.3.66 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.10.3.66)\n",
|
46 |
+
"Requirement already satisfied: sympy in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (1.12)\n",
|
47 |
+
"Requirement already satisfied: nvidia-cusolver-cu11==11.4.0.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.4.0.1)\n",
|
48 |
+
"Requirement already satisfied: jinja2 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (3.1.2)\n",
|
49 |
+
"Requirement already satisfied: networkx in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (3.1)\n",
|
50 |
+
"Requirement already satisfied: typing-extensions in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (4.7.1)\n",
|
51 |
+
"Requirement already satisfied: nvidia-nvtx-cu11==11.7.91 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (11.7.91)\n",
|
52 |
+
"Requirement already satisfied: nvidia-cufft-cu11==10.9.0.58 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (10.9.0.58)\n",
|
53 |
+
"Requirement already satisfied: triton==2.0.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (2.0.0)\n",
|
54 |
+
"Requirement already satisfied: nvidia-curand-cu11==10.2.10.91 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (10.2.10.91)\n",
|
55 |
+
"Requirement already satisfied: nvidia-cudnn-cu11==8.5.0.96 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from torch>=1.13.0->auto-gptq) (8.5.0.96)\n",
|
56 |
+
"Requirement already satisfied: wheel in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.13.0->auto-gptq) (0.41.1)\n",
|
57 |
+
"Requirement already satisfied: setuptools in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.13.0->auto-gptq) (68.0.0)\n",
|
58 |
+
"Requirement already satisfied: lit in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from triton==2.0.0->torch>=1.13.0->auto-gptq) (16.0.6)\n",
|
59 |
+
"Requirement already satisfied: cmake in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from triton==2.0.0->torch>=1.13.0->auto-gptq) (3.27.2)\n",
|
60 |
+
"Requirement already satisfied: tqdm>=4.27 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from transformers>=4.31.0->auto-gptq) (4.66.1)\n",
|
61 |
+
"Requirement already satisfied: regex!=2019.12.17 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from transformers>=4.31.0->auto-gptq) (2023.8.8)\n",
|
62 |
+
"Requirement already satisfied: huggingface-hub<1.0,>=0.15.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from transformers>=4.31.0->auto-gptq) (0.16.4)\n",
|
63 |
+
"Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from transformers>=4.31.0->auto-gptq) (0.13.3)\n",
|
64 |
+
"Requirement already satisfied: requests in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from transformers>=4.31.0->auto-gptq) (2.31.0)\n",
|
65 |
+
"Requirement already satisfied: fsspec in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.15.1->transformers>=4.31.0->auto-gptq) (2023.6.0)\n",
|
66 |
+
"Requirement already satisfied: multiprocess in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from datasets->auto-gptq) (0.70.15)\n",
|
67 |
+
"Requirement already satisfied: dill<0.3.8,>=0.3.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from datasets->auto-gptq) (0.3.7)\n",
|
68 |
+
"Requirement already satisfied: aiohttp in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from datasets->auto-gptq) (3.8.5)\n",
|
69 |
+
"Requirement already satisfied: xxhash in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from datasets->auto-gptq) (3.3.0)\n",
|
70 |
+
"Requirement already satisfied: pyarrow>=8.0.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from datasets->auto-gptq) (13.0.0)\n",
|
71 |
+
"Requirement already satisfied: pandas in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from datasets->auto-gptq) (2.1.0)\n",
|
72 |
+
"Requirement already satisfied: multidict<7.0,>=4.5 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (6.0.4)\n",
|
73 |
+
"Requirement already satisfied: attrs>=17.3.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (23.1.0)\n",
|
74 |
+
"Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (4.0.3)\n",
|
75 |
+
"Requirement already satisfied: aiosignal>=1.1.2 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (1.3.1)\n",
|
76 |
+
"Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (3.2.0)\n",
|
77 |
+
"Requirement already satisfied: frozenlist>=1.1.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (1.4.0)\n",
|
78 |
+
"Requirement already satisfied: yarl<2.0,>=1.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from aiohttp->datasets->auto-gptq) (1.9.2)\n",
|
79 |
+
"Requirement already satisfied: idna<4,>=2.5 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from requests->transformers>=4.31.0->auto-gptq) (3.4)\n",
|
80 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from requests->transformers>=4.31.0->auto-gptq) (2.0.4)\n",
|
81 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from requests->transformers>=4.31.0->auto-gptq) (2023.7.22)\n",
|
82 |
+
"Requirement already satisfied: MarkupSafe>=2.0 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from jinja2->torch>=1.13.0->auto-gptq) (2.1.3)\n",
|
83 |
+
"Requirement already satisfied: python-dateutil>=2.8.2 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from pandas->datasets->auto-gptq) (2.8.2)\n",
|
84 |
+
"Requirement already satisfied: pytz>=2020.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from pandas->datasets->auto-gptq) (2023.3)\n",
|
85 |
+
"Requirement already satisfied: tzdata>=2022.1 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from pandas->datasets->auto-gptq) (2023.3)\n",
|
86 |
+
"Requirement already satisfied: six>=1.5 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from python-dateutil>=2.8.2->pandas->datasets->auto-gptq) (1.16.0)\n",
|
87 |
+
"Requirement already satisfied: mpmath>=0.19 in /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages (from sympy->torch>=1.13.0->auto-gptq) (1.3.0)\n"
|
88 |
+
]
|
89 |
+
}
|
90 |
+
],
|
91 |
+
"source": [
|
92 |
+
"!pip install auto-gptq"
|
93 |
+
]
|
94 |
+
},
|
95 |
+
{
|
96 |
+
"cell_type": "code",
|
97 |
+
"execution_count": 3,
|
98 |
+
"id": "89705dea-d988-4ece-8073-54970626f4f7",
|
99 |
+
"metadata": {
|
100 |
+
"tags": []
|
101 |
+
},
|
102 |
+
"outputs": [
|
103 |
+
{
|
104 |
+
"data": {
|
105 |
+
"application/vnd.jupyter.widget-view+json": {
|
106 |
+
"model_id": "9540122492f14f46ba75ebce474c28b7",
|
107 |
+
"version_major": 2,
|
108 |
+
"version_minor": 0
|
109 |
+
},
|
110 |
+
"text/plain": [
|
111 |
+
"Downloading (…)lve/main/config.json: 0%| | 0.00/1.10k [00:00<?, ?B/s]"
|
112 |
+
]
|
113 |
+
},
|
114 |
+
"metadata": {},
|
115 |
+
"output_type": "display_data"
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"data": {
|
119 |
+
"application/vnd.jupyter.widget-view+json": {
|
120 |
+
"model_id": "2e25472cc600484ca211d91ca59f0d36",
|
121 |
+
"version_major": 2,
|
122 |
+
"version_minor": 0
|
123 |
+
},
|
124 |
+
"text/plain": [
|
125 |
+
"Downloading (…)fetensors.index.json: 0%| | 0.00/126k [00:00<?, ?B/s]"
|
126 |
+
]
|
127 |
+
},
|
128 |
+
"metadata": {},
|
129 |
+
"output_type": "display_data"
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"data": {
|
133 |
+
"application/vnd.jupyter.widget-view+json": {
|
134 |
+
"model_id": "b17f43950b43488ebba5a2143c02aed3",
|
135 |
+
"version_major": 2,
|
136 |
+
"version_minor": 0
|
137 |
+
},
|
138 |
+
"text/plain": [
|
139 |
+
"Downloading shards: 0%| | 0/2 [00:00<?, ?it/s]"
|
140 |
+
]
|
141 |
+
},
|
142 |
+
"metadata": {},
|
143 |
+
"output_type": "display_data"
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"data": {
|
147 |
+
"application/vnd.jupyter.widget-view+json": {
|
148 |
+
"model_id": "0e11ede92c694293aaa5d004f7efe364",
|
149 |
+
"version_major": 2,
|
150 |
+
"version_minor": 0
|
151 |
+
},
|
152 |
+
"text/plain": [
|
153 |
+
"Downloading (…)of-00002.safetensors: 0%| | 0.00/9.98G [00:00<?, ?B/s]"
|
154 |
+
]
|
155 |
+
},
|
156 |
+
"metadata": {},
|
157 |
+
"output_type": "display_data"
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"data": {
|
161 |
+
"application/vnd.jupyter.widget-view+json": {
|
162 |
+
"model_id": "b241c5f66c854876b574739f7ba3aaba",
|
163 |
+
"version_major": 2,
|
164 |
+
"version_minor": 0
|
165 |
+
},
|
166 |
+
"text/plain": [
|
167 |
+
"Downloading (…)of-00002.safetensors: 0%| | 0.00/2.00G [00:00<?, ?B/s]"
|
168 |
+
]
|
169 |
+
},
|
170 |
+
"metadata": {},
|
171 |
+
"output_type": "display_data"
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"data": {
|
175 |
+
"application/vnd.jupyter.widget-view+json": {
|
176 |
+
"model_id": "f21bb47869cb4841b65ca603c7449453",
|
177 |
+
"version_major": 2,
|
178 |
+
"version_minor": 0
|
179 |
+
},
|
180 |
+
"text/plain": [
|
181 |
+
"Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s]"
|
182 |
+
]
|
183 |
+
},
|
184 |
+
"metadata": {},
|
185 |
+
"output_type": "display_data"
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"data": {
|
189 |
+
"application/vnd.jupyter.widget-view+json": {
|
190 |
+
"model_id": "7154fe572cf949e38cbeaa1e212281f7",
|
191 |
+
"version_major": 2,
|
192 |
+
"version_minor": 0
|
193 |
+
},
|
194 |
+
"text/plain": [
|
195 |
+
"Downloading (…)neration_config.json: 0%| | 0.00/154 [00:00<?, ?B/s]"
|
196 |
+
]
|
197 |
+
},
|
198 |
+
"metadata": {},
|
199 |
+
"output_type": "display_data"
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"data": {
|
203 |
+
"application/vnd.jupyter.widget-view+json": {
|
204 |
+
"model_id": "426dd05bb0a743c79b9604564809a5a1",
|
205 |
+
"version_major": 2,
|
206 |
+
"version_minor": 0
|
207 |
+
},
|
208 |
+
"text/plain": [
|
209 |
+
"Downloading (…)okenizer_config.json: 0%| | 0.00/244 [00:00<?, ?B/s]"
|
210 |
+
]
|
211 |
+
},
|
212 |
+
"metadata": {},
|
213 |
+
"output_type": "display_data"
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"data": {
|
217 |
+
"application/vnd.jupyter.widget-view+json": {
|
218 |
+
"model_id": "66fab430ded94aada339c52da8cabaf7",
|
219 |
+
"version_major": 2,
|
220 |
+
"version_minor": 0
|
221 |
+
},
|
222 |
+
"text/plain": [
|
223 |
+
"Downloading tokenizer.model: 0%| | 0.00/500k [00:00<?, ?B/s]"
|
224 |
+
]
|
225 |
+
},
|
226 |
+
"metadata": {},
|
227 |
+
"output_type": "display_data"
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"data": {
|
231 |
+
"application/vnd.jupyter.widget-view+json": {
|
232 |
+
"model_id": "3b65f4ac6a764c919996c5dd750feaa0",
|
233 |
+
"version_major": 2,
|
234 |
+
"version_minor": 0
|
235 |
+
},
|
236 |
+
"text/plain": [
|
237 |
+
"Downloading (…)/main/tokenizer.json: 0%| | 0.00/1.84M [00:00<?, ?B/s]"
|
238 |
+
]
|
239 |
+
},
|
240 |
+
"metadata": {},
|
241 |
+
"output_type": "display_data"
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"data": {
|
245 |
+
"application/vnd.jupyter.widget-view+json": {
|
246 |
+
"model_id": "222828ac2eb44eefa1de3ad41cb81cf4",
|
247 |
+
"version_major": 2,
|
248 |
+
"version_minor": 0
|
249 |
+
},
|
250 |
+
"text/plain": [
|
251 |
+
"Downloading (…)in/added_tokens.json: 0%| | 0.00/21.0 [00:00<?, ?B/s]"
|
252 |
+
]
|
253 |
+
},
|
254 |
+
"metadata": {},
|
255 |
+
"output_type": "display_data"
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"data": {
|
259 |
+
"application/vnd.jupyter.widget-view+json": {
|
260 |
+
"model_id": "850fb340b7104c3a8b7d8fedda825690",
|
261 |
+
"version_major": 2,
|
262 |
+
"version_minor": 0
|
263 |
+
},
|
264 |
+
"text/plain": [
|
265 |
+
"Downloading (…)cial_tokens_map.json: 0%| | 0.00/435 [00:00<?, ?B/s]"
|
266 |
+
]
|
267 |
+
},
|
268 |
+
"metadata": {},
|
269 |
+
"output_type": "display_data"
|
270 |
+
}
|
271 |
+
],
|
272 |
+
"source": [
|
273 |
+
"from transformers import AutoTokenizer, AutoModelForCausalLM\n",
|
274 |
+
"\n",
|
275 |
+
"model_id = \"agonh/MythoMax22b-Falseblock-GPT\"\n",
|
276 |
+
"model = AutoModelForCausalLM.from_pretrained(model_id, device_map=\"auto\")\n",
|
277 |
+
"tokenizer = AutoTokenizer.from_pretrained(model_id)"
|
278 |
+
]
|
279 |
+
},
|
280 |
+
{
|
281 |
+
"cell_type": "code",
|
282 |
+
"execution_count": null,
|
283 |
+
"id": "d295d782-866a-4c60-9d03-18777a777568",
|
284 |
+
"metadata": {
|
285 |
+
"tags": []
|
286 |
+
},
|
287 |
+
"outputs": [],
|
288 |
+
"source": [
|
289 |
+
"text = \"Tell me about AI\"\n",
|
290 |
+
"inputs = tokenizer(text, return_tensors=\"pt\").to(0)\n",
|
291 |
+
"\n",
|
292 |
+
"out = model.generate(**inputs, max_new_tokens=500)\n",
|
293 |
+
"print(tokenizer.decode(out[0], skip_special_tokens=True))"
|
294 |
+
]
|
295 |
+
},
|
296 |
+
{
|
297 |
+
"cell_type": "code",
|
298 |
+
"execution_count": null,
|
299 |
+
"id": "ea9720ad-d3ca-4a5f-8cf6-1846ea3e1e13",
|
300 |
+
"metadata": {},
|
301 |
+
"outputs": [],
|
302 |
+
"source": []
|
303 |
+
}
|
304 |
+
],
|
305 |
+
"metadata": {
|
306 |
+
"kernelspec": {
|
307 |
+
"display_name": "default:Python",
|
308 |
+
"language": "python",
|
309 |
+
"name": "conda-env-default-py"
|
310 |
+
},
|
311 |
+
"language_info": {
|
312 |
+
"codemirror_mode": {
|
313 |
+
"name": "ipython",
|
314 |
+
"version": 3
|
315 |
+
},
|
316 |
+
"file_extension": ".py",
|
317 |
+
"mimetype": "text/x-python",
|
318 |
+
"name": "python",
|
319 |
+
"nbconvert_exporter": "python",
|
320 |
+
"pygments_lexer": "ipython3",
|
321 |
+
"version": "3.9.16"
|
322 |
+
}
|
323 |
+
},
|
324 |
+
"nbformat": 4,
|
325 |
+
"nbformat_minor": 5
|
326 |
+
}
|