text-generation-webui/modules/bot_picture.py

9 lines
328 B
Python
Raw Normal View History

2023-02-15 00:38:21 +01:00
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"])