From 9e037c822ccabaf593c0145a9d8377f177e22ff9 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Tue, 23 Jan 2024 03:43:19 -0800 Subject: [PATCH] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 3da9ea507..496abf9a0 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,10 @@ for out in state.text_iter(): print(out, end="", flush=True) ``` +### Tips and Implementation Details +- The `choices` argument in `sgl.gen` is implemented by computing the normalized log probabilities of all choices and selecting the one with the highest probability. +- The `regex` argument in `sgl.gen` is implemented through autoregressive decoding with logit bias masking, according to the constraints set by the regex. + ## Backend: SGLang Runtime (SRT) The SGLang Runtime (SRT) is designed to work best with the SGLang frontend. However, it can also be used as a standalone API server.