Skip to content

Commit

Permalink
Merge pull request #1 from pcuenca/ui-do-sample
Browse files Browse the repository at this point in the history
Explicit UI control to toggle sampling
  • Loading branch information
pcuenca authored Nov 11, 2023
2 parents 6895f4a + 75520a0 commit fa21089
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SwiftChat/ControlView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ struct ControlView: View {
CFloat(config.topK)
} set: {
config.topK = Int($0)
config.doSample = config.topK > 1
}, in: 1...50, step: 1) {
Text("Top K")
Spacer()
Expand All @@ -77,10 +76,15 @@ struct ControlView: View {
Spacer()
}
}
}

}.disabled(!config.doSample)

HStack {
Toggle(isOn: $config.doSample) { Text("Sample") }
Spacer()
}

Divider()

// Group {
// DisclosureGroup(isExpanded: $discloseAdvanced) {
// Spacer()
Expand Down

0 comments on commit fa21089

Please sign in to comment.