From 75520a0a0d3b617a3670ed97e8981f285d094975 Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Sat, 11 Nov 2023 19:34:13 +0100 Subject: [PATCH] Explicit UI control to toggle sampling It used to be top_k > 1 --- SwiftChat/ControlView.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SwiftChat/ControlView.swift b/SwiftChat/ControlView.swift index 7034a9b..ef3e492 100644 --- a/SwiftChat/ControlView.swift +++ b/SwiftChat/ControlView.swift @@ -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() @@ -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()