update demo

This commit is contained in:
root
2022-02-11 07:55:17 +00:00
parent a3a2577a20
commit ad5eec314c

View File

@@ -106,7 +106,10 @@
"model = model.to(device)\n",
"\n",
"with torch.no_grad():\n",
" caption = model.generate(image, sample=False, num_beams=3, max_length=20, min_length=5)\n",
" # beam search\n",
" caption = model.generate(image, sample=False, num_beams=3, max_length=20, min_length=5) \n",
" # nucleus sampling\n",
" # caption = model.generate(image, sample=True, top_p=0.9, max_length=20, min_length=5) \n",
" print('caption: '+caption[0])"
]
},