Skip to content

Commit

Permalink
feat(multimodal): fixes to initialize the adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
massi-ang authored and bigadsoleiman committed Mar 7, 2024
1 parent 0be52ea commit 33b3931
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from langchain.chat_models import ChatOpenAI
from ..base import ModelAdapter
from ..registry import registry
from genai_core.registry import registry


class GPTAdapter(ModelAdapter):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from langchain.prompts.prompt import PromptTemplate

from ...base import ModelAdapter
from ...registry import registry
from genai_core.registry import registry


class FalconLiteContentHandler(LLMContentHandler):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from langchain.llms.sagemaker_endpoint import LLMContentHandler, SagemakerEndpoint

from ...base import ModelAdapter
from ...registry import registry
from genai_core.registry import registry

from ...shared.meta.llama2_chat import (
Llama2ChatPromptTemplate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from langchain.prompts.prompt import PromptTemplate

from ...base import ModelAdapter
from ...registry import registry
from genai_core.registry import registry


class MistralInstructContentHandler(LLMContentHandler):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from langchain.prompts.prompt import PromptTemplate

from ...base import ModelAdapter
from ...registry import registry
from genai_core.registry import registry


class MixtralInstructContentHandler(LLMContentHandler):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from aws_lambda_powertools.utilities.data_classes.sqs_event import SQSRecord
from aws_lambda_powertools.utilities.typing import LambdaContext

import adapters
from genai_core.utils.websocket import send_to_client
from genai_core.types import ChatbotAction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ export default function ChatInputPanel(props: ChatInputPanelProps) {
const value = state.value.trim();
const request: ChatBotRunRequest = {
action: ChatBotAction.Run,
modelInterface: props.configuration.files
? "multimodal"
: (state.selectedModelMetadata!.interface as ModelInterface),
modelInterface:
props.configuration.files && props.configuration.files.length > 0
? "multimodal"
: (state.selectedModelMetadata!.interface as ModelInterface),
data: {
mode: ChatBotMode.Chain,
text: value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Container,
ExpandableSection,
Popover,
SpaceBetween,
Spinner,
StatusIndicator,
Tabs,
Expand Down

0 comments on commit 33b3931

Please sign in to comment.