Skip to content

Commit

Permalink
Write Detailed Version To XML
Browse files Browse the repository at this point in the history
Write a version with commit hash instead of pip version to openvino_tokenizer.xml
  • Loading branch information
apaniukov committed Jan 16, 2025
1 parent 708712d commit 124b6dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/openvino_tokenizers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
from functools import lru_cache
from typing import Any, Dict, Optional, Sequence, Tuple, Union

import openvino
from openvino import Model, Type
from openvino.preprocess import PrePostProcessor
from openvino.runtime import opset12 as opset

from __version__ import __version__ as openvino_tokenizers_version
from .constants import (
LOGITS_OUTPUT_NAME,
ORIGINAL_TOKENIZER_CLASS_NAME,
Expand Down Expand Up @@ -244,7 +246,11 @@ def update_rt_info_with_environment(ov_tokenizer: Model) -> None:
:param ov_tokenizer: Thes OpenVINO tokenizer model to update.
:type ov_tokenizer: openvino.Model
"""
packages = ["openvino_tokenizers", "transformers", "tiktoken", "sentencepiece", "openvino", "tokenizers"]
ov_tokenizer.set_rt_info(openvino.get_version(), f"openvino_version")
ov_tokenizer.set_rt_info(openvino_tokenizers_version, f"openvino_tokenizers_version")

packages = ["transformers", "tiktoken", "sentencepiece", "tokenizers"]

for name in packages:
version = get_package_version(name)
if version is not None:
Expand Down

0 comments on commit 124b6dc

Please sign in to comment.