feat-routing
#26
by
makram93
- opened
In this PR, we try to infer the task type from the input directly. If the task type is specified then use that else try to infer from the input. If the prompt can be inferred from the input then the respective lora adapter is set else, no lora adapter is used. Embedding returned in that case will be from the backend model.
Changes:
- parameter name changed to
task_type
based on the usage on the API side - tokenizer moved from
encode()
to init inXLMRobertaModel
class - Remove
__no_lora_update__
and set default value as None - Use only one input to infer the prompt and set the adapter.
- Adapt both encode and forward function of
XLMRobertaLoRA
class
LGTM
makram93
changed pull request status to
open
Might be a good idea to set prompts to the default values in the configuration_xlm_roberta.py if no prompts are provided, otherwise we'll have to copy the dict everytime
By not setting it to default we enforce that the LoRA config should always have prompts param, same as the lora_adaptations param. I feel this will be needed when we move out the instructions adding part from the training script directly here
jupyterjazz
changed pull request status to
merged