mirror of
https://github.com/salesforce/BLIP.git
synced 2026-01-26 15:19:44 +00:00
update demo
This commit is contained in:
@@ -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])"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user