speechisalluneed commited on
Commit
4a3590c
·
verified ·
1 Parent(s): f498019

Update modeling_fastslm.py

Browse files
Files changed (1) hide show
  1. modeling_fastslm.py +3 -1
modeling_fastslm.py CHANGED
@@ -289,7 +289,7 @@ class SpeechEncoder(nn.Module):
289
  class FastSLMPreTrainedModel(PreTrainedModel):
290
  config_class = FastSLMConfig
291
  base_model_prefix = "fastslm"
292
-
293
  def _init_weights(self, module):
294
  if isinstance(module, nn.Linear):
295
  nn.init.normal_(module.weight, std=0.02)
@@ -326,6 +326,8 @@ class FastSLMForConditionalGeneration(FastSLMPreTrainedModel, GenerationMixin):
326
  language_token = [f"<|{lang.upper()}|>" for lang in LANGUAGES]
327
  special_tokens = audio_token + language_token + task_token
328
  self.tokenizer.add_special_tokens({"additional_special_tokens": special_tokens})
 
 
329
 
330
  def get_input_embeddings(self) -> nn.Module:
331
  """Returns the input embedding layer of the LLM."""
 
289
  class FastSLMPreTrainedModel(PreTrainedModel):
290
  config_class = FastSLMConfig
291
  base_model_prefix = "fastslm"
292
+ self.post_init()
293
  def _init_weights(self, module):
294
  if isinstance(module, nn.Linear):
295
  nn.init.normal_(module.weight, std=0.02)
 
326
  language_token = [f"<|{lang.upper()}|>" for lang in LANGUAGES]
327
  special_tokens = audio_token + language_token + task_token
328
  self.tokenizer.add_special_tokens({"additional_special_tokens": special_tokens})
329
+
330
+ self.post_init()
331
 
332
  def get_input_embeddings(self) -> nn.Module:
333
  """Returns the input embedding layer of the LLM."""