Generalize multimodality (llava/minigpt4 7b and 13b now supported) (#1741)

This commit is contained in:
Wojtab 2023-05-10 01:18:02 +02:00 committed by GitHub
parent a2b25322f0
commit e9e75a9ec7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 812 additions and 371 deletions

View file

@ -48,7 +48,7 @@ from modules import chat, shared, training, ui, utils
from modules.html_generator import chat_html_wrapper
from modules.LoRA import add_lora_to_model
from modules.models import load_model, load_soft_prompt, unload_model
from modules.text_generation import encode, generate_reply, stop_everything_event
from modules.text_generation import generate_reply, get_encoded_length, stop_everything_event
def load_model_wrapper(selected_model, autoload=False):
@ -140,7 +140,7 @@ def load_prompt(fname):
def count_tokens(text):
tokens = len(encode(text)[0])
tokens = get_encoded_length(text)
return f'{tokens} tokens in the input.'