clear model weight
(request: Request)
| 672 | @app.get("/clear_load_weight") |
| 673 | @tracing.trace_span("clear_load_weight") |
| 674 | def 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") |
nothing calls this directly
no test coverage detected