mirror of https://github.com/alibaba/MNN.git
Compare commits
10 Commits
56612fc663
...
e1fbb944ea
| Author | SHA1 | Date |
|---|---|---|
|
|
e1fbb944ea | |
|
|
5f35d621e1 | |
|
|
9f67942227 | |
|
|
556193970a | |
|
|
2e8c49e5a8 | |
|
|
0ee1354714 | |
|
|
86c1365a50 | |
|
|
08f9692200 | |
|
|
9a56fe323e | |
|
|
a7e97ff798 |
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class ModelFileDownloader {
|
|||
)
|
||||
)
|
||||
}
|
||||
if (response.code == 302 || response.code == 303) {
|
||||
if (response.code in 301..308) {
|
||||
theUrlToDownload = response.header("Location")!!
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue