Skip to content

fix: TFLite model retrieval with error handling#19347

Merged
tlopex merged 2 commits intoapache:mainfrom
rknastenka:bug-Model.Model
Apr 4, 2026
Merged

fix: TFLite model retrieval with error handling#19347
tlopex merged 2 commits intoapache:mainfrom
rknastenka:bug-Model.Model

Conversation

@rknastenka
Copy link
Copy Markdown
Contributor

closes #19346

Handle AttributeError when retrieving TFLite model.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the TFLite frontend tests to handle version-specific differences in the TFLite library by adding a fallback for the GetRootAsModel function. The review feedback suggests using an explicit hasattr check instead of a try-except block to avoid masking internal errors and notes a PEP 8 violation regarding trailing whitespace.

Copy link
Copy Markdown
Member

@tlopex tlopex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this!

@tlopex tlopex merged commit 78b7286 into apache:main Apr 4, 2026
6 checks passed
@rknastenka rknastenka deleted the bug-Model.Model branch April 4, 2026 15:57
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.

[Bug][TFLite][Relax] relax/test_frontend_tflite.py fails with AttributeError: type object 'Model' has no attribute 'Model'

2 participants