mazesmazes commited on
Commit
45f7226
·
verified ·
1 Parent(s): d9e53e1

Update custom model files, README, and requirements

Browse files
Files changed (1) hide show
  1. asr_modeling.py +2 -5
asr_modeling.py CHANGED
@@ -630,9 +630,6 @@ class ASRModel(PreTrainedModel):
630
  raise ValueError("input_values or input_features must be provided for generation")
631
 
632
  # Debug: Check audio inputs
633
- import sys
634
- print(f"DEBUG generate (non-streaming): audio_inputs shape={audio_inputs.shape if audio_inputs is not None else None}", file=sys.stderr)
635
- print(f"DEBUG generate (non-streaming): audio_inputs type={type(audio_inputs)}", file=sys.stderr)
636
 
637
  audio_embeds = self._encode_audio(audio_inputs)
638
  batch_size = audio_embeds.shape[0]
@@ -748,11 +745,11 @@ class ASRModel(PreTrainedModel):
748
  """
749
  Stream generation by using the working generate() method with a TextIteratorStreamer.
750
  """
751
- # Set up the streamer - don't skip special tokens as it might affect audio token processing
752
  streamer = TextIteratorStreamer(
753
  self.tokenizer,
754
  skip_prompt=True,
755
- skip_special_tokens=False # Changed from True - audio token is special
756
  )
757
 
758
  # Count prompt length for stats
 
630
  raise ValueError("input_values or input_features must be provided for generation")
631
 
632
  # Debug: Check audio inputs
 
 
 
633
 
634
  audio_embeds = self._encode_audio(audio_inputs)
635
  batch_size = audio_embeds.shape[0]
 
745
  """
746
  Stream generation by using the working generate() method with a TextIteratorStreamer.
747
  """
748
+ # Set up the streamer
749
  streamer = TextIteratorStreamer(
750
  self.tokenizer,
751
  skip_prompt=True,
752
+ skip_special_tokens=True # Back to True - special tokens shouldn't be in output text
753
  )
754
 
755
  # Count prompt length for stats