Open ocss884 opened 10 months ago
I think it is a very good solution. Just a little bit uncomfortable to use ModelType.value
to represent "model name" for OpenAI models, while using it to represent "model path" for hugging faces model. Do you think we can add an attribute or something?
Required prerequisites
Motivation
As we're going to support more models, I'd like to discuss the further implementation of
ModelType
here.In the current version, specific models are attributes of enum class
ModelType
. It is not a problem for closed-source models. For open source models, like LLama2, instead of using the whole model name, users need to useModelType.LLAMA_2
and then choose the model path that specifies which llama-2 model they are going to use. For example:https://github.com/camel-ai/camel/blob/98c1fbe90af343ad074bc6ee79b00f582ab3abbf/examples/open_source_models/role_playing_with_open_source_model.py#L94-L98
Considering open-source models are usually available on huggingface model hub and the convenience for the community, how about aligning our api design for open-source models to huggingface style and hiding the manual path selection to users as it can be handled by hf functions.
Solution
For each specific model, create the corresponding huggingface model value in the enum class. e.g.
In addition, we can also support hf style string of model names at the same time, as many other projects just keep using it (like vllm, OpenLLM). e.g.
Alternatives
No response
Additional context
No response