Integrate Hugging Face model library and separate web actions

This commit is contained in:
Mark Gregory
2026-11-17 09:12:51 +00:00
parent dd06e337fc
commit 92f4e58272
8 changed files with 361 additions and 125 deletions
+10 -5
View File
@@ -97,12 +97,12 @@ final class StudioModel: ObservableObject {
} catch { status = error.localizedDescription }
}
func deleteChat() {
guard !running, let selected else { return }
func deleteChat(_ id: UUID) {
guard !running else { return }
do {
try database().delete(selected)
conversations.removeAll { $0.id == selected }
self.selected = conversations.first?.id
try database().delete(id)
conversations.removeAll { $0.id == id }
if selected == id { selected = conversations.first?.id }
} catch { status = error.localizedDescription }
}
@@ -467,6 +467,11 @@ final class StudioModel: ObservableObject {
}
func cancelManagement() { management?.cancel() }
func loadMLX(_ path: String) async throws {
await configureMLXRuntime()
try await mlx.load(path)
}
func unloadMLX() { Task { await mlx.unload() } }
func mlxModelName() async -> String? { await mlx.modelName() }