mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-05-01 04:50:01 +00:00
mm
This commit is contained in:
parent
a9ac4a6dc8
commit
8734b1803c
1 changed files with 0 additions and 33 deletions
|
|
@ -51,39 +51,6 @@ MODEL_CLASS_MAP = {
|
|||
}
|
||||
|
||||
|
||||
# def get_model(model_id, **kwargs):
|
||||
# """
|
||||
# Get a model instance based on model_id and type.
|
||||
|
||||
# Args:
|
||||
# model_id: The ID of the model to retrieve
|
||||
# **kwargs: Additional arguments to pass to the model constructor
|
||||
# """
|
||||
# assert model_id, "Model ID cannot be empty"
|
||||
# model: Model = Model.get(model_id)
|
||||
|
||||
# if not model:
|
||||
# raise ValueError(f"Model with ID {model_id} not found")
|
||||
|
||||
# if not model.type or model.type not in MODEL_CLASS_MAP:
|
||||
# raise ValueError(f"Invalid model type: {model.type}")
|
||||
|
||||
# provider_map = MODEL_CLASS_MAP[model.type]
|
||||
# if model.provider not in provider_map:
|
||||
# raise ValueError(
|
||||
# f"Provider {model.provider} not compatible with {model.type} models"
|
||||
# )
|
||||
|
||||
# model_class = provider_map[model.provider]
|
||||
# model_instance = model_class(model_name=model.name, **kwargs)
|
||||
|
||||
# # Special handling for language models that need langchain conversion
|
||||
# if model.type == "language":
|
||||
# return model_instance.to_langchain()
|
||||
|
||||
# return model_instance
|
||||
|
||||
|
||||
class ModelManager:
|
||||
_instance = None
|
||||
_model_cache: Dict[str, object] = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue