Skip to content

Commit 4541c14

Browse files
Cleanup model
1 parent c4cd588 commit 4541c14

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/main/java/com/example/model/Model.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.example.Options;
44
import com.example.auxiliary.LastRunMetrics;
5-
import com.example.inference.InferenceEngine;
65
import com.example.inference.sampler.Sampler;
76
import com.example.inference.state.State;
87
import com.example.inference.weights.Weights;
@@ -194,12 +193,12 @@ default void runInstructOnce(Sampler sampler, Options options) {
194193
Set<Integer> stopTokens = chatFormat.getStopTokens();
195194

196195
if (USE_TORNADOVM) {
196+
// GPU path using TornadoVM
197197
tornadoVMPlan = TornadoVMMasterPlan.initializeTornadoVMPlan(state, this);
198198
// Call generateTokensGPU without the token consumer parameter
199-
//responseTokens = InferenceEngine.generateTokensGPU(this, state, 0, promptTokens, stopTokens, options.maxTokens(), sampler, options.echo(), options.stream() ? tokenConsumer : null,
200-
// tornadoVMPlan);
201199
responseTokens = generateTokensGPU(state, 0, promptTokens, stopTokens, options.maxTokens(), sampler, options.echo(), options.stream() ? tokenConsumer : null, tornadoVMPlan);
202200
} else {
201+
// CPU path
203202
responseTokens = generateTokens(state, 0, promptTokens, stopTokens, options.maxTokens(), sampler, options.echo(), tokenConsumer);
204203
}
205204

src/main/java/com/example/model/loader/Qwen3ModelLoader.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ public Qwen3 loadModel() {
4747
contextLength = modelContextLength;
4848
}
4949

50-
//String modelName = ggufPath.getFileName().toString();
5150
Qwen3Configuration config = new Qwen3Configuration(
52-
//modelName,
5351
(int) metadata.get("qwen3.embedding_length"),
5452
(int) metadata.get("qwen3.feed_forward_length"),
5553
(int) metadata.get("qwen3.block_count"),
@@ -110,7 +108,6 @@ public Weights loadWeights(Map<String, GGMLTensorEntry> tensorEntries, Configura
110108
@Override
111109
public Weights createTornadoVMWeights(Map<String, GGMLTensorEntry> tensorEntries, Configuration config, Pair<float[], float[]> ropeFreqs, GGMLTensorEntry tokenEmbeddings,
112110
GGMLTensorEntry outputWeight) {
113-
//throw new UnsupportedOperationException("Not supported yet.");
114111
return new Qwen3TornadoWeights(
115112
loadTensorAsFloatArray(tokenEmbeddings),
116113
loadArrayAsFloatArrayFromBuffer(config.numberOfLayers(), i -> tensorEntries.get("blk." + i + ".attn_norm.weight")),

0 commit comments

Comments
 (0)