mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-26 16:57:23 +01:00
e.msg may also be 'Unterminated string starting at' or other values
This commit is contained in:
@@ -158,10 +158,9 @@ def retry_on_exception(func):
|
||||
# If the specific error "context_length_exceeded" is present, simply return without retry
|
||||
if isinstance(e, json.JSONDecodeError):
|
||||
# codellama-34b-instruct seems to send incomplete JSON responses
|
||||
if e.msg == 'Expecting value':
|
||||
logger.info('Received incomplete JSON response from LLM. Asking for the rest...')
|
||||
args[0]['function_buffer'] = e.doc
|
||||
continue
|
||||
logger.info('Received incomplete JSON response from LLM. Asking for the rest...')
|
||||
args[0]['function_buffer'] = e.doc
|
||||
continue
|
||||
elif isinstance(e, ValidationError):
|
||||
function_error_count = 1 if 'function_error' not in args[0] else args[0]['function_error_count'] + 1
|
||||
args[0]['function_error_count'] = function_error_count
|
||||
|
||||
Reference in New Issue
Block a user