udate weights from disk (#2265)
This commit is contained in:
@@ -53,7 +53,7 @@ from sglang.srt.managers.io_struct import (
|
||||
EmbeddingReqInput,
|
||||
GenerateReqInput,
|
||||
OpenSessionReqInput,
|
||||
UpdateWeightReqInput,
|
||||
UpdateWeightFromDiskReqInput,
|
||||
)
|
||||
from sglang.srt.managers.scheduler import run_scheduler_process
|
||||
from sglang.srt.managers.tokenizer_manager import TokenizerManager
|
||||
@@ -192,11 +192,11 @@ async def stop_profile_async():
|
||||
)
|
||||
|
||||
|
||||
@app.post("/update_weights")
|
||||
@app.post("/update_weights_from_disk")
|
||||
@time_func_latency
|
||||
async def update_weights(obj: UpdateWeightReqInput, request: Request):
|
||||
"""Update the weights inplace without re-launching the server."""
|
||||
success, message = await tokenizer_manager.update_weights(obj, request)
|
||||
async def update_weights_from_disk(obj: UpdateWeightFromDiskReqInput, request: Request):
|
||||
"""Update the weights from disk inplace without re-launching the server."""
|
||||
success, message = await tokenizer_manager.update_weights_from_disk(obj, request)
|
||||
content = {"success": success, "message": message}
|
||||
if success:
|
||||
return ORJSONResponse(
|
||||
|
||||
Reference in New Issue
Block a user