Skip to content

Commit

Permalink
Rich debug info (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
npuichigo authored Mar 20, 2024
1 parent fc37fbb commit 8e33ce1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openai_trtllm"
version = "0.1.0"
version = "0.2.1"
edition = "2021"

[dependencies]
Expand All @@ -23,7 +23,7 @@ tracing-opentelemetry = { version = "0.22" }
tower-http = { version = "0.5", features = ["trace"] }
opentelemetry = { version = "0.21.0", features = ["metrics", "logs"] }
opentelemetry_sdk = { version = "0.21.1", features = ["rt-tokio", "logs"] }
opentelemetry-otlp = { version = "0.14.0", features = ["tonic", "metrics", "logs"] }
opentelemetry-otlp = { version = "0.14.0", features = ["tonic", "metrics", "logs"] }
opentelemetry-semantic-conventions = { version = "0.13.0" }
axum-tracing-opentelemetry = "0.16.0"
liquid = "0.26.4"
Expand Down
3 changes: 3 additions & 0 deletions src/routes/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ async fn chat_completions_stream(

let raw_content = infer_response.raw_output_contents[0].clone();
let content = deserialize_bytes_tensor(raw_content)?.into_iter().collect::<String>();
tracing::debug!("deserialized triton infer response content: {:?}", content);

if !content.is_empty() {
let response = ChatCompletionChunk {
Expand Down Expand Up @@ -182,6 +183,8 @@ async fn chat_completions(

let raw_content = infer_response.raw_output_contents[0].clone();
let content = deserialize_bytes_tensor(raw_content)?.into_iter().collect();
tracing::debug!("deserialized triton infer response content: {:?}", content);

contents.push(content);
}

Expand Down
3 changes: 3 additions & 0 deletions src/routes/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async fn completions_stream(
let content = deserialize_bytes_tensor(raw_content)?
.into_iter()
.collect::<String>();
tracing::debug!("deserialized triton infer response content: {:?}", content);

if !content.is_empty() {
let response = Completion {
Expand Down Expand Up @@ -166,6 +167,8 @@ async fn completions(

let raw_content = infer_response.raw_output_contents[0].clone();
let content = deserialize_bytes_tensor(raw_content)?.into_iter().collect();
tracing::debug!("deserialized triton infer response content: {:?}", content);

contents.push(content);
}

Expand Down

0 comments on commit 8e33ce1

Please sign in to comment.