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

Function update_model_weight

fastdeploy/entrypoints/openai/api_server.py:655–669  ·  view source on GitHub ↗

update model weight

(request: Request)

Source from the content-addressed store, hash-verified

653@app.get("/update_model_weight")
654@tracing.trace_span("update_model_weight")
655def update_model_weight(request: Request) -> Response:
656 """
657 update model weight
658 """
659 if app.state.dynamic_load_weight:
660 if envs.FD_ENABLE_V1_UPDATE_WEIGHTS:
661 request_id = f"control-{uuid.uuid4()}"
662 control_request = ControlRequest(request_id, "wakeup")
663 control_response = app.state.engine_client.run_control_method_sync(control_request, app.state.event_loop)
664 return control_response.to_api_json_response()
665 else:
666 status_code, msg = app.state.engine_client.update_model_weight()
667 return JSONResponse(content=msg, status_code=status_code)
668 else:
669 return JSONResponse(content={"error": "Dynamic Load Weight Disabled."}, status_code=404)
670
671
672@app.get("/clear_load_weight")

Callers

nothing calls this directly

Calls 4

ControlRequestClass · 0.90
to_api_json_responseMethod · 0.80
update_model_weightMethod · 0.80

Tested by

no test coverage detected