Skip to content

Commit 7825bee

Browse files
laerdonlaerdon
andauthored
Forecaster demo selector bug fix (#354)
Co-authored-by: Laerdon Kim <laerdon@users.noreply.github.com> Co-authored-by: laerdon <lyk25@en-is-jacqueline.coecis.cornell.edu>
1 parent 5bd9d92 commit 7825bee

1 file changed

Lines changed: 26 additions & 23 deletions

File tree

examples/forecaster/Run Transformer Fine-tuned Models.ipynb

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": 2,
1616
"metadata": {},
1717
"outputs": [
1818
{
@@ -26,26 +26,29 @@
2626
"name": "stderr",
2727
"output_type": "stream",
2828
"text": [
29-
"2026-06-27 20:18:39.864582: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
30-
"2026-06-27 20:18:39.887405: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
29+
"/reef/lyk25/ConvoKit/dist/.venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
30+
" from .autonotebook import tqdm as notebook_tqdm\n",
3131
"WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
32-
"E0000 00:00:1782591519.912052 859600 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
33-
"E0000 00:00:1782591519.919822 859600 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
34-
"W0000 00:00:1782591519.938735 859600 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n",
35-
"W0000 00:00:1782591519.938755 859600 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n",
36-
"W0000 00:00:1782591519.938757 859600 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n",
37-
"W0000 00:00:1782591519.938760 859600 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.\n",
38-
"2026-06-27 20:18:39.944875: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
39-
"To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
32+
"I0000 00:00:1782619476.409075 1013993 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
33+
"I0000 00:00:1782619476.481779 1013993 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
34+
"To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
35+
"WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
36+
"I0000 00:00:1782619477.990444 1013993 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n"
4037
]
4138
},
4239
{
4340
"name": "stdout",
4441
"output_type": "stream",
4542
"text": [
46-
"INFO 06-27 20:18:48 [__init__.py:216] Automatically detected platform cuda.\n",
4743
"🦥 Unsloth Zoo will now patch everything to make training faster!\n"
4844
]
45+
},
46+
{
47+
"name": "stderr",
48+
"output_type": "stream",
49+
"text": [
50+
"Unable to import `torchao` Tensor objects. This may affect loading checkpoints serialized with `torchao`\n"
51+
]
4952
}
5053
],
5154
"source": [
@@ -78,16 +81,16 @@
7881
},
7982
{
8083
"cell_type": "code",
81-
"execution_count": null,
84+
"execution_count": 3,
8285
"metadata": {},
8386
"outputs": [],
8487
"source": [
8588
"# CPU mode (noting that it will be slower)\n",
8689
"DEVICE = \"cuda\"\n",
8790
"\n",
88-
"corpus_name = \"cga-wikiconv\"\n",
91+
"# corpus_name = \"cga-wikiconv\"\n",
8992
"# corpus_name = \"cga-cmv-legacy\"\n",
90-
"# corpus_name = \"cga-cmv-large\"\n",
93+
"corpus_name = \"cga-cmv-large\"\n",
9194
"label_metadata = \"has_removed_comment\" if 'cmv' in corpus_name else 'conversation_has_personal_attack'\n",
9295
"\n",
9396
"YOUR_MODEL_DIRECTORY = \"YOUR_MODEL_DIRECTORY\"\n",
@@ -96,7 +99,7 @@
9699
},
97100
{
98101
"cell_type": "code",
99-
"execution_count": 3,
102+
"execution_count": 4,
100103
"metadata": {},
101104
"outputs": [
102105
{
@@ -125,7 +128,7 @@
125128
},
126129
{
127130
"cell_type": "code",
128-
"execution_count": 8,
131+
"execution_count": 7,
129132
"metadata": {},
130133
"outputs": [],
131134
"source": [
@@ -223,11 +226,11 @@
223226
},
224227
{
225228
"cell_type": "code",
226-
"execution_count": 17,
229+
"execution_count": 13,
227230
"metadata": {},
228231
"outputs": [],
229232
"source": [
230-
"def transform_selector(context_tuple, corpus_name):\n",
233+
"def transform_selector(context_tuple):\n",
231234
" \"\"\"\n",
232235
" For transform we only need to check that the conversation is in the test split\n",
233236
" \"\"\"\n",
@@ -238,7 +241,7 @@
238241
" matches_split = (context_tuple.current_utterance.get_conversation().meta[\"split\"] == \"test\")\n",
239242
" is_end = (len(context_tuple.context) == convo_length)\n",
240243
"\n",
241-
" if corpus_name.contains(\"cmv\"):\n",
244+
" if \"cmv\" in corpus_name:\n",
242245
" return (matches_split)\n",
243246
" else:\n",
244247
" return (matches_split and not is_end)\n",
@@ -505,7 +508,7 @@
505508
},
506509
{
507510
"cell_type": "code",
508-
"execution_count": 6,
511+
"execution_count": 8,
509512
"metadata": {},
510513
"outputs": [
511514
{
@@ -813,7 +816,7 @@
813816
],
814817
"metadata": {
815818
"kernelspec": {
816-
"display_name": "Python 3 (ipykernel)",
819+
"display_name": ".venv",
817820
"language": "python",
818821
"name": "python3"
819822
},
@@ -827,7 +830,7 @@
827830
"name": "python",
828831
"nbconvert_exporter": "python",
829832
"pygments_lexer": "ipython3",
830-
"version": "3.11.11"
833+
"version": "3.12.4"
831834
}
832835
},
833836
"nbformat": 4,

0 commit comments

Comments
 (0)