Skip to content

Commit

Permalink
Get rid of server_args in internal iterfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
JianyuZhan committed Aug 17, 2024
1 parent 4086209 commit a65ceec
Show file tree
Hide file tree
Showing 23 changed files with 615 additions and 1,598 deletions.
4 changes: 2 additions & 2 deletions examples/usage/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for prompt, output in zip(prompts, outputs):
print('===============================')
print(f"Prompt: {prompt}\nGenerated text: {output['text']}")
print("===============================")
print(f"Prompt: {prompt}\nGenerated text: {output['text']}")
2 changes: 1 addition & 1 deletion python/sglang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from sglang.api import (
LLM,
SamplingParams,
Runtime,
SamplingParams,
assistant,
assistant_begin,
assistant_end,
Expand Down
3 changes: 2 additions & 1 deletion python/sglang/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
SglSelect,
SglVideo,
)
from sglang.srt.serving.engine import LLM
from sglang.srt.sampling_params import SamplingParams
from sglang.srt.serving.engine import LLM


def function(
func: Optional[Callable] = None, num_api_spec_tokens: Optional[int] = None
Expand Down
6 changes: 3 additions & 3 deletions python/sglang/bench_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
import torch
import torch.distributed as dist

from sglang.srt.config import ModelConfig
from sglang.srt.hf_transformers_utils import get_tokenizer
from sglang.srt.managers.schedule_batch import Req, ScheduleBatch
from sglang.srt.model_config import ModelConfig
from sglang.srt.model_executor.forward_batch_info import ForwardMode
from sglang.srt.model_executor.model_runner import ModelRunner
from sglang.srt.sampling_params import SamplingParams
from sglang.srt.server_args import ServerArgs
from sglang.srt.serving.server_args import ServerArgs
from sglang.srt.utils import suppress_other_loggers


Expand Down Expand Up @@ -111,7 +111,7 @@ def load_model(server_args, tp_rank):
suppress_other_loggers()
rank_print = print if tp_rank == 0 else lambda *args, **kwargs: None

model_config = ModelConfig(path=server_args.model_path)
model_config = ModelConfig(model_path=server_args.model_path)
model_runner = ModelRunner(
model_config=model_config,
mem_fraction_static=server_args.mem_fraction_static,
Expand Down
4 changes: 2 additions & 2 deletions python/sglang/launch_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import argparse

from sglang.srt.server import launch_server
from sglang.srt.server_args import ServerArgs
from sglang.srt.serving.server import launch_server
from sglang.srt.serving.server_args import ServerArgs

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down
Loading

0 comments on commit a65ceec

Please sign in to comment.