Generalize multimodality (llava/minigpt4 7b and 13b now supported) (#1741)
This commit is contained in:
parent
a2b25322f0
commit
e9e75a9ec7
22 changed files with 812 additions and 371 deletions
|
@ -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.'
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue