Skip to content

Commit 75dcaa6

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Fix torchchat model not working on demo apps (#3668)
Summary: As titled fix pytorch/torchchat#810 Pull Request resolved: #3668 Test Plan: Use torchchat to export llama3 pte file, run it in executorch, see it running Reviewed By: kirklandsign Differential Revision: D57678514 Pulled By: larryliu0820 fbshipit-source-id: 73437a8b2e4aeeb562e3b1bd53d0fe1411d81456
1 parent c3b423c commit 75dcaa6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.ci/scripts/test_llama.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ which "${PYTHON_EXECUTABLE}"
6868
cmake_install_executorch_libraries() {
6969
echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a"
7070
rm -rf cmake-out
71-
retry cmake -DBUCK2="$BUCK" \
71+
retry cmake \
7272
-DCMAKE_INSTALL_PREFIX=cmake-out \
7373
-DCMAKE_BUILD_TYPE=Debug \
7474
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
@@ -85,7 +85,7 @@ cmake_install_executorch_libraries() {
8585
cmake_build_llama_runner() {
8686
echo "Building llama runner"
8787
dir="examples/models/llama2"
88-
retry cmake -DBUCK2="$BUCK" \
88+
retry cmake \
8989
-DCMAKE_INSTALL_PREFIX=cmake-out \
9090
-DCMAKE_BUILD_TYPE=Debug \
9191
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \

examples/models/llama2/runner/runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Error Runner::load() {
7676
n_bos_ = getMetadataHelper<int64_t>("get_n_bos", 1);
7777
n_eos_ = getMetadataHelper<int64_t>("get_n_eos", 1);
7878
max_seq_len_ = getMetadataHelper<int64_t>("get_max_seq_len", 128);
79-
use_kv_cache_ = getMetadataHelper("use_kv_cache", false);
79+
use_kv_cache_ = getMetadataHelper("use_kv_cache", true);
8080
use_sdpa_with_kv_cache_ = getMetadataHelper("use_sdpa_with_kv_cache", false);
8181
append_eos_ = getMetadataHelper("append_eos_to_prompt", false);
8282

0 commit comments

Comments
 (0)