class_docstr: CLIP is a recent model by OpenAI.
  
  Attributes:
      model_path: ViT-B/32, RN50, RN101, RN50x4
      init_model: initialise model from model_path
      init_tokenizer: initializes tokenizer
      name: string identifier for the model. Lowercase letters and numbers.
          No spaces/special characters except dashes.
      description: String description of the model.
      tasks: List of supported task strings
      details: Dictionary of additional details about the model
      device: Device for model. Defaults to "cuda" if available.
class_docstr_tok: ["CLIP","is","a","recent","model","by","OpenAI",".","Attributes",":","model_path",":","ViT-B\/32",",","RN50",",","RN101",",","RN50x4","init_model",":","initialise","model","from","model_path","init_tokenizer",":","initializes","tokenizer","name",":","string","identifier","for","the","model",".","Lowercase","letters","and","numbers",".","No","spaces\/special","characters","except","dashes",".","description",":","String","description","of","the","model",".","tasks",":","List","of","supported","task","strings","details",":","Dictionary","of","additional","details","about","the","model","device",":","Device","for","model",".","Defaults","to","``","cuda","''","if","available","."]
code: def __init__(
      self,
      model_path="ViT-B/32",
      init_model=clip.load,
      init_tokenizer=simple_tokenizer.SimpleTokenizer,
      name: str = None,
      description: str = None,
      tasks: List[str] = None,
      details: Dict = None,
      device=None,
  ):
      BaseModel.__init__(
          self,
          None,
          name=name,
          description=description,
          tasks=tasks,
          details=details,
      )
      self.init_model = init_model
      self.init_tokenizer = init_tokenizer
      self.model_path = model_path
      self._model_device = device
  
      if self._model_device is None:
          self._model_device = (
              "cuda" if torch.cuda.is_available() else "cpu"
          )
  
      # Initialise
      self.model, self.transform = self.init_model(
          model_path, device=self._model_device
      )
      tokenizer = self.init_tokenizer()
      self.tokenizer = partial(clip.tokenize, tokenizer)
      self.process_image = self.transform
      self.optimal_batch_size = 128
      # Can't specify max_length
      self.max_length = None
      self.pre_finetuning = self.model.float
  
imports: import torch
  import torch.nn.functional
  from torch.utils.data.sampler import Sampler
  import pytorch_lightning
  import numpy
  from PIL import Image
  from typing import Union, List, Dict
  from functools import partial
  from .None import clip, simple_tokenizer
  from backprop.models import BaseModel
  from backprop.utils import ImageTextGroupDataset, base64_to_img
  from backprop.utils.losses import TripletLoss
  from io import BytesIO
  import base64
  import random
  from torch.utils.data.dataloader import DataLoader
  import os
label_desc: Use image node_id 1 to create a new CLIP object from inherited base classes: BaseModel with example: obj = CLIP(model_path, init_model, init_tokenizer, name, description, tasks, details, device)