Update custom model files, README, and requirements
Browse files- 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
|
| 752 |
streamer = TextIteratorStreamer(
|
| 753 |
self.tokenizer,
|
| 754 |
skip_prompt=True,
|
| 755 |
-
skip_special_tokens=
|
| 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
|