File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
composeApp/src/commonMain/kotlin/org/onion/diffusion/viewmodel
commonMain/kotlin/org/onion/diffusion
iosMain/kotlin/org/onion/diffusion Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ class ChatViewModel : ViewModel() {
8484 var wtype = mutableStateOf(- 1 )
8585
8686 /* * Offload to CPU - offload model computations to CPU */
87- var offloadToCpu = mutableStateOf(false )
87+ var offloadToCpu = mutableStateOf(getPlatform().isIOS )
8888
89- /* * Keep CLIP on CPU - keep CLIP model on CPU (enabled by default on macOS) */
90- var keepClipOnCpu = mutableStateOf(getPlatform().isMacOS)
89+ /* * Keep CLIP on CPU - keep CLIP model on CPU (enabled by default on macOS and iOS ) */
90+ var keepClipOnCpu = mutableStateOf(getPlatform().isMacOS || getPlatform().isIOS )
9191
9292 /* * Keep VAE on CPU - keep VAE decoder on CPU */
9393 var keepVaeOnCpu = mutableStateOf(false )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package org.onion.diffusion
33interface Platform {
44 val name: String
55 val isMacOS: Boolean get() = false
6+ val isIOS: Boolean get() = false
67}
78
89expect fun getPlatform (): Platform
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import platform.UIKit.UIDevice
44
55class IOSPlatform : Platform {
66 override val name: String = UIDevice .currentDevice.systemName() + " " + UIDevice .currentDevice.systemVersion
7+ override val isIOS: Boolean = true
78}
89
910actual fun getPlatform (): Platform = IOSPlatform ()
You can’t perform that action at this time.
0 commit comments