fix lint
parent
73c67b339a
commit
5f5ddbb704
|
|
@ -1,4 +1,4 @@
|
|||
use tracing::{info, Level};
|
||||
|
||||
use tracing_subscriber;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use tracing::{span, info, Level};
|
||||
use axum::{extract::State, Json};
|
||||
use ctranslate2_bindings::{
|
||||
TextInferenceEngine, TextInferenceEngineCreateOptions, TextInferenceOptionsBuilder,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::Arc;
|
||||
use tracing::{info, span, Level};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
mod languages;
|
||||
|
|
@ -45,7 +45,7 @@ pub async fn completion(
|
|||
let span = span!(Level::INFO, "completion", completion_id);
|
||||
let _enter = span.enter();
|
||||
|
||||
info!(language=request.language, prompt=request.prompt);
|
||||
info!(language = request.language, prompt = request.prompt);
|
||||
let options = TextInferenceOptionsBuilder::default()
|
||||
.max_decoding_length(64)
|
||||
.sampling_temperature(0.2)
|
||||
|
|
@ -53,7 +53,7 @@ pub async fn completion(
|
|||
.unwrap();
|
||||
let text = state.engine.inference(&request.prompt, options);
|
||||
let filtered_text = languages::remove_stop_words(&request.language, &text);
|
||||
info!(response=filtered_text);
|
||||
info!(response = filtered_text);
|
||||
|
||||
Json(CompletionResponse {
|
||||
id: completion_id,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use axum::Json;
|
||||
use tracing::{span, info, Level};
|
||||
use hyper::StatusCode;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tracing::{info};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Serialize, Deserialize, ToSchema, Clone, Debug)]
|
||||
|
|
@ -19,9 +19,9 @@ pub struct LogEventRequest {
|
|||
)]
|
||||
pub async fn log_event(Json(request): Json<LogEventRequest>) -> StatusCode {
|
||||
info!(
|
||||
completion_id=request.completion_id,
|
||||
event_type=request.event_type,
|
||||
choice_index=request.choice_index
|
||||
completion_id = request.completion_id,
|
||||
event_type = request.event_type,
|
||||
choice_index = request.choice_index
|
||||
);
|
||||
StatusCode::OK
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue