Fix export_models.py with predownloaded models#3836
Conversation
| ### Export model | ||
| 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')): | ||
| print("OV model is source folder. Skipping conversion.") | ||
| model_path = source_model |
There was a problem hiding this comment.
My recollection is that this condition was for the scenario of source model from NFS storage with RO access. That was to be absolute path.
There was a problem hiding this comment.
Right now when used for 1st time script pull the model:
python ~/git_repos/ovms1/demos/common/export_models/export_model.py text_generation --source_model Qwen/Qwen3-8B --weight-format int8 --model_repository_path ./ --tool_parser hermes3 --overwrite_models --enable_prefix_caching
Then in ./config.json we have "base_path": "Qwen/Qwen3-8B", and in graph.pbtxt : models_path: "./",. After second launch in graph.pbtxt we have: models_path: "Qwen/Qwen3-8B",, which fails since it would require graph.pbtxt to be in: ````./Qwen/Qwen3-8B/Qwen/Qwen3-8B/``` directory.
Additionally when launched with slightly different command (just going 1 step above in directory tree):
python ~/git_repos/ovms1/demos/common/export_models/export_model.py text_generation --source_model Qwen/Qwen3-8B --weight-format int8 --model_repository_path ./models3 --tool_parser hermes3 --overwrite_models --enable_prefix_caching
This works fine (paths in graph.pbtxt are fine).
Either way we would need a way to tell when to create graph.pbtxt in separate directory tree (with RW).
Script when launched for second time had different (wrong) paths in graph.pbtxt because xml/bin files already exist.
Ticket:CVS-177562