-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df1ca03
commit d042167
Showing
27 changed files
with
2,959 additions
and
347 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
File renamed without changes.
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,17 @@ | ||
from langchain import chat_models | ||
from pathlib import Path | ||
import yaml | ||
|
||
def get_model_instance(): | ||
config = load_models_config() | ||
llm_spec = getattr(chat_models, config["llm_model_config"]["model_source"]) | ||
all_config_field = {**config["llm_model_config"], **config["llm_provider_config"]} | ||
kwargs = {key: value for key, value in all_config_field.items() if key in llm_spec.__fields__.keys()} | ||
return llm_spec(**kwargs) | ||
|
||
|
||
def load_models_config(): | ||
with open(Path(__file__).parent / "models_config.yaml", "r") as file: | ||
return yaml.safe_load(file) | ||
|
||
|
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
File renamed without changes.
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,21 @@ | ||
llm_provider_config: | ||
openai_api_type: azure | ||
openai_api_base: https://poc-genai-gpt4.openai.azure.com/ | ||
openai_api_version: 2023-07-01-preview | ||
openai_api_key: | ||
|
||
llm_model_config: | ||
model_source: AzureChatOpenAI | ||
deployment_name: gpt4v | ||
temperature: 0.1 | ||
streaming: true | ||
verbose: true | ||
|
||
embedding_provider_config: | ||
openai_api_base: "https://poc-openai-artefact.openai.azure.com/" | ||
openai_api_key: | ||
|
||
embedding_model_config: | ||
model_source: OpenAIEmbeddings | ||
deployment: text-embedding-ada-002 | ||
chunk_size: 16 |
File renamed without changes.
Empty file.
Binary file not shown.
Oops, something went wrong.