class_docstr: Class for models which are initialised from Sentence Transformers
  
  Attributes:
      model_path: path to ST model
      name: string identifier for the model. Lowercase letters and numbers.
          No spaces/special characters except dashes.
      max_length: Max supported token length for vectorisation
      description: String description of the model.
      tasks: List of supported task strings
      details: Dictionary of additional details about the model
      init_model: Class used to initialise model
      device: Device for model. Defaults to "cuda" if available.
class_docstr_tok: ["Class","for","models","which","are","initialised","from","Sentence","Transformers","Attributes",":","model_path",":","path","to","ST","model","name",":","string","identifier","for","the","model",".","Lowercase","letters","and","numbers",".","No","spaces\/special","characters","except","dashes",".","max_length",":","Max","supported","token","length","for","vectorisation","description",":","String","description","of","the","model",".","tasks",":","List","of","supported","task","strings","details",":","Dictionary","of","additional","details","about","the","model","init_model",":","Class","used","to","initialise","model","device",":","Device","for","model",".","Defaults","to","``","cuda","''","if","available","."]
docstr: Uses the model for the text-vectorisation task
  
  Args:
      task_input: input dictionary according to the ``text-vectorisation`` task specification
      task: text-vectorisation
docstr_tok: ["Uses","the","model","for","the","text-vectorisation","task","Args",":","task_input",":","input","dictionary","according","to","the","``","text-vectorisation","``","task","specification","task",":","text-vectorisation"]
code: def __call__(
      self, task_input, task="text-vectorisation", return_tensor=False
  ):
      """
      Uses the model for the text-vectorisation task
  
      Args:
          task_input: input dictionary according to the ``text-vectorisation`` task specification
          task: text-vectorisation
      """
      is_list = False
      if task == "text-vectorisation":
          input_ids = None
          attention_mask = None
  
          text = task_input.get("text")
  
          if type(text) == list:
              is_list = True
          else:
              text = [text]
  
          features = self.model.tokenizer(
              text, truncation=True, padding=True, return_tensors="pt"
          ).to(self._model_device)
  
          text_vecs = self.vectorise(features)
  
          if not return_tensor:
              text_vecs = text_vecs.tolist()
  
          output = text_vecs
  
          if not is_list:
              output = output[0]
  
          return output
      else:
          raise ValueError(f"Unsupported task '{task}'")
  
file_path: backprop/backprop/models/st_model/model.py
imports: from typing import Dict, List
  import torch
  from functools import partial
  from backprop.models import PathModel
  from torch.optim.adamw import AdamW
  from sentence_transformers import SentenceTransformer
label_desc: Use image node_id 3 for calling the STModel obj's underlying member method code with example usage: obj.__call__(task_input, task, return_tensor) and returns: output