Use BLIP to send a picture to model
This commit is contained in:
parent
79d3a524f2
commit
a7d98f494a
4 changed files with 58 additions and 18 deletions
9
modules/bot_picture.py
Normal file
9
modules/bot_picture.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from nataili_blip.model_manager import BlipModelManager
|
||||
from nataili_blip.caption import Caption
|
||||
|
||||
def load_model():
|
||||
model_name = "BLIP"
|
||||
mm = BlipModelManager()
|
||||
mm.download_model(model_name)
|
||||
mm.load_blip(model_name)
|
||||
return Caption(mm.loaded_models[model_name]["model"], mm.loaded_models[model_name]["device"])
|
Loading…
Add table
Add a link
Reference in a new issue