Unverified Commit da0cbf68 authored by Ameen Patel's avatar Ameen Patel Committed by GitHub
Browse files

fix(runtime): return 500 on LoRA load/unload errors (#5626)


Signed-off-by: default avatarAmeenP <ameenp360@gmail.com>
Co-authored-by: default avatarBiswa Panda <biswa.panda@gmail.com>
parent b43a131c
...@@ -367,8 +367,17 @@ async fn load_lora_handler( ...@@ -367,8 +367,17 @@ async fn load_lora_handler(
.await .await
{ {
Ok(response) => { Ok(response) => {
tracing::info!("LoRA loaded successfully: {}", request.lora_name); if response.status == "error" {
(StatusCode::OK, Json(response)) tracing::error!(
"Failed to load LoRA {}: {}",
request.lora_name,
response.message.as_deref().unwrap_or("Unknown error")
);
(StatusCode::INTERNAL_SERVER_ERROR, Json(response))
} else {
tracing::info!("LoRA loaded successfully: {}", request.lora_name);
(StatusCode::OK, Json(response))
}
} }
Err(e) => { Err(e) => {
tracing::error!("Failed to load LoRA {}: {}", request.lora_name, e); tracing::error!("Failed to load LoRA {}: {}", request.lora_name, e);
...@@ -411,8 +420,17 @@ async fn unload_lora_handler( ...@@ -411,8 +420,17 @@ async fn unload_lora_handler(
.await .await
{ {
Ok(response) => { Ok(response) => {
tracing::info!("LoRA unloaded successfully: {}", lora_name); if response.status == "error" {
(StatusCode::OK, Json(response)) tracing::error!(
"Failed to unload LoRA {}: {}",
lora_name,
response.message.as_deref().unwrap_or("Unknown error")
);
(StatusCode::INTERNAL_SERVER_ERROR, Json(response))
} else {
tracing::info!("LoRA unloaded successfully: {}", lora_name);
(StatusCode::OK, Json(response))
}
} }
Err(e) => { Err(e) => {
tracing::error!("Failed to unload LoRA {}: {}", lora_name, e); tracing::error!("Failed to unload LoRA {}: {}", lora_name, e);
......
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