MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / clear_load_weight

Function clear_load_weight

fastdeploy/entrypoints/openai/api_server.py:674–688  ·  view source on GitHub ↗

clear model weight

(request: Request)

Source from the content-addressed store, hash-verified

672@app.get("/clear_load_weight")
673@tracing.trace_span("clear_load_weight")
674def clear_load_weight(request: Request) -> Response:
675 """
676 clear model weight
677 """
678 if app.state.dynamic_load_weight:
679 if envs.FD_ENABLE_V1_UPDATE_WEIGHTS:
680 request_id = f"control-{uuid.uuid4()}"
681 control_request = ControlRequest(request_id, "sleep")
682 control_response = app.state.engine_client.run_control_method_sync(control_request, app.state.event_loop)
683 return control_response.to_api_json_response()
684 else:
685 status_code, msg = app.state.engine_client.clear_load_weight()
686 return JSONResponse(content=msg, status_code=status_code)
687 else:
688 return JSONResponse(content={"error": "Dynamic Load Weight Disabled."}, status_code=404)
689
690
691@app.post("/rearrange_experts")

Callers

nothing calls this directly

Calls 4

ControlRequestClass · 0.90
to_api_json_responseMethod · 0.80
clear_load_weightMethod · 0.80

Tested by

no test coverage detected