TheTrueJard commited on
Commit
f500667
·
verified ·
1 Parent(s): d28d295

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. plpq.py +7 -6
plpq.py CHANGED
@@ -83,9 +83,9 @@ class PLPQ(PreTrainedModel):
83
  """
84
  Quantize the input tensor
85
  Parameters:
86
- x (Image or torch.Tensor): The input tensor. Size b, c, h, w
87
  Returns:
88
- torch.Tensor: The indices tensor. Size b, h, w
89
  """
90
  z = self.encoder(x).permute(0, 2, 3, 1).contiguous()
91
  b, h, w, c = z.shape
@@ -97,10 +97,11 @@ class PLPQ(PreTrainedModel):
97
  @torch.no_grad()
98
  def decode(self, indices: torch.Tensor) -> torch.Tensor:
99
  """
100
- Parameters:
101
- indices: torch.Tensor of shape (b, t, n_freq_bins)
102
- Returns:
103
- emb: torch.Tensor of shape (b, t, n_embd)
 
104
  """
105
 
106
  ncodes = indices.shape[-1]
 
83
  """
84
  Quantize the input tensor
85
  Parameters:
86
+ x (torch.Tensor): The input tensor of shape (b, c, h, w)
87
  Returns:
88
+ torch.Tensor: The indices tensor of shape (b, t, n_quantizers)
89
  """
90
  z = self.encoder(x).permute(0, 2, 3, 1).contiguous()
91
  b, h, w, c = z.shape
 
97
  @torch.no_grad()
98
  def decode(self, indices: torch.Tensor) -> torch.Tensor:
99
  """
100
+ Decode a tensor, inverse of self.quantize
101
+ Parameters:
102
+ indices (torch.Tensor): The input codes of shape (b, t, n_quantizers)
103
+ Returns:
104
+ torch.Tensor: The decoded tensor of shape (b, c, h, w)
105
  """
106
 
107
  ncodes = indices.shape[-1]