Skip to content

Commit

Permalink
Merge pull request #2557 from kevincheng2/develop
Browse files Browse the repository at this point in the history
[LLM] update code with paddlenlp
  • Loading branch information
juncaipeng authored Nov 18, 2024
2 parents 30c8cdc + 19ff58d commit 3bb05ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions llm/server/server/data/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from abc import ABC, abstractmethod

from paddlenlp.transformers import Llama3Tokenizer, LlamaTokenizer
from paddlenlp.utils.llm_utils import get_eos_token_id
from paddlenlp.trl.llm_utils import get_eos_token_id
from server.engine.config import Config
from server.utils import data_processor_logger

Expand Down Expand Up @@ -282,7 +282,7 @@ def _load_tokenizer(self):
"""
if self.config.use_hf_tokenizer:
from transformers import AutoTokenizer
return AutoTokenizer.from_pretrained(self.config.model_dir, use_fast=False)
return AutoTokenizer.from_pretrained(self.config.model_dir, use_fast=False, vocab_file=os.path.join(self.config.model_dir, "sentencepiece.bpe.model"))
else:
from paddlenlp.transformers import AutoTokenizer
return AutoTokenizer.from_pretrained(self.config.model_dir)
Expand Down
2 changes: 1 addition & 1 deletion llm/server/server/engine/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import paddle
import paddle.distributed as dist
import paddle.distributed.fleet as fleet
from paddlenlp.utils.llm_utils import get_rotary_position_embedding
from paddlenlp.trl.llm_utils import get_rotary_position_embedding
from paddlenlp_ops import step_paddle
from server.data.processor import DataProcessor
from server.engine.config import Config
Expand Down

0 comments on commit 3bb05ac

Please sign in to comment.