Integrate Hugging Face model library and separate web actions
This commit is contained in:
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user