Skip to content

Add model_name attribute to model classes #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading