Skip to content

Commit

Permalink
πŸ› add kwargs definition
Browse files Browse the repository at this point in the history
Signed-off-by: Prashant Gupta <[email protected]>
  • Loading branch information
prashantgupta24 committed Jun 27, 2024
1 parent 442e2a7 commit d51e426
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vllm_tgis_adapter/grpc/grpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
from vllm.engine.async_llm_engine import _AsyncLLMEngine
from vllm.entrypoints.openai.serving_completion import merge_async_iterators
from vllm.inputs import TextTokensPrompt

try:
from vllm.tracing import (
contains_trace_headers,
extract_trace_headers,
log_tracing_disabled_warning,
)
)
except ImportError:
_vllm_tracing_available = False
else:
Expand Down Expand Up @@ -234,12 +235,14 @@ async def Generate(
prompt=req.text,
prompt_token_ids=input_ids,
)
kwargs = {}
if _vllm_tracing_available:
is_tracing_enabled = await self.engine.is_tracing_enabled()
headers = dict(context.invocation_metadata())
trace_headers = None
if is_tracing_enabled:
trace_headers = extract_trace_headers(headers)
kwargs["trace_headers"] = trace_headers
elif contains_trace_headers(headers):
log_tracing_disabled_warning()
generators.append(
Expand Down

0 comments on commit d51e426

Please sign in to comment.