Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
udlbook committed Dec 13, 2022
1 parent b3a5d9d commit 06663df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CX20315_Transformers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyPLuYbU3a6Uvb/3X1shd1XV",
"authorship_tag": "ABX9TyMfWL40+ZshPZhweAtQ9Fn6",
"include_colab_link": true
},
"kernelspec": {
Expand Down Expand Up @@ -133,7 +133,7 @@
" outputs = model(input_ids = input_tokens['input_ids'], attention_mask = input_tokens['attention_mask'])\n",
" # Find prediction\n",
" prob_over_tokens = F.softmax(outputs.logits, dim=-1).detach().numpy()[0,-1]\n",
" # Draw a random token according to the probabilities\n",
" # TODO: Draw a random token according to the probabilities\n",
" # Use: https://numpy.org/doc/stable/reference/random/generated/numpy.random.choice.html\n",
" # Replace this line\n",
" next_token = [5000]\n",
Expand Down

0 comments on commit 06663df

Please sign in to comment.