[Bugfix] Catch errors when DeepSeek-V3.2 generates malformed JSON (#18174)
This commit is contained in:
@@ -158,9 +158,12 @@ class DeepSeekV32Detector(BaseFormatDetector):
|
|||||||
if partial_match.group(2) == "true":
|
if partial_match.group(2) == "true":
|
||||||
parameters[param_name] = param_value.strip()
|
parameters[param_name] = param_value.strip()
|
||||||
else:
|
else:
|
||||||
parameters[param_name] = _partial_json_loads(
|
try:
|
||||||
param_value, Allow.ALL
|
parameters[param_name] = _partial_json_loads(
|
||||||
)[0]
|
param_value, Allow.ALL
|
||||||
|
)[0]
|
||||||
|
except json.JSONDecodeError:
|
||||||
|
parameters[param_name] = param_value.strip()
|
||||||
|
|
||||||
return parameters
|
return parameters
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user