Skip to content

Commit

Permalink
refactor llm project to retain the previous interfaces for backward c…
Browse files Browse the repository at this point in the history
…ompatibility
  • Loading branch information
huangzhengxiang committed Nov 6, 2024
1 parent 0be9c8e commit f3dcb29
Show file tree
Hide file tree
Showing 139 changed files with 537 additions and 2,436 deletions.
11 changes: 6 additions & 5 deletions docs/transformers/llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,25 +228,26 @@ sh package_scripts/ios/buildiOS.sh "-DMNN_ARM82=true -DMNN_LOW_MEMORY=true -DMNN
```

#### 推理用法
`chat_demo`的用法如下:
`llm_demo`的用法如下:
pc端直接推理
```
# 使用config.json
## 交互式聊天
./chat_demo model_dir/config.json
./llm_demo model_dir/config.json
## 针对prompt中的每行进行回复
./chat_demo model_dir/config.json prompt.txt
./llm_demo model_dir/config.json prompt.txt

# 不使用config.json, 使用默认配置
## 交互式聊天
./chat_demo model_dir/llm.mnn
./llm_demo model_dir/llm.mnn
## 针对prompt中的每行进行回复
./chat_demo model_dir/llm.mnn prompt.txt
./llm_demo model_dir/llm.mnn prompt.txt
```
手机端adb推理用法:
```bash
# 利用adb push将链接库push到手机上
adb shell mkdir /data/local/tmp/llm
adb push chat_demo libllm.so libMNN_CL.so libMNN_Express.so libMNN.so tools/cv/libMNNOpenCV.so /data/local/tmp/llm
```

Expand Down
9 changes: 3 additions & 6 deletions transformers/llm/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ else()
add_library(llm OBJECT ${SRCS})
endif()

# add_executable(llm_demo ${CMAKE_CURRENT_LIST_DIR}/ llm_demo.cpp)
add_executable(chat_demo ${CMAKE_CURRENT_LIST_DIR}/app/chat_demo.cpp)
add_executable(llm_demo ${CMAKE_CURRENT_LIST_DIR}/app/llm_demo.cpp)
IF (NOT MNN_SEP_BUILD)
# target_link_libraries(llm_demo ${MNN_DEPS})
target_link_libraries(chat_demo ${MNN_DEPS})
target_link_libraries(llm_demo ${MNN_DEPS})
ELSE ()
# target_link_libraries(llm_demo ${MNN_DEPS} llm)
target_link_libraries(chat_demo ${MNN_DEPS} llm)
target_link_libraries(llm_demo ${MNN_DEPS} llm)
ENDIF ()
3 changes: 0 additions & 3 deletions transformers/llm/engine/android/app/.gitignore

This file was deleted.

32 changes: 0 additions & 32 deletions transformers/llm/engine/android/app/CMakeLists.txt

This file was deleted.

72 changes: 0 additions & 72 deletions transformers/llm/engine/android/app/build.gradle

This file was deleted.

21 changes: 0 additions & 21 deletions transformers/llm/engine/android/app/proguard-rules.pro

This file was deleted.

30 changes: 0 additions & 30 deletions transformers/llm/engine/android/app/src/main/AndroidManifest.xml

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f3dcb29

Please sign in to comment.