mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
API: Transform multimodal into an actual class
Migrate the add method into the class itself. Also, a BaseModel isn't needed here since this isn't a serialized class. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -10,7 +10,7 @@ from jinja2 import TemplateError
|
||||
from loguru import logger
|
||||
|
||||
from common import model
|
||||
from common.multimodal import MultimodalEmbeddingWrapper, add_image_embedding
|
||||
from common.multimodal import MultimodalEmbeddingWrapper
|
||||
from common.networking import (
|
||||
get_generator_error,
|
||||
handle_request_disconnect,
|
||||
@@ -483,9 +483,7 @@ async def preprocess_vision_request(messages: List[ChatCompletionMessage]):
|
||||
if content.type == "text":
|
||||
concatenated_content += content.text
|
||||
elif content.type == "image_url":
|
||||
embeddings = await add_image_embedding(
|
||||
embeddings, content.image_url.url
|
||||
)
|
||||
await embeddings.add(content.image_url.url)
|
||||
concatenated_content += embeddings.text_alias[-1]
|
||||
|
||||
message.content = concatenated_content
|
||||
|
||||
Reference in New Issue
Block a user