Skip to content

Commit

Permalink
Merge pull request #134 from stanfordnlp/zen/notebook_update
Browse files Browse the repository at this point in the history
[Minor] fix undefined var
  • Loading branch information
frankaging authored Sep 4, 2024
2 parents 8db2ecc + 0bef57b commit 83475c8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions examples/memorisation/reft_power.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "aafcbe5b-b1bb-42c5-930c-98129462e989",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -62,14 +62,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "ccf7e8dd-430c-4db8-93c5-fe61e7060fe2",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a36c95ab54ba4ebe8c2396774d0105c3",
"model_id": "4504ae2458ac456580779d04facc6443",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -83,7 +83,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fd8f3346be10479b949a15ef0e968000",
"model_id": "9062747a2a6c4652a028d627b130bb4c",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -898,7 +898,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "9fddf0de-d8fc-4062-b420-3b56eac1912f",
"metadata": {},
"outputs": [],
Expand All @@ -916,8 +916,8 @@
"metadata": {},
"outputs": [],
"source": [
"for model_max_length in [128, 256, 512, 1024]:\n",
" for TARGET_LAYER in [0, 5, 10, 15, 20, 25, 31]:\n",
"for max_pair in [256]:\n",
" for TARGET_LAYER in [20]:\n",
" print(\"analyzing:\", (max_pair, TARGET_LAYER))\n",
" # generate access id to token mapping\n",
" alice_vocab_sampled = random.sample(list(alice_vocab), k=max_pair)\n",
Expand Down Expand Up @@ -968,9 +968,9 @@
" match_perc = round(correct_count/max_pair, 2)\n",
" results.append([max_pair, TARGET_LAYER, match_perc])\n",
" print(match_perc)\n",
"FILE_PATH = './memo_multitude_7B.json'\n",
"with open(FILE_PATH, 'w') as output_file:\n",
"\tjson.dump(results, output_file, indent=2)"
"# FILE_PATH = './memo_multitude_7B.json'\n",
"# with open(FILE_PATH, 'w') as output_file:\n",
"# \tjson.dump(results, output_file, indent=2)"
]
},
{
Expand Down

0 comments on commit 83475c8

Please sign in to comment.