model info timeout and additional info

This commit is contained in:
Cyberes 2023-08-23 16:07:43 -06:00
parent 1f5e2da637
commit 508089ce11
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ from llm_server import opts
def get_running_model():
if opts.mode == 'oobabooga':
try:
backend_response = requests.get(f'{opts.backend_url}/api/v1/model')
backend_response = requests.get(f'{opts.backend_url}/api/v1/model', timeout=3)
except Exception as e:
return False, e
try:

View File

@ -25,10 +25,10 @@ def get_model():
model, error = get_running_model()
if not model:
return jsonify({
'code': 500,
'code': 502,
'error': 'failed to reach backend',
'msg': error
}), 500
'type': error.__class__.__name__
}), 502
else:
return jsonify({
'result': model,