Created using Colaboratory

This commit is contained in:
udlbook
2022-12-13 10:53:54 +00:00
parent b3a5d9debc
commit 06663df82a

View File

@@ -4,7 +4,7 @@
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyPLuYbU3a6Uvb/3X1shd1XV",
"authorship_tag": "ABX9TyMfWL40+ZshPZhweAtQ9Fn6",
"include_colab_link": true
},
"kernelspec": {
@@ -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",