Skip to content

Commit

Permalink
Explicit UI control to toggle sampling
Browse files Browse the repository at this point in the history
It used to be top_k > 1
  • Loading branch information
pcuenca committed Nov 11, 2023
1 parent 6895f4a commit 75520a0
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 75520a0

Please sign in to comment.