File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ struct ControlsView: View {
49
49
@EnvironmentObject var generation : GenerationContext
50
50
51
51
static let models = ModelInfo . MODELS
52
- static let modelNames = models. map { $0. modelVersion }
53
52
54
53
@State private var model = Settings . shared. currentModel. modelVersion
55
54
@State private var disclosedModel = true
@@ -106,6 +105,12 @@ struct ControlsView: View {
106
105
}
107
106
}
108
107
108
+ func modelLabel( _ model: ModelInfo ) -> Text {
109
+ let downloaded = PipelineLoader ( model: model) . ready
110
+ let prefix = downloaded ? " ● " : " ◌ " //"○ "
111
+ return Text ( prefix) . foregroundColor ( downloaded ? . accentColor : . secondary) + Text( model. modelVersion)
112
+ }
113
+
109
114
var body : some View {
110
115
VStack ( alignment: . leading) {
111
116
@@ -118,8 +123,8 @@ struct ControlsView: View {
118
123
Group {
119
124
DisclosureGroup ( isExpanded: $disclosedModel) {
120
125
Picker ( " " , selection: $model) {
121
- ForEach ( Self . modelNames , id: \. self ) {
122
- Text ( $0)
126
+ ForEach ( Self . models , id: \. modelVersion ) {
127
+ modelLabel ( $0)
123
128
}
124
129
}
125
130
. onChange ( of: model) { theModel in
You can’t perform that action at this time.
0 commit comments