We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e07c90 commit 4090400Copy full SHA for 4090400
1 file changed
koboldcpp.py
@@ -3346,10 +3346,11 @@ def parse_minimax(text: str) -> str:
3346
def parse_gemma4(text: str) -> str:
3347
if text.startswith("call:"):
3348
text = text[len("call:"):]
3349
- text = text.replace('<|"|>', '!$$REAL_QUOTE$$!')
3350
- text = text.replace('\\', '\\\\')
3351
- text = text.replace('"', '\\"')
3352
- text = text.replace('!$$REAL_QUOTE$$!','"')
+ if '<|"|>' in text:
+ text = text.replace('<|"|>', '!$$REAL_QUOTE$$!')
+ text = text.replace('\\', '\\\\')
+ text = text.replace('"', '\\"')
3353
+ text = text.replace('!$$REAL_QUOTE$$!','"')
3354
fn_match = re.match(r'^([a-zA-Z_][a-zA-Z0-9_]*)\{(.*)\}$', text.strip(), re.DOTALL) # extract fn name
3355
if not fn_match:
3356
return text
0 commit comments