|
Mila
Deep Neural Network Library
|
Architecture identity for top-level model networks. More...
#include <string>#include <string_view>#include <cctype>Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Enumerations | |
| enum class | Mila::Dnn::ModelType : int { Unknown = 0 , Gpt2 , Llama , Gemma , Mistral , Bert } |
| Canonical list of framework-known model architectures. More... | |
Functions | |
| ModelType | Mila::Dnn::modelTypeFromString (std::string_view s) noexcept |
| Parse a case-insensitive architecture name into a ModelType. | |
| std::string | Mila::Dnn::toString (ModelType t) noexcept |
| Convert a ModelType to its canonical architecture name. | |
Architecture identity for top-level model networks.
ModelType names the model family (GPT-2, LLaMA, Gemma, ...). It is a distinct axis from ComponentType, which names the structural kind of a component (Linear, Transformer block, Network). A LlamaTransformer and a GemmaTransformer are both ComponentType::Network; they differ by ModelType. Keeping the two axes separate is why the per-architecture values were removed from ComponentType.
|
exportstrong |
|
inlineexportnoexcept |
Parse a case-insensitive architecture name into a ModelType.
Named distinctly from the ComponentType parser: overloading on return type alone is not possible, and both parsers take a string_view. Returns ModelType::Unknown for unrecognized input.
|
inlineexportnoexcept |
Convert a ModelType to its canonical architecture name.
Overloads (does not collide with) the ComponentType toString: the argument type disambiguates. Returns "Unknown" for unrecognized values.