Skip to content

Commit af68d95

Browse files
committed
Migrate qualcomm's llama.py to use the new tokenizer
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 8443073 commit af68d95

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.ci/scripts/test_qnn_static_llama.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# This source code is licensed under the BSD-style license found in the
66
# LICENSE file in the root directory of this source tree.
77

8-
set -exu
8+
set -euxo pipefail
99

1010
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1111

@@ -56,4 +56,3 @@ if [ $exit_code1 -ne 0 ] || [ $exit_code2 -ne 0 ]; then
5656
else
5757
exit 0
5858
fi
59-
set -e

examples/qualcomm/oss_scripts/llama/llama.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@
7575
from executorch.exir.passes.memory_planning_pass import MemoryPlanningPass
7676
from executorch.extension.llm.custom_ops import model_sharding
7777
from executorch.extension.llm.export.builder import DType
78-
from executorch.extension.llm.tokenizer.tokenizer import (
79-
Tokenizer as SentencePieceTokenizer,
80-
)
81-
from executorch.extension.llm.tokenizer.utils import get_tokenizer
78+
from pytorch_tokenizers import get_tokenizer
79+
from pytorch_tokenizers.llama2c import Llama2cTokenizer as SentencePieceTokenizer
8280

8381
from torch.ao.quantization.observer import MinMaxObserver
8482
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e

0 commit comments

Comments
 (0)