Currently, you must clone the HELM repostory and modify the HELM code locally to add a new model.
- Pick a new organization name that does not conflict with any of the organizations for the existing models.
- Define a new
Model
describing your model and add it toALL_MODELS
inhelm.proxy.models
. SetModel.group
andModel.creator_organization
to your organization name. SetModel.name
to"your_organization_name/your_model_name"
. - Implement a new
Client
. TheClient
is responsible for implementing the core logic of your model, and responding to requests. In particular, it needs to implement three methods,Client.make_request()
,Client.tokenize()
andClient.decode()
. Note that despite the nameClient
, it is possible forClient
to run model inference locally. Refer toSimpleClient
for an example implementation. - Modify both
AutoClient.get_client()
andAutoClient.get_tokenizer_client()
to return your implementation ofClient
for your organization name. - Implement a
WindowService
. You will usually want to make your implementation a subclass ofLocalWindowService
, which will reuse theClient.tokenize()
andClient.decode()
methods that you implemented earlier. The subclass should implement the methodLocalWindowService.tokenizer_name()
to return"your_organization_name/your_model_name"
. The subclass ofLocalWindowService
will also need to implement the methodsLocalWindowService.max_sequence_length()
,LocalWindowService.max_sequence_length()
,LocalWindowService.end_of_text_token()
,LocalWindowService.prefix_token()
andLocalWindowService.tokenizer_name()
. Refer toGPT2WindowService
for an example implementation. - Modify
WindowServiceFactory.get_window_service()
to construct and return your implementation ofWindowService
for your organization name. - Add an entry to
schema.yaml
describing your model. - Update
contamination.yaml
to indicate if the training set of your model has been contaminated by data from any scenarios.