Ethan L. Mines commited on
Commit ·
e734ddd
1
Parent(s): 461b6d6
Update example
Browse files- Example.ipynb +5 -5
Example.ipynb
CHANGED
|
@@ -58,7 +58,7 @@
|
|
| 58 |
},
|
| 59 |
{
|
| 60 |
"cell_type": "code",
|
| 61 |
-
"execution_count":
|
| 62 |
"id": "82673e84",
|
| 63 |
"metadata": {},
|
| 64 |
"outputs": [],
|
|
@@ -68,12 +68,12 @@
|
|
| 68 |
"max_target_length = 64\n",
|
| 69 |
"context_trunc = tokenizer.decode(tokenizer.encode(samples, max_length=max_context_length, add_special_tokens=False), is_split_into_words=False)\n",
|
| 70 |
"target_trunc = tokenizer.decode(tokenizer.encode(targets, max_length=max_target_length, add_special_tokens=False), is_split_into_words=False)\n",
|
| 71 |
-
"combined = tokenizer(text=context_trunc, text_pair=target_trunc, return_tensors='pt')"
|
| 72 |
]
|
| 73 |
},
|
| 74 |
{
|
| 75 |
"cell_type": "code",
|
| 76 |
-
"execution_count":
|
| 77 |
"id": "5d93f032",
|
| 78 |
"metadata": {},
|
| 79 |
"outputs": [],
|
|
@@ -83,7 +83,7 @@
|
|
| 83 |
},
|
| 84 |
{
|
| 85 |
"cell_type": "code",
|
| 86 |
-
"execution_count":
|
| 87 |
"id": "6a83f378",
|
| 88 |
"metadata": {},
|
| 89 |
"outputs": [
|
|
@@ -93,7 +93,7 @@
|
|
| 93 |
"['FAVOR', 'NONE']"
|
| 94 |
]
|
| 95 |
},
|
| 96 |
-
"execution_count":
|
| 97 |
"metadata": {},
|
| 98 |
"output_type": "execute_result"
|
| 99 |
}
|
|
|
|
| 58 |
},
|
| 59 |
{
|
| 60 |
"cell_type": "code",
|
| 61 |
+
"execution_count": 21,
|
| 62 |
"id": "82673e84",
|
| 63 |
"metadata": {},
|
| 64 |
"outputs": [],
|
|
|
|
| 68 |
"max_target_length = 64\n",
|
| 69 |
"context_trunc = tokenizer.decode(tokenizer.encode(samples, max_length=max_context_length, add_special_tokens=False), is_split_into_words=False)\n",
|
| 70 |
"target_trunc = tokenizer.decode(tokenizer.encode(targets, max_length=max_target_length, add_special_tokens=False), is_split_into_words=False)\n",
|
| 71 |
+
"combined = tokenizer(text=context_trunc, text_pair=target_trunc, return_tensors='pt', padding=True)"
|
| 72 |
]
|
| 73 |
},
|
| 74 |
{
|
| 75 |
"cell_type": "code",
|
| 76 |
+
"execution_count": 22,
|
| 77 |
"id": "5d93f032",
|
| 78 |
"metadata": {},
|
| 79 |
"outputs": [],
|
|
|
|
| 83 |
},
|
| 84 |
{
|
| 85 |
"cell_type": "code",
|
| 86 |
+
"execution_count": 23,
|
| 87 |
"id": "6a83f378",
|
| 88 |
"metadata": {},
|
| 89 |
"outputs": [
|
|
|
|
| 93 |
"['FAVOR', 'NONE']"
|
| 94 |
]
|
| 95 |
},
|
| 96 |
+
"execution_count": 23,
|
| 97 |
"metadata": {},
|
| 98 |
"output_type": "execute_result"
|
| 99 |
}
|