model info timeout and additional info
This commit is contained in:
parent
1f5e2da637
commit
508089ce11
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
Reference in New Issue