Skip to content

Commit

Permalink
Additional notebook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle1668 committed Apr 22, 2023
1 parent d94132d commit d61375c
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions elk/rwkv_lm/test_rwkv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": 58,
"metadata": {},
"outputs": [
{
Expand All @@ -531,42 +531,53 @@
{
"data": {
"text/plain": [
"2048"
"torch.Size([243, 2048])"
]
},
"execution_count": 57,
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tokens = tokenizer.encode(bad_review_text, return_tensors=\"pt\")\n",
"print(f\"Input IDs shape = {tokens.shape}\")\n",
"\n",
"states = model(tokens)\n",
"tensor_final_state = states[-1]\n",
"tensor_final_state.shape\n",
"len(states[0][0])"
"tensor_final_state.shape"
]
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": 59,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Input IDs shape = torch.Size([1, 243])\n"
]
},
{
"data": {
"text/plain": [
"tensor([ 0.3164, -0.3691, 0.0165, ..., -0.0081, 0.0175, -0.0771],\n",
" device='cuda:0', dtype=torch.bfloat16)"
"torch.Size([2048])"
]
},
"execution_count": 53,
"execution_count": 59,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tensor_final_state[-1]"
"tokens = tokenizer.encode(bad_review_text, return_tensors=\"pt\")\n",
"print(f\"Input IDs shape = {tokens.shape}\")\n",
"\n",
"states = model(tokens[0])\n",
"tensor_final_state = states[-1]\n",
"tensor_final_state.shape"
]
}
],
Expand Down

0 comments on commit d61375c

Please sign in to comment.