Skip to content

Commit

Permalink
fix(Android): fix android build
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Oct 21, 2024
1 parent 9062127 commit 4d1324f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions android/src/main/java/com/barkrn/BarkContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ package com.barkrn
class BarkContext {
private var context: Long = 0L

class BarkResult(success: Boolean, load_time: Int, eval_time: Int)
class BarkResult(success: Boolean, load_time: Int, eval_time: Int) {
val success: Boolean = success
val load_time: Int = load_time
val eval_time: Int = eval_time
}

external fun nativeInitContext(model_path: String, params: Map<String, Any>): Long
external fun nativeGenerate(context: Long, text: String, out_path: String, threads: Int): BarkResult
Expand All @@ -14,7 +18,7 @@ class BarkContext {
}

fun generate(text: String, out_path: String, threads: Int = 1): BarkResult {
if (context == 0) {
if (context == 0L) {
throw IllegalStateException("Context not initialized")
}
return nativeGenerate(context, text, out_path, threads)
Expand Down

0 comments on commit 4d1324f

Please sign in to comment.