"...gaoqiong/composable_kernel.git" did not exist on "bba085d2b58da0b222e784b8a335c3a24acbacc9"
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,9 +367,18 @@ async fn load_lora_handler( ...@@ -367,9 +367,18 @@ async fn load_lora_handler(
.await .await
{ {
Ok(response) => { Ok(response) => {
if response.status == "error" {
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); tracing::info!("LoRA loaded successfully: {}", request.lora_name);
(StatusCode::OK, Json(response)) (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,9 +420,18 @@ async fn unload_lora_handler( ...@@ -411,9 +420,18 @@ async fn unload_lora_handler(
.await .await
{ {
Ok(response) => { Ok(response) => {
if response.status == "error" {
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); tracing::info!("LoRA unloaded successfully: {}", lora_name);
(StatusCode::OK, Json(response)) (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