Skip to content

Commit

Permalink
feat(android, example): disable repeat penalties by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Apr 26, 2024
1 parent 0ff5d6a commit cf685ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions android/src/main/java/com/rnllama/LlamaContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public WritableMap completion(ReadableMap params) {
// int penalty_last_n,
params.hasKey("penalty_last_n") ? params.getInt("penalty_last_n") : 64,
// float penalty_repeat,
params.hasKey("penalty_repeat") ? (float) params.getDouble("penalty_repeat") : 1.10f,
params.hasKey("penalty_repeat") ? (float) params.getDouble("penalty_repeat") : 1.00f,
// float penalty_freq,
params.hasKey("penalty_freq") ? (float) params.getDouble("penalty_freq") : 0.00f,
// float penalty_present,
Expand All @@ -162,7 +162,7 @@ public WritableMap completion(ReadableMap params) {
// float mirostat_eta,
params.hasKey("mirostat_eta") ? (float) params.getDouble("mirostat_eta") : 0.10f,
// boolean penalize_nl,
params.hasKey("penalize_nl") ? params.getBoolean("penalize_nl") : true,
params.hasKey("penalize_nl") ? params.getBoolean("penalize_nl") : false,
// int top_k,
params.hasKey("top_k") ? params.getInt("top_k") : 40,
// float top_p,
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export default function App() {
mirostat: 0, // 0/1/2
mirostat_tau: 5, // target entropy
mirostat_eta: 0.1, // learning rate
penalize_nl: true, // penalize newlines
penalize_nl: false, // penalize newlines
seed: 1234, // random seed
n_probs: 0, // Show probabilities
stop: ['</s>', 'llama:', 'User:'],
Expand Down

0 comments on commit cf685ad

Please sign in to comment.