Skip to content

Commit

Permalink
[llama3.2] fix wrong vocab size
Browse files Browse the repository at this point in the history
  • Loading branch information
sgwzy22 committed Nov 11, 2024
1 parent 71bcf9c commit ce885a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion models/Llama3_2-Vision/compile/export_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
NUM_ATTENTION_HEADS = config.text_config.num_attention_heads
NUM_KEY_VALUE_HEADS = config.text_config.num_key_value_heads
HEAD_DIM = HIDDEN_SIZE // NUM_ATTENTION_HEADS
VOCAB_SIZE = config.text_config.hidden_size
VOCAB_SIZE = config.text_config.vocab_size
CROSS_ATTN_LAYERS = config.text_config.cross_attention_layers
print(f'\nLLM config:\n\
Layers: {NUM_LAYERS}\n\
Expand Down
4 changes: 3 additions & 1 deletion models/Llama3_2-Vision/python_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ if (NOT DEFINED TARGET_ARCH)
set(TARGET_ARCH pcie)
endif()

set(CMAKE_CXX_STANDARD 17)

include_directories(${PROJECT_SOURCE_DIR}/../../../support/include)

if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
Expand All @@ -17,7 +19,7 @@ elseif (${TARGET_ARCH} STREQUAL "pcie")
message("PCIE mode, starting......")
endif()

add_definitions(-DDEBUG --std=c++17 -fPIC -Wall -Werror)
add_definitions(-DDEBUG -fPIC -Wall -Werror)
set(CMAKE_BUILD_TYPE "Debug")

find_package(pybind11 REQUIRED CONFIG)
Expand Down
3 changes: 1 addition & 2 deletions models/Llama3_2-Vision/python_demo/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ def stream_answer(self, inputs):

self.answer_token += full_word_tokens
print(word, flush=True, end="")
if tok_num > self.model.max_new_tokens and word == '.':
break

token = self.model.forward_next()
tok_num += 1
full_word_tokens = []
Expand Down
6 changes: 4 additions & 2 deletions models/Qwen2_5/python_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
cmake_minimum_required(VERSION 3.10)
project(qwen2)
project(qwen2_5)

if (NOT DEFINED TARGET_ARCH)
set(TARGET_ARCH pcie)
endif()

set(CMAKE_CXX_STANDARD 17)

include_directories(${PROJECT_SOURCE_DIR}/../support/include)

if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
Expand All @@ -17,7 +19,7 @@ elseif (${TARGET_ARCH} STREQUAL "pcie")
message("PCIE mode, starting......")
endif()

add_definitions(-DDEBUG --std=c++17 -fPIC -Wall -Werror)
add_definitions(-DDEBUG -fPIC -Wall -Werror)
set(CMAKE_BUILD_TYPE "Debug")

find_package(pybind11 REQUIRED CONFIG)
Expand Down

0 comments on commit ce885a3

Please sign in to comment.