Compare commits

...

10 Commits

Author SHA1 Message Date
Jed Lee(lijunde) e1fbb944ea
Merge 08f9692200 into 5f35d621e1 2025-07-04 13:13:32 +08:00
王召德 5f35d621e1
Merge pull request #3670 from yanzhang-dev/features/upgrade-kai-1.9.0
android / android_build (push) Has been cancelled Details
ios / ios_build (push) Has been cancelled Details
linux / linux_buil_test (push) Has been cancelled Details
macos / macos_buil_test (push) Has been cancelled Details
windows / windows_build_test (push) Has been cancelled Details
Upgrade KleidiAI to v1.9.0
2025-07-02 17:54:46 +08:00
王召德 9f67942227
Merge pull request #3687 from Juude/feature/fix_huggingface_download_error 2025-07-02 14:49:49 +08:00
若遗 556193970a fix roundIcon show error 2025-07-02 14:46:26 +08:00
若遗 2e8c49e5a8 fix: resolve huggingface download issues and status display bugs 2025-07-02 14:44:52 +08:00
若遗 0ee1354714 Merge remote-tracking branch 'remotes/origin/master' 2025-07-02 14:14:30 +08:00
若遗 86c1365a50 fix huggingface download failed error 2025-07-02 14:13:52 +08:00
Jed Lee(lijunde) 08f9692200
Merge branch 'alibaba:master' into master 2025-06-28 10:52:33 +08:00
yanzhang 9a56fe323e Upgrade KleidiAI to v1.9.0
Change-Id: Ia910d9c296aa1569e9e4449b56bb7614fe6c85e0
Signed-off-by: yanzhang <yanzhang.wang@arm.com>
2025-06-26 13:46:40 +08:00
jedlee a7e97ff798 Implement the feature of sending the recorded audio with texts at the same time. 2025-05-18 15:25:33 +08:00
11 changed files with 44 additions and 23 deletions

View File

