@@ -36,6 +36,17 @@ pub async fn load_model(
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn unload_model(
|
||||
State(state): State<AppState>,
|
||||
Path(model): Path<String>,
|
||||
) -> Result<Json<Value>, (axum::http::StatusCode, String)> {
|
||||
match state.ollama.unload_model(&model).await {
|
||||
// ← correct method
|
||||
Ok(response) => Ok(Json(response)),
|
||||
Err(e) => Err(ollama_err(e)),
|
||||
}
|
||||
}
|
||||
|
||||
fn ollama_err(e: OllamaError) -> (axum::http::StatusCode, String) {
|
||||
match e {
|
||||
OllamaError::ModelNotFound(m) => (
|
||||
|
||||
Reference in New Issue
Block a user