mirror of https://github.com/arc53/DocsGPT
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
603 B
Python
20 lines
603 B
Python
1 year ago
|
from application.llm.openai import OpenAILLM, AzureOpenAILLM
|
||
|
from application.llm.sagemaker import SagemakerAPILLM
|
||
|
from application.llm.huggingface import HuggingFaceLLM
|
||
|
|
||
|
|
||
|
|
||
|
class LLMCreator:
|
||
|
llms = {
|
||
|
'openai': OpenAILLM,
|
||
|
'azure_openai': AzureOpenAILLM,
|
||
|
'sagemaker': SagemakerAPILLM,
|
||
|
'huggingface': HuggingFaceLLM
|
||
|
}
|
||
|
|
||
|
@classmethod
|
||
|
def create_llm(cls, type, *args, **kwargs):
|
||
|
llm_class = cls.llms.get(type.lower())
|
||
|
if not llm_class:
|
||
|
raise ValueError(f"No LLM class found for type {type}")
|
||
|
return llm_class(*args, **kwargs)
|