From 5d84c1a03f18727199178456fd5a057ca48ecf0b Mon Sep 17 00:00:00 2001 From: mzegla Date: Fri, 24 Jan 2025 13:46:58 +0100 Subject: [PATCH] init --- demos/common/export_models/export_model.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/demos/common/export_models/export_model.py b/demos/common/export_models/export_model.py index 878fe0c5a1..5929203233 100644 --- a/demos/common/export_models/export_model.py +++ b/demos/common/export_models/export_model.py @@ -253,13 +253,9 @@ def export_text_generation_model(model_repository_path, source_model, model_name llm_model_path = os.path.join(model_repository_path, model_name) print("Exporting LLM model to ", llm_model_path) if not os.path.isdir(llm_model_path) or args['overwrite_models']: - optimum_command = "optimum-cli export openvino --disable-convert-tokenizer --model {} --weight-format {} --trust-remote-code {}".format(source_model, precision, llm_model_path) + optimum_command = "optimum-cli export openvino --model {} --weight-format {} --trust-remote-code {}".format(source_model, precision, llm_model_path) if os.system(optimum_command): raise ValueError("Failed to export llm model", source_model) - print("Exporting tokenizer to ", llm_model_path) - convert_tokenizer_command = "convert_tokenizer --utf8_replace_mode replace --with-detokenizer --skip-special-tokens --streaming-detokenizer -o {} {}".format(llm_model_path, source_model) - if (os.system(convert_tokenizer_command)): - raise ValueError("Failed to export tokenizer model", source_model) os.makedirs(os.path.join(model_repository_path, model_name), exist_ok=True) gtemplate = jinja2.Environment(loader=jinja2.BaseLoader).from_string(text_generation_graph_template) graph_content = gtemplate.render(tokenizer_model="{}_tokenizer_model".format(model_name), embeddings_model="{}_embeddings_model".format(model_name), model_path=model_path, **task_parameters)