This commit is contained in:
@@ -1416,17 +1416,8 @@ async def load_lora_adapter(
|
||||
):
|
||||
"""Load a new LoRA adapter without re-launching the server."""
|
||||
result = await _global_state.tokenizer_manager.load_lora_adapter(obj, request)
|
||||
|
||||
if result.success:
|
||||
return ORJSONResponse(
|
||||
result,
|
||||
status_code=HTTPStatus.OK,
|
||||
)
|
||||
else:
|
||||
return ORJSONResponse(
|
||||
result,
|
||||
status_code=HTTPStatus.BAD_REQUEST,
|
||||
)
|
||||
status_code = HTTPStatus.OK if result.success else HTTPStatus.BAD_REQUEST
|
||||
return ORJSONResponse(result, status_code=status_code)
|
||||
|
||||
|
||||
@app.api_route("/load_lora_adapter_from_tensors", methods=["POST"])
|
||||
@@ -1437,11 +1428,8 @@ async def load_lora_adapter_from_tensors(
|
||||
result = await _global_state.tokenizer_manager.load_lora_adapter_from_tensors(
|
||||
obj, request
|
||||
)
|
||||
|
||||
if result.success:
|
||||
return ORJSONResponse(result, status_code=HTTPStatus.OK)
|
||||
else:
|
||||
return ORJSONResponse(result, status_code=HTTPStatus.BAD_REQUEST)
|
||||
status_code = HTTPStatus.OK if result.success else HTTPStatus.BAD_REQUEST
|
||||
return ORJSONResponse(result, status_code=status_code)
|
||||
|
||||
|
||||
@app.api_route("/unload_lora_adapter", methods=["POST"])
|
||||
@@ -1451,17 +1439,8 @@ async def unload_lora_adapter(
|
||||
):
|
||||
"""Load a new LoRA adapter without re-launching the server."""
|
||||
result = await _global_state.tokenizer_manager.unload_lora_adapter(obj, request)
|
||||
|
||||
if result.success:
|
||||
return ORJSONResponse(
|
||||
result,
|
||||
status_code=HTTPStatus.OK,
|
||||
)
|
||||
else:
|
||||
return ORJSONResponse(
|
||||
result,
|
||||
status_code=HTTPStatus.BAD_REQUEST,
|
||||
)
|
||||
status_code = HTTPStatus.OK if result.success else HTTPStatus.BAD_REQUEST
|
||||
return ORJSONResponse(result, status_code=status_code)
|
||||
|
||||
|
||||
@app.api_route("/open_session", methods=["GET", "POST"])
|
||||
|
||||
Reference in New Issue
Block a user