Unverified Commit c637d68d authored by drbh's avatar drbh Committed by GitHub
Browse files

feat: concat the adapter id to the model id in chat response (#2779)

* feat: concat the adapter id to the model id in chat response

* fix: updated to include only the adapter id in chat response
parent 780531ec
...@@ -1228,6 +1228,7 @@ pub(crate) async fn chat_completions( ...@@ -1228,6 +1228,7 @@ pub(crate) async fn chat_completions(
let span = tracing::Span::current(); let span = tracing::Span::current();
metrics::counter!("tgi_request_count").increment(1); metrics::counter!("tgi_request_count").increment(1);
let ChatRequest { let ChatRequest {
model,
stream, stream,
stream_options, stream_options,
logprobs, logprobs,
...@@ -1238,8 +1239,11 @@ pub(crate) async fn chat_completions( ...@@ -1238,8 +1239,11 @@ pub(crate) async fn chat_completions(
let logprobs = logprobs.unwrap_or_default(); let logprobs = logprobs.unwrap_or_default();
// static values that will be returned in all cases // extract model id from request if specified
let model_id = info.model_id.clone(); let model_id = match model.as_deref() {
Some("tgi") | None => info.model_id.clone(),
Some(m_id) => m_id.to_string(),
};
let system_fingerprint = format!("{}-{}", info.version, info.docker_label.unwrap_or("native")); let system_fingerprint = format!("{}-{}", info.version, info.docker_label.unwrap_or("native"));
// switch on stream // switch on stream
if stream { if stream {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment