Support sanity checking weight consistency especially for RL (#13854)
This commit is contained in:
@@ -76,6 +76,7 @@ from sglang.srt.environ import envs
|
||||
from sglang.srt.function_call.function_call_parser import FunctionCallParser
|
||||
from sglang.srt.managers.io_struct import (
|
||||
AbortReq,
|
||||
CheckWeightsReqInput,
|
||||
CloseSessionReqInput,
|
||||
ConfigureLoggingReq,
|
||||
ContinueGenerationReqInput,
|
||||
@@ -956,6 +957,15 @@ async def resume_memory_occupation(
|
||||
return _create_error_response(e)
|
||||
|
||||
|
||||
@app.post("/weights_checker")
|
||||
async def check_weights(obj: CheckWeightsReqInput, request: Request):
|
||||
success, message = await _global_state.tokenizer_manager.check_weights(obj, request)
|
||||
return ORJSONResponse(
|
||||
{"success": success, "message": message},
|
||||
status_code=200 if success else HTTPStatus.BAD_REQUEST,
|
||||
)
|
||||
|
||||
|
||||
@app.api_route("/slow_down", methods=["GET", "POST"])
|
||||
async def slow_down(obj: SlowDownReqInput, request: Request):
|
||||
"""Slow down the system deliberately. Only for testing. Example scenario:
|
||||
|
||||
Reference in New Issue
Block a user