Validator works for start
This commit is contained in:
@@ -29,8 +29,6 @@ class QwQLlmEngine(LlmEngine):
|
||||
"""
|
||||
self._temperature = temperature
|
||||
self._token_limit = token_limit
|
||||
if xml_schema_text:
|
||||
self._logits_processor = XmlLogitsProcessor(self._tokenizer, xml_schema_text)
|
||||
|
||||
with open('/root/sia/qwq_tokenizer_config.json', 'r') as f:
|
||||
tokenizer_config = json.load(f)
|
||||
@@ -62,6 +60,11 @@ class QwQLlmEngine(LlmEngine):
|
||||
return_full_text=False,
|
||||
)
|
||||
|
||||
if xml_schema_text:
|
||||
self._logits_processor = XmlLogitsProcessor(self._tokenizer, xml_schema_text)
|
||||
else:
|
||||
self._logits_processor = None
|
||||
|
||||
|
||||
def infer(self, system_prompt: str, main_context: str, should_stop: Callable[[], bool] = lambda: False) -> Iterator[str]:
|
||||
"""
|
||||
@@ -100,7 +103,7 @@ class QwQLlmEngine(LlmEngine):
|
||||
}
|
||||
|
||||
if self._logits_processor:
|
||||
generation_kwargs["logits_processor"] = self.logits_processor
|
||||
generation_kwargs["logits_processor"] = [self._logits_processor]
|
||||
|
||||
generation_thread = Thread(
|
||||
target=self._pipline,
|
||||
|
||||
Reference in New Issue
Block a user