From 33d4b6f57ea535aa94c5bd2d8f44bcca9b0d1a26 Mon Sep 17 00:00:00 2001 From: David Koski Date: Fri, 1 Mar 2024 22:56:28 -0800 Subject: [PATCH] make the generated output a little more interesting --- Applications/LLMEval/ContentView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Applications/LLMEval/ContentView.swift b/Applications/LLMEval/ContentView.swift index 435f496..48de844 100644 --- a/Applications/LLMEval/ContentView.swift +++ b/Applications/LLMEval/ContentView.swift @@ -5,6 +5,7 @@ import MLX import Metal import SwiftUI import Tokenizers +import MLXRandom struct ContentView: View { @@ -57,7 +58,7 @@ class LLMEvaluator { let modelConfiguration = ModelConfiguration.phi4bit /// parameters controlling the output - let temperature: Float = 0.0 + let temperature: Float = 0.6 let maxTokens = 100 enum LoadState { @@ -99,6 +100,9 @@ class LLMEvaluator { // augment the prompt as needed let prompt = modelConfiguration.prepare(prompt: prompt) let promptTokens = MLXArray(tokenizer.encode(text: prompt)) + + // each time you generate you will get something new + MLXRandom.seed(UInt64(Date.timeIntervalSinceReferenceDate * 1000)) var outputTokens = [Int]()