Update processing_qwen2_ts.py
Browse files- processing_qwen2_ts.py +6 -2
processing_qwen2_ts.py
CHANGED
|
@@ -58,12 +58,16 @@ class Qwen2TSProcessor(ProcessorMixin):
|
|
| 58 |
feature_extractor_class = None # You can add a feature extractor if needed
|
| 59 |
tokenizer_class = "AutoTokenizer"
|
| 60 |
|
| 61 |
-
def __init__(self, tokenizer=None, **kwargs):
|
| 62 |
"""
|
| 63 |
Args:
|
| 64 |
tokenizer: An optional tokenizer to process text prompts.
|
| 65 |
"""
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
def __call__(
|
| 69 |
self,
|
|
|
|
| 58 |
feature_extractor_class = None # You can add a feature extractor if needed
|
| 59 |
tokenizer_class = "AutoTokenizer"
|
| 60 |
|
| 61 |
+
def __init__(self, tokenizer=None, chat_template=None, **kwargs):
|
| 62 |
"""
|
| 63 |
Args:
|
| 64 |
tokenizer: An optional tokenizer to process text prompts.
|
| 65 |
"""
|
| 66 |
+
if chat_template is None and tokenizer is not None and tokenizer.chat_template is not None:
|
| 67 |
+
chat_template = tokenizer.chat_template
|
| 68 |
+
self.chat_template = chat_template
|
| 69 |
+
|
| 70 |
+
super().__init__(tokenizer=tokenizer, chat_template=chat_template, **kwargs)
|
| 71 |
|
| 72 |
def __call__(
|
| 73 |
self,
|