Skip to content

Commit

Permalink
fix: update regex for think filter to handle edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaawwa committed Feb 25, 2025
1 parent f56a7d1 commit a0e6c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdf2zh/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def __init__(
self.prompttext = prompt
self.add_cache_impact_parameters("temperature", self.options["temperature"])
self.add_cache_impact_parameters("prompt", self.prompt("", self.prompttext))
think_filter_regex = r"^<think>.+?\n*(</think>|\n)+(</think>)\n*"
think_filter_regex = r"^<think>.+?\n*(</think>|\n)*(</think>)\n*"
self.add_cache_impact_parameters('think_filter_regex', think_filter_regex)
self.think_filter_regex = re.compile(think_filter_regex, flags=re.DOTALL)

Expand Down

0 comments on commit a0e6c28

Please sign in to comment.