Skip to content

Commit

Permalink
Add Subfolder Argument to CLI (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
apaniukov authored Feb 27, 2024
1 parent 930a3d3 commit 6b9fa42
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion python/openvino_tokenizers/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ def get_parser() -> ArgumentParser:
action="store_true",
help="Add a detokenizer model to the output",
)
parser.add_argument(
"--subfolder",
required=False,
type=str,
default="",
help=(
"Specify in case the tokenizer files are located inside a subfolder of the model repo on huggingface.co. "
"Example: `convert_tokenizer SimianLuo/LCM_Dreamshaper_v7 --subfolder tokenizer`"
),
)
parser.add_argument(
"--skip-special-tokens",
"--skip_special_tokens",
Expand Down Expand Up @@ -139,7 +149,7 @@ def convert_hf_tokenizer() -> None:
args = get_parser().parse_args()

print("Loading Huggingface Tokenizer...")
hf_tokenizer = AutoTokenizer.from_pretrained(args.name, trust_remote_code=args.trust_remote_code)
hf_tokenizer = AutoTokenizer.from_pretrained(args.name, subfolder=args.subfolder, trust_remote_code=args.trust_remote_code)

print("Converting Huggingface Tokenizer to OpenVINO...")
converted = convert_tokenizer(
Expand Down

0 comments on commit 6b9fa42

Please sign in to comment.