update model weight
(request: Request)
| 653 | @app.get("/update_model_weight") |
| 654 | @tracing.trace_span("update_model_weight") |
| 655 | def 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") |
nothing calls this directly
no test coverage detected