Use BLIP to send a picture to model

This commit is contained in:
SillyLossy 2023-02-15 01:38:21 +02:00
parent 79d3a524f2
commit a7d98f494a
4 changed files with 58 additions and 18 deletions

9
modules/bot_picture.py Normal file
View 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"])