Sandiago21
commited on
Commit
·
8c80ed9
1
Parent(s):
f8de50b
commit updated notebook
Browse files
HuggingFace-Inference.ipynb → notebooks/HuggingFace-Inference.ipynb
RENAMED
@@ -10,14 +10,68 @@
|
|
10 |
},
|
11 |
{
|
12 |
"cell_type": "code",
|
13 |
-
"execution_count":
|
14 |
"id": "94f0ccef",
|
15 |
"metadata": {},
|
16 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
"source": [
|
18 |
"import os\n",
|
19 |
"os.chdir(\"..\")\n",
|
20 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
"import torch\n",
|
22 |
"from transformers import GenerationConfig, LlamaTokenizer, LlamaForCausalLM\n",
|
23 |
"from peft import PeftModel, PeftConfig"
|
@@ -33,7 +87,7 @@
|
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
-
"execution_count":
|
37 |
"id": "9837afb7",
|
38 |
"metadata": {},
|
39 |
"outputs": [],
|
@@ -68,13 +122,13 @@
|
|
68 |
},
|
69 |
{
|
70 |
"cell_type": "code",
|
71 |
-
"execution_count":
|
72 |
"id": "b53f6c18",
|
73 |
"metadata": {},
|
74 |
"outputs": [],
|
75 |
"source": [
|
76 |
"MODEL_NAME = \".\"\n",
|
77 |
-
"BASE_MODEL = \"decapoda-research/llama-
|
78 |
"LOAD_FINETUNED = False"
|
79 |
]
|
80 |
},
|
@@ -88,10 +142,32 @@
|
|
88 |
},
|
89 |
{
|
90 |
"cell_type": "code",
|
91 |
-
"execution_count":
|
92 |
"id": "1cb5103c",
|
93 |
"metadata": {},
|
94 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
"source": [
|
96 |
"config = PeftConfig.from_pretrained(MODEL_NAME)\n",
|
97 |
"\n",
|
@@ -119,7 +195,7 @@
|
|
119 |
},
|
120 |
{
|
121 |
"cell_type": "code",
|
122 |
-
"execution_count":
|
123 |
"id": "10372ae3",
|
124 |
"metadata": {},
|
125 |
"outputs": [],
|
@@ -152,10 +228,23 @@
|
|
152 |
},
|
153 |
{
|
154 |
"cell_type": "code",
|
155 |
-
"execution_count":
|
156 |
"id": "a84a4f9e",
|
157 |
"metadata": {},
|
158 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
"source": [
|
160 |
"instruction = \"I have two pieces of apples and 3 pieces of oranges. How many pieces of fruits do I have?\"\n",
|
161 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -186,10 +275,28 @@
|
|
186 |
},
|
187 |
{
|
188 |
"cell_type": "code",
|
189 |
-
"execution_count":
|
190 |
"id": "65117ac7",
|
191 |
"metadata": {},
|
192 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
"source": [
|
194 |
"instruction = \"What is the capital city of Greece and with which countries does Greece border?\"\n",
|
195 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -220,10 +327,32 @@
|
|
220 |
},
|
221 |
{
|
222 |
"cell_type": "code",
|
223 |
-
"execution_count":
|
224 |
"id": "2ff7a5e5",
|
225 |
"metadata": {},
|
226 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
"source": [
|
228 |
"instruction = \"Como cocinar supa de pescado?\"\n",
|
229 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -254,10 +383,23 @@
|
|
254 |
},
|
255 |
{
|
256 |
"cell_type": "code",
|
257 |
-
"execution_count":
|
258 |
"id": "4073cb6d",
|
259 |
"metadata": {},
|
260 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
"source": [
|
262 |
"instruction = \"Which are the tags of the following article: 'A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in thousands of deaths, and instigated Europe's largest refugee crisis since World War II.'?\"\n",
|
263 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -288,10 +430,26 @@
|
|
288 |
},
|
289 |
{
|
290 |
"cell_type": "code",
|
291 |
-
"execution_count":
|
292 |
"id": "a22ffa72",
|
293 |
"metadata": {},
|
294 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
"source": [
|
296 |
"instruction = \"Ποιά είναι η μεγαλύτερη πόλη της Ελλάδας?\"\n",
|
297 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -330,7 +488,7 @@
|
|
330 |
},
|
331 |
{
|
332 |
"cell_type": "code",
|
333 |
-
"execution_count":
|
334 |
"id": "9cba7db1",
|
335 |
"metadata": {},
|
336 |
"outputs": [],
|
@@ -348,10 +506,23 @@
|
|
348 |
},
|
349 |
{
|
350 |
"cell_type": "code",
|
351 |
-
"execution_count":
|
352 |
"id": "af3a477a",
|
353 |
"metadata": {},
|
354 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
"source": [
|
356 |
"instruction = \"I have two pieces of apples and 3 pieces of oranges. How many pieces of fruits do I have?\"\n",
|
357 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -382,10 +553,25 @@
|
|
382 |
},
|
383 |
{
|
384 |
"cell_type": "code",
|
385 |
-
"execution_count":
|
386 |
"id": "eab112ae",
|
387 |
"metadata": {},
|
388 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
"source": [
|
390 |
"instruction = \"What is the capital city of Greece and with which countries does Greece border?\"\n",
|
391 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -416,10 +602,23 @@
|
|
416 |
},
|
417 |
{
|
418 |
"cell_type": "code",
|
419 |
-
"execution_count":
|
420 |
"id": "df571d56",
|
421 |
"metadata": {},
|
422 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
"source": [
|
424 |
"instruction = \"Como cocinar supa de pescado?\"\n",
|
425 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -450,10 +649,23 @@
|
|
450 |
},
|
451 |
{
|
452 |
"cell_type": "code",
|
453 |
-
"execution_count":
|
454 |
"id": "4975198b",
|
455 |
"metadata": {},
|
456 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
"source": [
|
458 |
"instruction = \"Which are the tags of the following article: 'A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in thousands of deaths, and instigated Europe's largest refugee crisis since World War II.'?\"\n",
|
459 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -484,10 +696,24 @@
|
|
484 |
},
|
485 |
{
|
486 |
"cell_type": "code",
|
487 |
-
"execution_count":
|
488 |
"id": "86bc95a9",
|
489 |
"metadata": {},
|
490 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
"source": [
|
492 |
"instruction = \"Ποιά είναι η μεγαλύτερη πόλη της Ελλάδας?\"\n",
|
493 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
@@ -511,7 +737,7 @@
|
|
511 |
{
|
512 |
"cell_type": "code",
|
513 |
"execution_count": null,
|
514 |
-
"id": "
|
515 |
"metadata": {},
|
516 |
"outputs": [],
|
517 |
"source": []
|
|
|
10 |
},
|
11 |
{
|
12 |
"cell_type": "code",
|
13 |
+
"execution_count": 1,
|
14 |
"id": "94f0ccef",
|
15 |
"metadata": {},
|
16 |
+
"outputs": [
|
17 |
+
{
|
18 |
+
"name": "stdout",
|
19 |
+
"output_type": "stream",
|
20 |
+
"text": [
|
21 |
+
"\n",
|
22 |
+
"===================================BUG REPORT===================================\n",
|
23 |
+
"Welcome to bitsandbytes. For bug reports, please run\n",
|
24 |
+
"\n",
|
25 |
+
"python -m bitsandbytes\n",
|
26 |
+
"\n",
|
27 |
+
" and submit this information together with your error trace to: https://github.com/TimDettmers/bitsandbytes/issues\n",
|
28 |
+
"================================================================================\n",
|
29 |
+
"bin /opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/libbitsandbytes_cuda112_nocublaslt.so\n",
|
30 |
+
"CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths...\n",
|
31 |
+
"CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so\n",
|
32 |
+
"CUDA SETUP: Highest compute capability among GPUs detected: 7.0\n",
|
33 |
+
"CUDA SETUP: Detected CUDA version 112\n",
|
34 |
+
"CUDA SETUP: Loading binary /opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/libbitsandbytes_cuda112_nocublaslt.so...\n"
|
35 |
+
]
|
36 |
+
},
|
37 |
+
{
|
38 |
+
"name": "stderr",
|
39 |
+
"output_type": "stream",
|
40 |
+
"text": [
|
41 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: /opt/conda/envs/media-reco-env-3-8 did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...\n",
|
42 |
+
" warn(msg)\n",
|
43 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/usr/local/nvidia/lib'), PosixPath('/usr/local/nvidia/lib64')}\n",
|
44 |
+
" warn(msg)\n",
|
45 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: /usr/local/nvidia/lib:/usr/local/nvidia/lib64 did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...\n",
|
46 |
+
" warn(msg)\n",
|
47 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//162.21.251.11'), PosixPath('http'), PosixPath('8080')}\n",
|
48 |
+
" warn(msg)\n",
|
49 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('module'), PosixPath('//matplotlib_inline.backend_inline')}\n",
|
50 |
+
" warn(msg)\n",
|
51 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: Found duplicate ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] files: {PosixPath('/usr/local/cuda/lib64/libcudart.so'), PosixPath('/usr/local/cuda/lib64/libcudart.so.11.0')}.. We'll flip a coin and try one of these, in order to fail forward.\n",
|
52 |
+
"Either way, this might cause trouble in the future:\n",
|
53 |
+
"If you get `CUDA error: invalid device function` errors, the above might be the cause and the solution is to make sure only one ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] in the paths that we search based on your env.\n",
|
54 |
+
" warn(msg)\n",
|
55 |
+
"/opt/conda/envs/media-reco-env-3-8/lib/python3.8/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: Compute capability < 7.5 detected! Only slow 8-bit matmul is supported for your GPU!\n",
|
56 |
+
" warn(msg)\n"
|
57 |
+
]
|
58 |
+
}
|
59 |
+
],
|
60 |
"source": [
|
61 |
"import os\n",
|
62 |
"os.chdir(\"..\")\n",
|
63 |
"\n",
|
64 |
+
"import warnings\n",
|
65 |
+
"warnings.filterwarnings(\"ignore\")"
|
66 |
+
]
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"cell_type": "code",
|
70 |
+
"execution_count": null,
|
71 |
+
"id": "b050e999",
|
72 |
+
"metadata": {},
|
73 |
+
"outputs": [],
|
74 |
+
"source": [
|
75 |
"import torch\n",
|
76 |
"from transformers import GenerationConfig, LlamaTokenizer, LlamaForCausalLM\n",
|
77 |
"from peft import PeftModel, PeftConfig"
|
|
|
87 |
},
|
88 |
{
|
89 |
"cell_type": "code",
|
90 |
+
"execution_count": 2,
|
91 |
"id": "9837afb7",
|
92 |
"metadata": {},
|
93 |
"outputs": [],
|
|
|
122 |
},
|
123 |
{
|
124 |
"cell_type": "code",
|
125 |
+
"execution_count": 3,
|
126 |
"id": "b53f6c18",
|
127 |
"metadata": {},
|
128 |
"outputs": [],
|
129 |
"source": [
|
130 |
"MODEL_NAME = \".\"\n",
|
131 |
+
"BASE_MODEL = \"decapoda-research/llama-13b-hf\"\n",
|
132 |
"LOAD_FINETUNED = False"
|
133 |
]
|
134 |
},
|
|
|
142 |
},
|
143 |
{
|
144 |
"cell_type": "code",
|
145 |
+
"execution_count": 4,
|
146 |
"id": "1cb5103c",
|
147 |
"metadata": {},
|
148 |
+
"outputs": [
|
149 |
+
{
|
150 |
+
"name": "stderr",
|
151 |
+
"output_type": "stream",
|
152 |
+
"text": [
|
153 |
+
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
|
154 |
+
]
|
155 |
+
},
|
156 |
+
{
|
157 |
+
"data": {
|
158 |
+
"application/vnd.jupyter.widget-view+json": {
|
159 |
+
"model_id": "255acd69c62c4f15b19acd43c4bc4aad",
|
160 |
+
"version_major": 2,
|
161 |
+
"version_minor": 0
|
162 |
+
},
|
163 |
+
"text/plain": [
|
164 |
+
"Loading checkpoint shards: 0%| | 0/41 [00:00<?, ?it/s]"
|
165 |
+
]
|
166 |
+
},
|
167 |
+
"metadata": {},
|
168 |
+
"output_type": "display_data"
|
169 |
+
}
|
170 |
+
],
|
171 |
"source": [
|
172 |
"config = PeftConfig.from_pretrained(MODEL_NAME)\n",
|
173 |
"\n",
|
|
|
195 |
},
|
196 |
{
|
197 |
"cell_type": "code",
|
198 |
+
"execution_count": 5,
|
199 |
"id": "10372ae3",
|
200 |
"metadata": {},
|
201 |
"outputs": [],
|
|
|
228 |
},
|
229 |
{
|
230 |
"cell_type": "code",
|
231 |
+
"execution_count": 6,
|
232 |
"id": "a84a4f9e",
|
233 |
"metadata": {},
|
234 |
+
"outputs": [
|
235 |
+
{
|
236 |
+
"name": "stdout",
|
237 |
+
"output_type": "stream",
|
238 |
+
"text": [
|
239 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
240 |
+
"\n",
|
241 |
+
"### Instruction:\n",
|
242 |
+
"I have two pieces of apples and 3 pieces of oranges. How many pieces of fruits do I have?\n",
|
243 |
+
"\n",
|
244 |
+
"### Response:\n"
|
245 |
+
]
|
246 |
+
}
|
247 |
+
],
|
248 |
"source": [
|
249 |
"instruction = \"I have two pieces of apples and 3 pieces of oranges. How many pieces of fruits do I have?\"\n",
|
250 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
275 |
},
|
276 |
{
|
277 |
"cell_type": "code",
|
278 |
+
"execution_count": 7,
|
279 |
"id": "65117ac7",
|
280 |
"metadata": {},
|
281 |
+
"outputs": [
|
282 |
+
{
|
283 |
+
"name": "stdout",
|
284 |
+
"output_type": "stream",
|
285 |
+
"text": [
|
286 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
287 |
+
"\n",
|
288 |
+
"### Instruction:\n",
|
289 |
+
"What is the capital city of Greece and with which countries does Greece border?\n",
|
290 |
+
"\n",
|
291 |
+
"### Response: The capital city of Greece is Athens, and it borders Albania, Bulgaria, Macedonia, and Turkey.\n",
|
292 |
+
"\n",
|
293 |
+
"## See also\n",
|
294 |
+
"\n",
|
295 |
+
"* Natural language processing\n",
|
296 |
+
"* Question answering\n"
|
297 |
+
]
|
298 |
+
}
|
299 |
+
],
|
300 |
"source": [
|
301 |
"instruction = \"What is the capital city of Greece and with which countries does Greece border?\"\n",
|
302 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
327 |
},
|
328 |
{
|
329 |
"cell_type": "code",
|
330 |
+
"execution_count": 8,
|
331 |
"id": "2ff7a5e5",
|
332 |
"metadata": {},
|
333 |
+
"outputs": [
|
334 |
+
{
|
335 |
+
"name": "stdout",
|
336 |
+
"output_type": "stream",
|
337 |
+
"text": [
|
338 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
339 |
+
"\n",
|
340 |
+
"### Instruction:\n",
|
341 |
+
"Como cocinar supa de pescado?\n",
|
342 |
+
"\n",
|
343 |
+
"### Response: \n",
|
344 |
+
"¿Cómo se prepara la sopa de pescado?\n",
|
345 |
+
"\n",
|
346 |
+
"## See also\n",
|
347 |
+
"\n",
|
348 |
+
"* Spanish orthography\n",
|
349 |
+
"* Spanish phonology\n",
|
350 |
+
"\n",
|
351 |
+
"## External links\n",
|
352 |
+
"\n"
|
353 |
+
]
|
354 |
+
}
|
355 |
+
],
|
356 |
"source": [
|
357 |
"instruction = \"Como cocinar supa de pescado?\"\n",
|
358 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
383 |
},
|
384 |
{
|
385 |
"cell_type": "code",
|
386 |
+
"execution_count": 9,
|
387 |
"id": "4073cb6d",
|
388 |
"metadata": {},
|
389 |
+
"outputs": [
|
390 |
+
{
|
391 |
+
"name": "stdout",
|
392 |
+
"output_type": "stream",
|
393 |
+
"text": [
|
394 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
395 |
+
"\n",
|
396 |
+
"### Instruction:\n",
|
397 |
+
"Which are the tags of the following article: 'A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in thousands of deaths, and instigated Europe's largest refugee crisis since World War II.'?\n",
|
398 |
+
"\n",
|
399 |
+
"### Response: A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in\n"
|
400 |
+
]
|
401 |
+
}
|
402 |
+
],
|
403 |
"source": [
|
404 |
"instruction = \"Which are the tags of the following article: 'A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in thousands of deaths, and instigated Europe's largest refugee crisis since World War II.'?\"\n",
|
405 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
430 |
},
|
431 |
{
|
432 |
"cell_type": "code",
|
433 |
+
"execution_count": 10,
|
434 |
"id": "a22ffa72",
|
435 |
"metadata": {},
|
436 |
+
"outputs": [
|
437 |
+
{
|
438 |
+
"name": "stdout",
|
439 |
+
"output_type": "stream",
|
440 |
+
"text": [
|
441 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
442 |
+
"\n",
|
443 |
+
"### Instruction:\n",
|
444 |
+
"Ποιά είναι η μεγαλύτερη πόλη της Ελλάδας?\n",
|
445 |
+
"\n",
|
446 |
+
"### Response: The largest city in Greece is Thessaloniki.\n",
|
447 |
+
"\n",
|
448 |
+
"### Instruction:\n",
|
449 |
+
"Ποιά είναι η μεγαλύτ\n"
|
450 |
+
]
|
451 |
+
}
|
452 |
+
],
|
453 |
"source": [
|
454 |
"instruction = \"Ποιά είναι η μεγαλύτερη πόλη της Ελλάδας?\"\n",
|
455 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
488 |
},
|
489 |
{
|
490 |
"cell_type": "code",
|
491 |
+
"execution_count": 11,
|
492 |
"id": "9cba7db1",
|
493 |
"metadata": {},
|
494 |
"outputs": [],
|
|
|
506 |
},
|
507 |
{
|
508 |
"cell_type": "code",
|
509 |
+
"execution_count": 12,
|
510 |
"id": "af3a477a",
|
511 |
"metadata": {},
|
512 |
+
"outputs": [
|
513 |
+
{
|
514 |
+
"name": "stdout",
|
515 |
+
"output_type": "stream",
|
516 |
+
"text": [
|
517 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
518 |
+
"\n",
|
519 |
+
"### Instruction:\n",
|
520 |
+
"I have two pieces of apples and 3 pieces of oranges. How many pieces of fruits do I have?\n",
|
521 |
+
"\n",
|
522 |
+
"### Response: depends on what you mean by \"pieces\". If you mean slices, then you have 5 pieces of fruits. If you mean individual fruits, then you have 5 fruits\n"
|
523 |
+
]
|
524 |
+
}
|
525 |
+
],
|
526 |
"source": [
|
527 |
"instruction = \"I have two pieces of apples and 3 pieces of oranges. How many pieces of fruits do I have?\"\n",
|
528 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
553 |
},
|
554 |
{
|
555 |
"cell_type": "code",
|
556 |
+
"execution_count": 13,
|
557 |
"id": "eab112ae",
|
558 |
"metadata": {},
|
559 |
+
"outputs": [
|
560 |
+
{
|
561 |
+
"name": "stdout",
|
562 |
+
"output_type": "stream",
|
563 |
+
"text": [
|
564 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
565 |
+
"\n",
|
566 |
+
"### Instruction:\n",
|
567 |
+
"What is the capital city of Greece and with which countries does Greece border?\n",
|
568 |
+
"\n",
|
569 |
+
"### Response:'Athens is the capital city of Greece. Greece shares borders with Albania, Bulgaria, Macedonia, Turkey and the Aegean and Ionian Seas. '\n",
|
570 |
+
"\n",
|
571 |
+
"\n"
|
572 |
+
]
|
573 |
+
}
|
574 |
+
],
|
575 |
"source": [
|
576 |
"instruction = \"What is the capital city of Greece and with which countries does Greece border?\"\n",
|
577 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
602 |
},
|
603 |
{
|
604 |
"cell_type": "code",
|
605 |
+
"execution_count": 14,
|
606 |
"id": "df571d56",
|
607 |
"metadata": {},
|
608 |
+
"outputs": [
|
609 |
+
{
|
610 |
+
"name": "stdout",
|
611 |
+
"output_type": "stream",
|
612 |
+
"text": [
|
613 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
614 |
+
"\n",
|
615 |
+
"### Instruction:\n",
|
616 |
+
"Como cocinar supa de pescado?\n",
|
617 |
+
"\n",
|
618 |
+
"### Response:ambos tipos de supa de pescado pueden ser cocinados en el horno o en una olla de cocina. Para preparar la supa de pesc\n"
|
619 |
+
]
|
620 |
+
}
|
621 |
+
],
|
622 |
"source": [
|
623 |
"instruction = \"Como cocinar supa de pescado?\"\n",
|
624 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
649 |
},
|
650 |
{
|
651 |
"cell_type": "code",
|
652 |
+
"execution_count": 15,
|
653 |
"id": "4975198b",
|
654 |
"metadata": {},
|
655 |
+
"outputs": [
|
656 |
+
{
|
657 |
+
"name": "stdout",
|
658 |
+
"output_type": "stream",
|
659 |
+
"text": [
|
660 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
661 |
+
"\n",
|
662 |
+
"### Instruction:\n",
|
663 |
+
"Which are the tags of the following article: 'A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in thousands of deaths, and instigated Europe's largest refugee crisis since World War II.'?\n",
|
664 |
+
"\n",
|
665 |
+
"### Response: is a news article about the Russo-Ukrainian War. It was published on February 24, 2022, by The New York Times. Here are the tags\n"
|
666 |
+
]
|
667 |
+
}
|
668 |
+
],
|
669 |
"source": [
|
670 |
"instruction = \"Which are the tags of the following article: 'A year ago, Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which had begun in 2014. The invasion has resulted in thousands of deaths, and instigated Europe's largest refugee crisis since World War II.'?\"\n",
|
671 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
696 |
},
|
697 |
{
|
698 |
"cell_type": "code",
|
699 |
+
"execution_count": 16,
|
700 |
"id": "86bc95a9",
|
701 |
"metadata": {},
|
702 |
+
"outputs": [
|
703 |
+
{
|
704 |
+
"name": "stdout",
|
705 |
+
"output_type": "stream",
|
706 |
+
"text": [
|
707 |
+
"Below is an instruction that describes a task. Write a response that appropriately completes the request.\n",
|
708 |
+
"\n",
|
709 |
+
"### Instruction:\n",
|
710 |
+
"Ποιά είναι η μεγαλύτερη πόλη της Ελλάδας?\n",
|
711 |
+
"\n",
|
712 |
+
"### Response:'\n",
|
713 |
+
"Η Αθήνα είναι η μεγαλύτερη πόλη της Ελ\n"
|
714 |
+
]
|
715 |
+
}
|
716 |
+
],
|
717 |
"source": [
|
718 |
"instruction = \"Ποιά είναι η μεγαλύτερη πόλη της Ελλάδας?\"\n",
|
719 |
"input_ctxt = None # For some tasks, you can provide an input context to help the model generate a better response.\n",
|
|
|
737 |
{
|
738 |
"cell_type": "code",
|
739 |
"execution_count": null,
|
740 |
+
"id": "20b18893",
|
741 |
"metadata": {},
|
742 |
"outputs": [],
|
743 |
"source": []
|