misc: add pre-commit config (#637)

This commit is contained in:
zhyncs
2024-07-18 04:55:39 +10:00
committed by GitHub
parent a8552cb18b
commit 2e341cd493
43 changed files with 481 additions and 299 deletions

View File

@@ -2,7 +2,9 @@
Usage:
python3 async_io.py
"""
import asyncio
from sglang import Runtime
@@ -14,7 +16,10 @@ async def generate(
tokenizer = engine.get_tokenizer()
messages = [
{"role": "system", "content": "You will be given question answer tasks.",},
{
"role": "system",
"content": "You will be given question answer tasks.",
},
{"role": "user", "content": prompt},
]
@@ -36,5 +41,5 @@ if __name__ == "__main__":
prompt = "Who is Alan Turing?"
sampling_params = {"max_new_tokens": 128}
asyncio.run(generate(runtime, prompt, sampling_params))
runtime.shutdown()