Skip to content

Commit

Permalink
Nexa sdk upgrade (#343)
Browse files Browse the repository at this point in the history
* android sdk upgrade

* update build-aar yml

* update dependencies

* init android audio

* add ttft/tps/decoding speed in android demo app

* update

* update

* updates

* add NexaAudioInference

* upgrade llama.cpp to newest version

* upgrade llama cpp python

* upgrade

* upgrade

* upgrade llama cpp python

* chore: update llama.cpp submodule

* update

* update

* revert some config

* disable bark build

* fix audio issue

* llama cpp to relase branch

* update android cmake omni deps branch

---------

Co-authored-by: Zack Li <[email protected]>
Co-authored-by: JoyboyBrian <[email protected]>
Co-authored-by: Brian <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
5 people authored Jan 6, 2025
1 parent e72d30c commit 95293de
Show file tree
Hide file tree
Showing 139 changed files with 2,986 additions and 2,953 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-aar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
- name: Navigate to android Directory and Build AAR
run: |
echo "Navigating to the example directory..."
cd android/llama.android
cd android
echo "Starting Gradle build process in $(pwd)..."
./gradlew assembleRelease --stacktrace --info
shell: bash

- name: Rename and upload AAR
run: |
echo "Navigating to the android directory to find AAR output..."
cd android/llama.android
cd android
mkdir -p ../artifacts
ls -ld ../artifacts || echo "Artifacts directory does not exist."
AAR_PATH=$(find ./llama/build/outputs/aar -type f -name "*.aar" | head -n 1)
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[submodule "dependency/llama.cpp"]
path = dependency/llama.cpp
url = https://github.com/NexaAI/llama.cpp.git
branch = master-release
branch = release
[submodule "nexa/eval/benchmark_tasks"]
path = nexa/eval/benchmark_tasks
url = https://github.com/NexaAI/benchmark-tasks.git
Expand Down
2 changes: 2 additions & 0 deletions android/llama.android/.gitignore → android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.gradle/
build/

.idea

# Local configuration file (sdk path, etc)
local.properties

Expand Down
9 changes: 7 additions & 2 deletions android/llama.android/README.md → android/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Nexa

**Nexa** offers a convenient Kotlin API for Android developers. It allows seamless integration of llama.cpp models into Android applications.
**NOTE:** Currently, Nexa supports Large-Language Model (LLM) Vision-Language Model (VLM) inference capabilities.
**Nexa** is a Kotlin wrapper for the [llama.cpp](https://github.com/ggerganov/llama.cpp.git) library. offering a convenient Kotlin API for Android developers. It allows seamless integration of llama.cpp models into Android applications.
**NOTE:** Currently, Nexa supports Vision-Language Model (VLM) inference capabilities.

## Installation

Expand Down Expand Up @@ -52,3 +52,8 @@ Open the [android test project](./app-java) folder in Android Studio and run the
## Download Models

You can download models from the [Nexa AI ModelHub](https://nexa.ai/models).

## How to estimate power usage

- ```adb shell dumpsys batterystats --reset```
- ```adb shell dumpsys batterystats > batterystats.txt```
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
Expand All @@ -12,6 +12,9 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:largeHeap="true"
android:hardwareAccelerated="true"
tools:replace="android:largeHeap"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand Down
Loading

0 comments on commit 95293de

Please sign in to comment.