Improve docs and warnings (#1164)

This commit is contained in:
Lianmin Zheng
2024-08-20 08:31:29 -07:00
committed by GitHub
parent d8476818ef
commit a8ae640328
7 changed files with 25 additions and 24 deletions

View File

@@ -17,10 +17,10 @@ limitations under the License.
import asyncio
import json
import logging
import os
import time
import uuid
import warnings
from http import HTTPStatus
from typing import Dict, List, Optional
@@ -65,6 +65,8 @@ from sglang.srt.openai_api.protocol import (
UsageInfo,
)
logger = logging.getLogger(__name__)
chat_template_name = None
@@ -408,7 +410,7 @@ def v1_generate_request(all_requests: List[CompletionRequest]):
"Parallel sampling is not supported for completions from files"
)
if request.echo and request.logprobs:
warnings.warn(
logger.warning(
"Echo is not compatible with logprobs. "
"To compute logprobs of input prompt, please use SGLang /request API."
)