mirror of
https://github.com/block/goose.git
synced 2026-06-02 06:19:33 +02:00
Address local model download review
Return immediately from the server download endpoint and preserve terminal cancellation state for HF-backed downloads. Mark pre-download failures in the shared progress map so clients can surface actionable errors.
This commit is contained in:
@@ -1742,7 +1742,7 @@ impl ProgressHandler for HfDownloadProgress {
|
||||
update_download_manager_progress(&self.model_id, &state);
|
||||
}
|
||||
}
|
||||
DownloadEvent::Complete => self.complete(),
|
||||
DownloadEvent::Complete => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,20 +206,15 @@ pub fn get_registry() -> &'static Mutex<LocalModelRegistry> {
|
||||
})
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum LocalModelStorage {
|
||||
#[default]
|
||||
GooseManaged,
|
||||
HuggingFaceCache,
|
||||
ManualPath,
|
||||
}
|
||||
|
||||
impl Default for LocalModelStorage {
|
||||
fn default() -> Self {
|
||||
Self::GooseManaged
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ShardFile {
|
||||
pub filename: String,
|
||||
|
||||
@@ -367,8 +367,6 @@ mod imp {
|
||||
|
||||
#[cfg(not(feature = "mlx"))]
|
||||
mod imp {
|
||||
use std::any::Any;
|
||||
|
||||
use crate::providers::errors::ProviderError;
|
||||
use crate::providers::local_inference::backend::{
|
||||
BackendLoadedModel, LocalGenerationRequest, LocalInferenceBackend,
|
||||
@@ -386,14 +384,6 @@ mod imp {
|
||||
}
|
||||
}
|
||||
|
||||
struct UnavailableLoadedModel;
|
||||
|
||||
impl BackendLoadedModel for UnavailableLoadedModel {
|
||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl LocalInferenceBackend for MlxBackend {
|
||||
fn id(&self) -> &'static str {
|
||||
MLX_BACKEND_ID
|
||||
|
||||
Reference in New Issue
Block a user