add backend name to error messages

This commit is contained in:
Cyberes 2023-08-22 21:14:12 -06:00
parent a525093c75
commit 06ae8adf0d
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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