-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1131 from JohnSnowLabs/feature/add-support-for-ch…
…at-and-instruct-model-types Feature/add support for chat and instruct model types
- Loading branch information
Showing
9 changed files
with
203 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This file contains the model classes that are used in the model handler. | ||
# from langchain | ||
|
||
CHAT_MODEL_CLASSES = { | ||
"anthropic": "ChatAnthropic", | ||
"anyscale": "ChatAnyscale", | ||
"azure_openai": "AzureChatOpenAI", | ||
"baichuan": "ChatBaichuan", | ||
"baidu_qianfan_endpoint": "QianfanChatEndpoint", | ||
"bedrock": "BedrockChat", | ||
"cohere": "ChatCohere", | ||
"databricks": "ChatDatabricks", | ||
"deepinfra": "ChatDeepInfra", | ||
"ernie": "ErnieBotChat", | ||
"everlyai": "ChatEverlyAI", | ||
"fake": "FakeListChatModel", | ||
"fireworks": "ChatFireworks", | ||
"gigachat": "GigaChat", | ||
"google_palm": "ChatGooglePalm", | ||
"gpt_router": "GPTRouter", | ||
"huggingface": "ChatHuggingFace", | ||
"human": "HumanInputChatModel", | ||
"hunyuan": "ChatHunyuan", | ||
"javelin_ai_gateway": "ChatJavelinAIGateway", | ||
"jinachat": "JinaChat", | ||
"kinetica": "ChatKinetica", | ||
"konko": "ChatKonko", | ||
"litellm": "ChatLiteLLM", | ||
"litellm_router": "ChatLiteLLMRouter", | ||
"llama_edge": "LlamaEdgeChatService", | ||
"maritalk": "ChatMaritalk", | ||
"minimax": "MiniMaxChat", | ||
"mlflow": "ChatMlflow", | ||
"mlflow_ai_gateway": "ChatMLflowAIGateway", | ||
"ollama": "ChatOllama", | ||
"openai": "ChatOpenAI", | ||
"pai_eas_endpoint": "PaiEasChatEndpoint", | ||
"perplexity": "ChatPerplexity", | ||
"promptlayer_openai": "PromptLayerChatOpenAI", | ||
"sparkllm": "ChatSparkLLM", | ||
"tongyi": "ChatTongyi", | ||
"vertexai": "ChatVertexAI", | ||
"volcengine_maas": "VolcEngineMaasChat", | ||
"yandex": "ChatYandexGPT", | ||
"yuan2": "ChatYuan2", | ||
"zhipuai": "ChatZhipuAI", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from typing import Literal, TypedDict, Union, List | ||
|
||
|
||
class ModelConfig(TypedDict): | ||
""" | ||
ModelConfig is a TypedDict that defines the configuration for a model. | ||
Attributes: | ||
model (str): The name of the model. | ||
type (Literal['chat', 'completion']): The type of the model, either 'chat' or 'completion'. | ||
hub (str): The hub where the model is located. | ||
""" | ||
|
||
model: str | ||
type: Literal["chat", "completion"] | ||
hub: str | ||
|
||
|
||
class DatasetConfig(TypedDict): | ||
""" | ||
DatasetConfig is a TypedDict that defines the configuration for a dataset. | ||
Attributes: | ||
data_source (str): The source of the data, e.g., a file path. | ||
split (str): The data split, e.g., 'train', 'test', or 'validation'. | ||
subset (str): A specific subset of the data, if applicable. | ||
feature_column (Union[str, List[str]]): The column(s) representing the features in the dataset. | ||
target_column (Union[str, List[str]]): The column(s) representing the target variable(s) in the dataset. | ||
source (str): The original source of the dataset ex: huggingface. | ||
""" | ||
|
||
data_source: str | ||
split: str | ||
subset: str | ||
feature_column: Union[str, List[str]] | ||
target_column: Union[str, List[str]] | ||
source: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.