Skip to content

Commit

Permalink
fix: remove tfs_z
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Nov 2, 2024
1 parent 992a4d6 commit 1211095
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
8 changes: 3 additions & 5 deletions android/src/main/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Java_com_rnllama_LlamaContext_initContext(
defaultParams.cpuparams.n_threads = n_threads > 0 ? n_threads : default_n_threads;

defaultParams.n_gpu_layers = n_gpu_layers;

defaultParams.use_mlock = use_mlock;
defaultParams.use_mmap = use_mmap;

Expand Down Expand Up @@ -380,7 +380,6 @@ Java_com_rnllama_LlamaContext_doCompletion(
jfloat min_p,
jfloat xtc_threshold,
jfloat xtc_probability,
jfloat tfs_z,
jfloat typical_p,
jint seed,
jobjectArray stop,
Expand Down Expand Up @@ -419,7 +418,6 @@ Java_com_rnllama_LlamaContext_doCompletion(
sparams.top_k = top_k;
sparams.top_p = top_p;
sparams.min_p = min_p;
sparams.tfs_z = tfs_z;
sparams.typ_p = typical_p;
sparams.n_probs = n_probs;
sparams.grammar = env->GetStringUTFChars(grammar, nullptr);
Expand Down Expand Up @@ -546,7 +544,7 @@ Java_com_rnllama_LlamaContext_doCompletion(
putInt(env, result, "tokens_cached", llama->n_past);

const auto timings_token = llama_perf_context(llama -> ctx);

auto timingsResult = createWriteableMap(env);
putInt(env, timingsResult, "prompt_n", timings_token.n_p_eval);
putInt(env, timingsResult, "prompt_ms", timings_token.t_p_eval_ms);
Expand Down Expand Up @@ -643,7 +641,7 @@ Java_com_rnllama_LlamaContext_embedding(
llama->rewind();

llama_perf_context_reset(llama->ctx);

llama->params.prompt = text_chars;

llama->params.n_predict = 0;
Expand Down
1 change: 0 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ export default function App() {
temperature: 0.7,
top_k: 40, // <= 0 to use vocab size
top_p: 0.5, // 1.0 = disabled
tfs_z: 1.0, // 1.0 = disabled
typical_p: 1.0, // 1.0 = disabled
penalty_last_n: 256, // 0 = disable penalty, -1 = context size
penalty_repeat: 1.18, // 1.0 = disabled
Expand Down
1 change: 0 additions & 1 deletion ios/RNLlamaContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ - (NSDictionary *)completion:(NSDictionary *)params
if (params[@"min_p"]) sparams.min_p = [params[@"min_p"] doubleValue];
if (params[@"xtc_threshold"]) sparams.xtc_threshold = [params[@"xtc_threshold"] doubleValue];
if (params[@"xtc_probability"]) sparams.xtc_probability = [params[@"xtc_probability"] doubleValue];
if (params[@"tfs_z"]) sparams.tfs_z = [params[@"tfs_z"] doubleValue];
if (params[@"typical_p"]) sparams.typ_p = [params[@"typical_p"] doubleValue];

if (params[@"grammar"]) {
Expand Down
1 change: 0 additions & 1 deletion src/NativeRNLlama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export type NativeCompletionParams = {
min_p?: number
xtc_threshold?: number
xtc_probability?: number
tfs_z?: number
typical_p?: number
temperature?: number // -> temp
penalty_last_n?: number
Expand Down

0 comments on commit 1211095

Please sign in to comment.