@ -59,6 +59,11 @@ This is our full multimodal language model (LLM) Android app
```
# Releases
## Version 0.5.1.2
+ Click here to [download](https://meta.alicdn.com/data/mnn/mnn_chat_0_5_1_2.apk)
+ fix huggingface download error
+ fix showing wrong download state when not download start.
## Version 0.5.1.1
+ Click here to [download](https://meta.alicdn.com/data/mnn/mnn_chat_0_5_1_1.apk)
+ Upgrade MNN engine to v3.2.0

View File

@ -54,6 +54,11 @@
# Releases
## Version 0.5.1.2
+ 点击这里 [下载](https://meta.alicdn.com/data/mnn/mnn_chat_0_5_1_2.apk)
+ 解决 huggingface 下载失败问题。
+ 解决未下载时候状态显示错误。
## Version 0.5.1.1
+ 点击这里 [下载](https://meta.alicdn.com/data/mnn/mnn_chat_0_5_1_1.apk)
+ 升级 MNN 引擎到 v3.2.0

View File

@ -14,7 +14,7 @@ android {
minSdk 26
targetSdk 34
versionCode 501
versionName "0.5.1.1"
versionName "0.5.1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {

View File

@ -187,7 +187,7 @@ class ModelDownloadManager private constructor(private val context: Context) {
downloadInfo.totalSize = totalSize
downloadInfo.savedSize = savedSize
downloadInfo.progress = savedSize.toDouble() / totalSize
downloadInfo.downlodaState = DownloadInfo.DownloadSate.PAUSED
downloadInfo.downlodaState = if (savedSize > 0) DownloadInfo.DownloadSate.PAUSED else DownloadInfo.DownloadSate.NOT_START
} else {
downloadInfo.downlodaState = DownloadInfo.DownloadSate.NOT_START
downloadInfo.progress = 0.0

View File

@ -107,7 +107,7 @@ class ModelFileDownloader {
)
)
}
if (response.code == 302 || response.code == 303) {
if (response.code in 301..308) {
theUrlToDownload = response.header("Location")!!
}
}

View File

@ -43,14 +43,22 @@ object HfFileMetadataUtils {
try {
client.newCall(request).execute().use { response ->
if (!response.isSuccessful && response.code != 302) {
val isRedirect = response.code in 301..308
if (!response.isSuccessful && !isRedirect) {
throw FileDownloadException("Failed to fetch metadata status " + response.code)
}
metadata.location = url
if (response.code == 302) {
if (isRedirect) {
val location = response.header("Location")
if (location != null) {
metadata.location = location
// Handle relative URLs in redirect Location header
metadata.location = if (location.startsWith("/")) {
// Extract the base URL (scheme + host + port) from the original URL
val originalUrl = response.request.url
"${originalUrl.scheme}://${originalUrl.host}${if (originalUrl.port != 80 && originalUrl.port != 443) ":${originalUrl.port}" else ""}$location"
} else {
location
}
}
}

View File

@ -174,7 +174,7 @@ class ChatInputComponent(
} else if (currentUserMessage != null) {
visible = false
} else if (!TextUtils.isEmpty(editUserMessage.text.toString())) {
visible = false
//visible = false
}
buttonSwitchVoice!!.visibility =
if (visible) View.VISIBLE else View.GONE
@ -227,13 +227,13 @@ class ChatInputComponent(
voiceRecordingModule.setOnVoiceRecordingListener(object : VoiceRecordingListener {
override fun onEnterRecordingMode() {
updateAudioOutput()
binding.btnToggleThinking.visibility = View.GONE
editUserMessage.visibility = View.GONE
// binding.btnToggleThinking.visibility = View.GONE
// editUserMessage.visibility = View.GONE
KeyboardUtils.hideKeyboard(editUserMessage)
if (attachmentPickerModule != null) {
attachmentPickerModule!!.hideAttachmentLayout()
}
editUserMessage.visibility = View.GONE
// editUserMessage.visibility = View.GONE
}
override fun onLeaveRecordingMode() {
@ -250,10 +250,11 @@ class ChatInputComponent(
override fun onRecordSuccess(duration: Float, recordingFilePath: String?) {
val chatDataItem = ChatDataItem.createAudioInputData(
chatActivity.dateFormat!!.format(Date()),
"",
editUserMessage.text.toString().trim { it <= ' ' },
recordingFilePath!!,
duration
)
editUserMessage.setText("")
this@ChatInputComponent.onSendMessage?.let { it(chatDataItem) }
}

View File

@ -118,14 +118,16 @@
android:padding="12dp"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="50dp">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="100dp">
<RelativeLayout
android:id="@+id/btn_voice_recording"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:layout_height="50dp"
android:visibility="visible"
tools:visibility="visible"
>
<TextView
android:layout_width="wrap_content"
@ -208,7 +210,7 @@
android:visibility="gone" />
</FrameLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/layout_more_menu"
android:layout_width="match_parent"
@ -255,6 +257,7 @@
android:visibility="gone"
tools:visibility="visible"
android:textColor="?colorOnSurface"
android:background="@color/semi_transparent_gray"
tools:text="@string/release_to_send" />
<RelativeLayout

View File

@ -28,7 +28,7 @@
<color name="color_on_surface_variant">#666666</color>
<color name="color_disabled">#888888</color>
<color name="semi_transparent_gray">#80888888</color>
</resources>

View File

@ -2,8 +2,7 @@ cd ../../../project/android
rm -rf build_64
mkdir -p build_64
cd build_64
../build_64.sh "-DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DMNN_ARM82=true -DMNN_USE_LOGCAT=true -DMNN_OPENCL=true -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_BUILD_DIFFUSION=ON -DMNN_SEP_BUILD=OFF"
mkdir -p ../../../apps/Android/MnnLlmChat/app/src/main/jniLibs/arm64-v8a
find . -name "*.so" -exec cp {} ../../../apps/Android/MnnLlmChat/app/src/main/jniLibs/arm64-v8a \;
../build_64.sh "-DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true -DMNN_ARM82=true -DMNN_USE_LOGCAT=true -DMNN_OPENCL=true -DLLM_SUPPORT_VISION=true -DMNN_BUILD_OPENCV=true -DMNN_IMGCODECS=true -DLLM_SUPPORT_AUDIO=true -DMNN_BUILD_AUDIO=true -DMNN_BUILD_DIFFUSION=ON -DMNN_SEP_BUILD=OFF -DCMAKE_INSTALL_PREFIX=."
make install
cd ../../../apps/Android/MnnLlmChat/
./gradlew assembleDebug

View File

@ -25,9 +25,9 @@ if (MNN_KLEIDIAI)
set(KLEIDIAI_BUILD_TESTS OFF)
# Fetch KleidiAI sources:
include(FetchContent)
set(KLEIDIAI_COMMIT_SHA "v1.7.0")
set(KLEIDIAI_COMMIT_SHA "v1.9.0")
set(KLEIDIAI_DOWNLOAD_URL "https://gitlab.arm.com/kleidi/kleidiai/-/archive/${KLEIDIAI_COMMIT_SHA}/kleidiai-${KLEIDIAI_COMMIT_SHA}.tar.gz")
set(KLEIDIAI_ARCHIVE_MD5 "f57f809096e57e93e9df6a2ac5686218")
set(KLEIDIAI_ARCHIVE_MD5 "e4c9fcb5de397ba3532d593672d56e95")
if (POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)