Skip to content

Commit

Permalink
fix: type and key
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Apr 26, 2024
1 parent 54f6cdc commit 1b5731f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions android/src/main/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ Java_com_rnllama_LlamaContext_loadModelDetails(

char desc[1024];
llama_model_desc(llama->model, desc, sizeof(desc));
putString(env, result, "model_desc", desc);
putDouble(env, result, "model_size", llama_model_size(llama->model));
putInt(env, result, "model_n_params", llama_model_n_params(llama->model));
putString(env, result, "desc", desc);
putDouble(env, result, "size", llama_model_size(llama->model));
putDouble(env, result, "nParams", llama_model_n_params(llama->model));
putMap(env, result, "metadata", meta);

return reinterpret_cast<jobject>(result);
Expand Down
1 change: 1 addition & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default function App() {
})
.then((ctx) => {
setContext(ctx)
console.log(ctx)
addSystemMessage(
`Context initialized! \n\nGPU: ${ctx.gpu ? 'YES' : 'NO'} (${
ctx.reasonNoGPU
Expand Down
4 changes: 2 additions & 2 deletions ios/RNLlamaContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
bool is_model_loaded;
NSString * model_desc;
uint64_t model_size;
int model_n_params;
uint64_t model_n_params;
NSDictionary * metadata;

rnllama::llama_rn_context * llama;
Expand All @@ -22,7 +22,7 @@
- (NSDictionary *)metadata;
- (NSString *)modelDesc;
- (uint64_t)modelSize;
- (int)modelNParams;
- (uint64_t)modelNParams;
- (bool)isModelLoaded;
- (bool)isPredicting;
- (NSDictionary *)completion:(NSDictionary *)params onToken:(void (^)(NSMutableDictionary *tokenResult))onToken;
Expand Down
4 changes: 2 additions & 2 deletions ios/RNLlamaContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ - (NSString *)modelDesc {
return model_desc;
}

- (size_t)modelSize {
- (uint64_t)modelSize {
return model_size;
}

- (size_t)modelNParams {
- (uint64_t)modelNParams {
return model_n_params;
}

Expand Down

0 comments on commit 1b5731f

Please sign in to comment.