add backend name to error messages
This commit is contained in:
parent
a525093c75
commit
06ae8adf0d
|
@ -1,4 +1,4 @@
|
|||
# Global settings that never change after startup
|
||||
# Global settings that never change after startup/init
|
||||
|
||||
running_model = 'none'
|
||||
concurrent_gens = 3
|
||||
|
|
|
@ -42,7 +42,7 @@ def generate():
|
|||
success, response, error_msg = generator(request_json_body)
|
||||
if not success:
|
||||
if opts.mode == 'oobabooga':
|
||||
backend_response = format_sillytavern_err(f'Failed to reach the backend: {error_msg}', 'error')
|
||||
backend_response = format_sillytavern_err(f'Failed to reach the backend ({opts.mode}): {error_msg}', 'error')
|
||||
response_json_body = {
|
||||
'results': [
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ def generate():
|
|||
backend_response = safe_list_get(response_json_body.get('results', []), 0, {}).get('text')
|
||||
if not backend_response:
|
||||
if opts.mode == 'oobabooga':
|
||||
backend_response = format_sillytavern_err(f'Backend returned an empty string. This can happen when your parameters are incorrect. Make sure your context size is no greater than {opts.context_size}.', 'error')
|
||||
backend_response = format_sillytavern_err(f'Backend ({opts.mode}) returned an empty string. This can happen when your parameters are incorrect. Make sure your context size is no greater than {opts.context_size}.', 'error')
|
||||
response_json_body['results'][0]['text'] = backend_response
|
||||
else:
|
||||
raise Exception
|
||||
|
|
Reference in New Issue