Skip to content

Commit

Permalink
fix:add tokenizer for arctic in inference_example
Browse files Browse the repository at this point in the history
  • Loading branch information
lausannel committed Apr 27, 2024
1 parent fb780d5 commit 5b3471e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/interface_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import multiprocessing as mp
from transformers import AutoTokenizer, TextStreamer
from moe_infinity import MoE
from moe_infinity.models.arctic import ArcticTokenizer

parser = argparse.ArgumentParser()
parser.add_argument("--model_name_or_path", type=str, required=True)
Expand All @@ -20,7 +21,11 @@

model_name = args.model_name_or_path.split("/")[-1]

tokenizer = AutoTokenizer.from_pretrained(args.model_name_or_path)
tokenizer = None
if "arctic" in args.model_name_or_path.lower():
tokenizer = ArcticTokenizer.from_pretrained(args.model_name_or_path)
else:
tokenizer = AutoTokenizer.from_pretrained(args.model_name_or_path)
streamer = TextStreamer(tokenizer)

dataset_name = "tasksource/bigbench"
Expand Down

0 comments on commit 5b3471e

Please sign in to comment.