code: def get_compression_rate(
      dense_model, units, wave, vocab_size, sample_rate
  ):
      import numpy as np
  
      assert units.ndim == 1
      assert wave.ndim == 1
  
      time_in_seconds = wave.numel() / sample_rate
  
      uniform_token_entropy = np.log2(vocab_size)
      # calculated on LL-6k train
      unigram_token_entropy = {
          "hubert-base-ls960": {
              50: 5.458528917634601,
              100: 6.44513268276806,
              200: 7.477069233162813,
          },
          "cpc-big-ll6k": {
              50: 5.428271158461133,
              100: 6.413083187885448,
              200: 7.44253841579776,
          },
      }[dense_model][vocab_size]
  
      uniform_bps = (
          uniform_token_entropy * units.size(0) / time_in_seconds
      )
      unigram_entropy = (
          unigram_token_entropy * units.size(0) / time_in_seconds
      )
  
      return uniform_bps, unigram_entropy
  
imports: import torchaudio
  from textless import dispatch_dense_model, dispatch_quantizer
  from textless.data.speech_encoder import SpeechEncoder
  from textless.vocoders.tacotron2.vocoder import TacotronVocoder
label_desc: Use image node_id 2 for calling a global function with example usage: get_compression_rate(dense_model, units, wave, vocab_size, sample_rate) and returns: uniform_bps,  unigram_entropy