Tiny fix update version logic location (#12620)
This commit is contained in:
@@ -718,11 +718,6 @@ async def update_weights_from_disk(obj: UpdateWeightFromDiskReqInput, request: R
|
||||
await _global_state.tokenizer_manager.update_weights_from_disk(obj, request)
|
||||
)
|
||||
|
||||
# Update weight version if provided and weights update was successful
|
||||
if success and obj.weight_version is not None:
|
||||
_update_weight_version_if_provided(obj.weight_version)
|
||||
message += f" Weight version updated to {obj.weight_version}."
|
||||
|
||||
content = {
|
||||
"success": success,
|
||||
"message": message,
|
||||
@@ -816,11 +811,6 @@ async def update_weights_from_tensor(
|
||||
obj, request
|
||||
)
|
||||
|
||||
# Update weight version if provided and weights update was successful
|
||||
if success and obj.weight_version is not None:
|
||||
_update_weight_version_if_provided(obj.weight_version)
|
||||
message += f" Weight version updated to {obj.weight_version}."
|
||||
|
||||
content = {"success": success, "message": message}
|
||||
return ORJSONResponse(
|
||||
content, status_code=200 if success else HTTPStatus.BAD_REQUEST
|
||||
@@ -838,11 +828,6 @@ async def update_weights_from_distributed(
|
||||
)
|
||||
)
|
||||
|
||||
# Update weight version if provided and weights update was successful
|
||||
if success and obj.weight_version is not None:
|
||||
_update_weight_version_if_provided(obj.weight_version)
|
||||
message += f" Weight version updated to {obj.weight_version}."
|
||||
|
||||
content = {"success": success, "message": message}
|
||||
if success:
|
||||
return ORJSONResponse(content, status_code=200)
|
||||
@@ -857,11 +842,6 @@ async def update_weights_from_ipc(obj: UpdateWeightsFromIPCReqInput, request: Re
|
||||
obj, request
|
||||
)
|
||||
|
||||
# Update weight version if provided and weights update was successful
|
||||
if success and obj.weight_version is not None:
|
||||
_update_weight_version_if_provided(obj.weight_version)
|
||||
message += f" Weight version updated to {obj.weight_version}."
|
||||
|
||||
content = {"success": success, "message": message}
|
||||
if success:
|
||||
if _global_state.tokenizer_manager.initial_weights_loaded is False:
|
||||
@@ -1325,12 +1305,6 @@ async def vertex_generate(vertex_req: VertexGenerateReqInput, raw_request: Reque
|
||||
return ORJSONResponse({"predictions": ret})
|
||||
|
||||
|
||||
def _update_weight_version_if_provided(weight_version: Optional[str]) -> None:
|
||||
"""Update weight version if provided."""
|
||||
if weight_version is not None:
|
||||
_global_state.tokenizer_manager.server_args.weight_version = weight_version
|
||||
|
||||
|
||||
def _create_error_response(e):
|
||||
return ORJSONResponse(
|
||||
{"error": {"message": str(e)}}, status_code=HTTPStatus.BAD_REQUEST
|
||||
|
||||
Reference in New Issue
Block a user