Use BLIP to send a picture to model
This commit is contained in:
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"])
|
||||
@@ -217,6 +217,12 @@ def generate_chat_html(history, name1, name2, character):
|
||||
|
||||
.body {
|
||||
}
|
||||
|
||||
.body img {
|
||||
max-width: 300px;
|
||||
max-height: 300px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
"""
|
||||
|
||||
output = ''
|
||||
|
||||
Reference in New Issue
Block a user