Skip to content

Commit

Permalink
Add support for together
Browse files Browse the repository at this point in the history
  • Loading branch information
danielz02 committed Oct 9, 2023
1 parent 79209fe commit bf72ad1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/helm/proxy/clients/together_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
DecodeRequestResult,
)
from .client import Client, wrap_request_time, truncate_sequence, cleanup_str

from helm.proxy.models import Model, TEXT_MODEL_TAG, MODEL_NAME_TO_MODEL, ALL_MODELS
from helm.common.hierarchical_logger import hlog

_ASYNC_MODELS: Set[str] = {
# Legacy models
Expand Down Expand Up @@ -299,3 +300,15 @@ def tokenize(self, request: TokenizationRequest) -> TokenizationRequestResult:

def decode(self, request: DecodeRequest) -> DecodeRequestResult:
raise NotImplementedError("Use the HuggingFaceClient to decode.")


def register_custom_together_model(model_id):
model = Model(
group="together",
name=model_id,
tags=[TEXT_MODEL_TAG],
)
MODEL_ALIASES[model_id] = model_id
MODEL_NAME_TO_MODEL[model_id] = model
ALL_MODELS.append(model)
hlog(f"Registered Together model: {model}")

0 comments on commit bf72ad1

Please sign in to comment.