Organize server_args (#277)

This commit is contained in:
Liangsheng Yin
2024-03-11 20:06:52 +08:00
committed by GitHub
parent faba293a0d
commit 1b35547927
12 changed files with 92 additions and 34 deletions
+6 -2
View File
@@ -1,6 +1,7 @@
"""SRT: SGLang Runtime"""
import asyncio
import dataclasses
import json
import multiprocessing as mp
import os
@@ -86,6 +87,11 @@ async def get_model_info():
return result
@app.get("/get_server_args")
async def get_server_args():
return dataclasses.asdict(tokenizer_manager.server_args)
@app.get("/flush_cache")
async def flush_cache():
await tokenizer_manager.flush_cache()
@@ -548,7 +554,6 @@ class Runtime:
max_prefill_num_token: int = ServerArgs.max_prefill_num_token,
context_length: int = ServerArgs.context_length,
tp_size: int = 1,
model_mode: List[str] = (),
schedule_heuristic: str = "lpm",
attention_reduce_in_fp32: bool = False,
random_seed: int = 42,
@@ -571,7 +576,6 @@ class Runtime:
max_prefill_num_token=max_prefill_num_token,
context_length=context_length,
tp_size=tp_size,
model_mode=model_mode,
schedule_heuristic=schedule_heuristic,
attention_reduce_in_fp32=attention_reduce_in_fp32,
random_seed=random_seed,