Skip to content

Commit 3127325

Browse files
authored
Add gptoss & qwen3coder tool_parser to export_model (#3716)
JIRA:CVS-175389
1 parent 4236db5 commit 3127325

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ci/build_test_OnCommit.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ pipeline {
3131
} else { // branches without PR - check changes in last commit
3232
git_diff = sh (script: "git diff --name-only HEAD^..HEAD", returnStdout: true).trim()
3333
}
34-
def matched = (git_diff =~ /src|export_models|third_party|external|(\n|^)Dockerfile|(\n|^)Makefile|\.c|\.h|\.bazel|\.bzl|\.groovy|BUILD|create_package\.sh|WORKSPACE|(\n|^)run_unit_tests\.sh/)
34+
def matched = (git_diff =~ /src|third_party|external|(\n|^)Dockerfile|(\n|^)Makefile|\.c|\.h|\.bazel|\.bzl|\.groovy|BUILD|create_package\.sh|WORKSPACE|(\n|^)run_unit_tests\.sh/)
3535
if (matched){
3636
image_build_needed = "true"
3737
}
3838
matched = (git_diff =~ /(\n|^)client/)
3939
if (matched){
4040
client_test_needed = "true"
4141
}
42-
def win_matched = (git_diff =~ /src|export_models|third_party|external|ci|\.c|\.h|\.bazel|\.bzl|BUILD|WORKSPACE|\.bat|\.groovy/)
42+
def win_matched = (git_diff =~ /src|third_party|external|ci|\.c|\.h|\.bazel|\.bzl|BUILD|WORKSPACE|\.bat|\.groovy/)
4343
if (win_matched){
4444
win_image_build_needed = "true"
4545
}

demos/common/export_models/export_model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def add_common_arguments(parser):
5252
parser_text.add_argument('--max_prompt_len', required=False, type=int, default=None, help='Sets NPU specific property for maximum number of tokens in the prompt. '
5353
'Not effective if target device is not NPU', dest='max_prompt_len')
5454
parser_text.add_argument('--prompt_lookup_decoding', action='store_true', help='Set pipeline to use prompt lookup decoding', dest='prompt_lookup_decoding')
55-
parser_text.add_argument('--reasoning_parser', choices=["qwen3"], help='Set the type of the reasoning parser for reasoning content extraction', dest='reasoning_parser')
56-
parser_text.add_argument('--tool_parser', choices=["llama3", "phi4", "hermes3", "mistral"], help='Set the type of the tool parser for tool calls extraction', dest='tool_parser')
55+
parser_text.add_argument('--reasoning_parser', choices=["qwen3", "gptoss"], help='Set the type of the reasoning parser for reasoning content extraction', dest='reasoning_parser')
56+
parser_text.add_argument('--tool_parser', choices=["llama3", "phi4", "hermes3", "mistral", "qwen3coder", "gptoss"], help='Set the type of the tool parser for tool calls extraction', dest='tool_parser')
5757
parser_text.add_argument('--enable_tool_guided_generation', action='store_true', help='Enables enforcing tool schema during generation. Requires setting tool_parser', dest='enable_tool_guided_generation')
5858

5959
parser_embeddings = subparsers.add_parser('embeddings', help='[deprecated] export model for embeddings endpoint with models split into separate, versioned directories')
@@ -390,6 +390,10 @@ def add_servable_to_config(config_path, model_name, base_path):
390390

391391
def export_text_generation_model(model_repository_path, source_model, model_name, precision, task_parameters, config_file_path):
392392
model_path = "./"
393+
# validation for tool parsing
394+
if (task_parameters.get('tool_parser', None) == 'gptoss' or task_parameters.get('reasoning_parser', None) == 'gptoss'):
395+
if (task_parameters.get('tool_parser', None) != task_parameters.get('reasoning_parser', None)):
396+
raise ValueError("Both tool_parser and reasoning_parser need to be set to gptoss when one of them is set to gptoss")
393397
### Export model
394398
if os.path.isfile(os.path.join(source_model, 'openvino_model.xml')) or os.path.isfile(os.path.join(source_model, 'openvino_language_model.xml')):
395399
print("OV model is source folder. Skipping conversion.")

0 commit comments

Comments
 (0)