Skip to content

Commit

Permalink
Add model_name attribute to model classes
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka committed Jan 8, 2025
1 parent 3cc399d commit 3bd9e50
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions outlines/models/exllamav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def decode(self, token_ids: "torch.LongTensor") -> List[str]:
class ExLlamaV2Model:
"""Represents a `exl2` model."""

model_name = "ExLlamaV2"

def __init__(
self,
generator: "ExLlamaV2DynamicGenerator",
Expand Down
2 changes: 2 additions & 0 deletions outlines/models/llamacpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class LlamaCpp:
"""

model_name = "LlamaCpp"

def __init__(self, model: "Llama"):
self.model = model

Expand Down
2 changes: 2 additions & 0 deletions outlines/models/mlxlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class MLXLM:
Represents an `mlx_lm` model
"""

model_name = "MLXLM"

def __init__(
self,
model: "nn.Module",
Expand Down
2 changes: 2 additions & 0 deletions outlines/models/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def __setstate__(self, state):
class Transformers:
"""Represents a `transformers` model."""

model_name = "Transformers"

def __init__(
self,
model: "PreTrainedModel",
Expand Down
2 changes: 2 additions & 0 deletions outlines/models/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class VLLM:
"""

model_name = "VLLM"

def __init__(self, model: "LLM"):
self.model = model
self.lora_request = None
Expand Down

0 comments on commit 3bd9e50

Please sign in to comment.