Skip to content

Fix OpenVINO inference engine integration issues from PR #38#50

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/review-pr-38
Draft

Fix OpenVINO inference engine integration issues from PR #38#50
Copilot wants to merge 7 commits intomainfrom
copilot/review-pr-38

Conversation

Copy link

Copilot AI commented Feb 3, 2026

PR #38 added OpenVINO inference support but had critical bugs preventing functionality and several safety issues.

Critical Fixes

Config path bug: _init_config() read from cfg.get("engine_cfg", {}) instead of cfg directly, causing all YAML settings to be ignored:

# Before: settings never applied
engine_cfg = cfg.get("engine_cfg", {})  # Wrong nesting
_set("PERFORMANCE_HINT", engine_cfg.get("performance_hint"))

# After: reads from correct path
_set("PERFORMANCE_HINT", cfg.get("performance_hint"))

Missing import: os.cpu_count() used without importing os, causing immediate NameError.

None injection: _set() with lambda cast could add None values to OpenVINO config dict:

# Before: could set config["INFERENCE_NUM_THREADS"] = None
config[k] = cast(v)  

# After: guards against None
casted_value = cast(v)
if casted_value is not None:
    config[k] = casted_value

Safety Improvements

  • Guard os.cpu_count() returning None before min() comparison
  • have_key() now checks "framework" level consistently with get_character_list()
  • Specific exception handling (AttributeError, TypeError, KeyError) instead of bare except
  • Defensive attribute access with hasattr/getattr before calling .value.splitlines()
  • Safe .get() pattern throughout to prevent KeyError

Style Fixes

  • YAML indentation: 2-space → 4-space to match onnxruntime block
  • Consistent single-line _set() calls except where lambda spans multiple lines
  • EOF newline in __init__.py

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 3, 2026 10:55
…on, fix have_key method, fix YAML indentation

Co-authored-by: SWHL <28639377+SWHL@users.noreply.github.com>
…tation

Co-authored-by: SWHL <28639377+SWHL@users.noreply.github.com>
Co-authored-by: SWHL <28639377+SWHL@users.noreply.github.com>
Co-authored-by: SWHL <28639377+SWHL@users.noreply.github.com>
Copilot AI changed the title [WIP] Review pull request for changes in RapidLayout Fix OpenVINO inference engine integration issues from PR #38 Feb 3, 2026
Copilot AI requested a review from SWHL February 3, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants