Skip to content

Commit 324f04d

Browse files
author
LittleMouse
committed
[update] update llm-vlm version & model config
1 parent 0d3e36f commit 324f04d

File tree

8 files changed

+26
-13
lines changed

8 files changed

+26
-13
lines changed

projects/llm_framework/main_cosy_voice/src/runner/Tokenizer/Tokenizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class Tokenizer_Http : public BaseTokenizer {
389389
bool Init(std::string model_path = "http://localhost:8080") override
390390
{
391391
base_url = model_path;
392-
if (!test_connect_http(base_url, 10)) {
392+
if (!test_connect_http(base_url, 20)) {
393393
ALOGE("connect %s failed", base_url.c_str());
394394
return false;
395395
} else {

projects/llm_framework/main_llm/src/runner/Tokenizer/Tokenizer.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,17 @@ class Tokenizer_Http : public BaseTokenizer {
349349
bool Init(std::string model_path = "http://localhost:8080", bool b_bos = true, bool b_eos = false) override
350350
{
351351
base_url = model_path;
352+
if (!test_connect_http(base_url, 20)) {
353+
ALOGE("connect %s failed", base_url.c_str());
354+
return false;
355+
} else {
356+
ALOGI("connect %s ok", base_url.c_str());
357+
}
352358
try {
353359
cli = std::make_shared<httplib::Client>(base_url);
354-
cli->set_connection_timeout(1);
355-
cli->set_read_timeout(1);
356-
cli->set_write_timeout(1);
360+
cli->set_connection_timeout(10);
361+
cli->set_read_timeout(10);
362+
cli->set_write_timeout(10);
357363
{
358364
auto ret = cli->Get("/bos_id");
359365
auto rep = ret.value();
@@ -389,7 +395,7 @@ class Tokenizer_Http : public BaseTokenizer {
389395
bool Init(std::string model_path = "http://localhost:8080") override
390396
{
391397
base_url = model_path;
392-
if (!test_connect_http(base_url, 10)) {
398+
if (!test_connect_http(base_url, 20)) {
393399
ALOGE("connect %s failed", base_url.c_str());
394400
return false;
395401
} else {

projects/llm_framework/main_vlm/SConstruct

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ LDFLAGS = []
1717
LINK_SEARCH_PATH = []
1818
STATIC_FILES = []
1919

20-
python_venv = check_wget_down("https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/linux/llm/m5stack_llm-vlm-python-venv_v1.6.tar.gz", 'm5stack_llm-vlm-python-venv_v1.6.tar.gz')
20+
if 'CONFIG_AX_620E_MSP_ENABLED' in os.environ:
21+
python_venv = check_wget_down("https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/linux/llm/m5stack_llm-vlm-python-venv_v1.6.tar.gz", 'm5stack_llm-vlm-python-venv_v1.6.tar.gz')
22+
else:
23+
python_venv = check_wget_down("https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/linux/llm/m5stack_llm-vlm-python-venv_v1.7.tar.gz", 'm5stack_llm-vlm-python-venv_v1.7.tar.gz')
2124

2225
DEFINITIONS += ['-O2']
2326
DEFINITIONS += ['-std=c++17']
@@ -73,7 +76,7 @@ ignore['ignore'] = list(set(ignore['ignore']))
7376
with open('../dist/fileignore', 'w') as f:
7477
json.dump(ignore, f, indent=4)
7578

76-
env['COMPONENTS'].append({'target':'llm_vlm-1.9',
79+
env['COMPONENTS'].append({'target':'llm_vlm-1.10',
7780
'SRCS':SRCS,
7881
'INCLUDE':INCLUDE,
7982
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,

projects/llm_framework/main_vlm/models/mode_qwen3-vl-2B-Int4-ax650.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"video_token_id": 151656,
4747
"vision_start_token_id": 151652,
4848
"precompute_len": 0,
49-
"cmm_size": 1919044,
49+
"cmm_size": 3582336,
5050
"ext_scripts": [
5151
"tokenizer_qwen3-vl-2B-Int4-ax650.py"
5252
]

projects/llm_framework/main_vlm/src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,15 @@ class llm_task {
480480
std::vector<std::vector<unsigned short>> all_embeds;
481481
if (auto ret = lLaMa_ctx_->Encode(mats, all_embeds); ret != 0) {
482482
ALOGE("lLaMaCtx.Encode failed");
483+
if (out_callback_) out_callback_("Encode failed", true);
483484
return;
484485
}
485486
mats.clear();
486487
if (auto ret =
487488
lLaMa_ctx_->Encode(all_embeds, prompt_data_, prompt_complete(msg), tokens_ids, tokens_diff);
488489
ret != 0) {
489490
ALOGE("lLaMaCtx.Encode failed");
491+
if (out_callback_) out_callback_("Encode failed", true);
490492
return;
491493
}
492494
if (auto ret = lLaMa_ctx_->SetKVCache(k_caches, v_caches, precompute_len, tokens_diff.size());

projects/llm_framework/main_vlm/src/runner/LLM.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <algorithm>
44
#include <cmath>
55
#include <numeric>
6+
#include <atomic>
7+
68
#include "bfloat16.hpp"
79
#include "image_processor.hpp"
810
#include "mrope.hpp"
@@ -49,7 +51,7 @@ struct LLMAttrType {
4951
TokenizerType tokenizer_type = TKT_LLaMa;
5052
std::string filename_tokenizer_model = "tokenizer.model";
5153
std::string url_tokenizer_model;
52-
bool b_bos = true;
54+
bool b_bos = false;
5355
bool b_eos = false;
5456
std::string filename_tokens_embed = "tinyllama.model.embed_tokens.weight.bfloat16.bin";
5557
int tokens_embed_num = 32000;

projects/llm_framework/main_vlm/src/runner/Tokenizer/Tokenizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Tokenizer_Http : public BaseTokenizer {
2525
bool Init(std::string model_path) override
2626
{
2727
base_url = model_path;
28-
if (!test_connect_http(base_url, 10)) {
28+
if (!test_connect_http(base_url, 20)) {
2929
ALOGE("connect %s failed", base_url.c_str());
3030
return false;
3131
} else {
@@ -153,7 +153,7 @@ class Tokenizer_Http : public BaseTokenizer {
153153
bool Init(std::string model_path = "http://localhost:8080", bool b_bos = true, bool b_eos = false) override
154154
{
155155
base_url = model_path;
156-
if (!test_connect_http(base_url, 10)) {
156+
if (!test_connect_http(base_url, 30)) {
157157
ALOGE("connect %s failed", base_url.c_str());
158158
return false;
159159
} else {
@@ -200,7 +200,7 @@ class Tokenizer_Http : public BaseTokenizer {
200200
bool Init_new(std::string model_path, bool b_bos, bool b_eos) override
201201
{
202202
base_url = model_path;
203-
if (!test_connect_http(base_url, 10)) {
203+
if (!test_connect_http(base_url, 30)) {
204204
ALOGE("connect %s failed", base_url.c_str());
205205
return false;
206206
} else {

projects/llm_framework/tools/llm_pack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def create_bin_deb(package_name, version, src_folder, revision = 'm5stack1', dep
381381
'llm-tts':[create_bin_deb,'llm-tts', '1.6', src_folder, revision],
382382
'llm-melotts':[create_bin_deb,'llm-melotts', '1.9', src_folder, revision],
383383
'llm-camera':[create_bin_deb,'llm-camera', '1.9', src_folder, revision, 'lib-llm'],
384-
'llm-vlm':[create_bin_deb,'llm-vlm', '1.9', src_folder, revision],
384+
'llm-vlm':[create_bin_deb,'llm-vlm', '1.10', src_folder, revision],
385385
'llm-yolo':[create_bin_deb,'llm-yolo', '1.9', src_folder, revision],
386386
'llm-skel':[create_bin_deb,'llm-skel', version, src_folder, revision],
387387
'llm-depth-anything':[create_bin_deb,'llm-depth-anything', '1.7', src_folder, revision],

0 commit comments

Comments
 (0)