Skip to content

Conversation

@gramalingam
Copy link
Collaborator

This copilot-suggested fix enabled converting a recent onnx model to onnxscript.

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.09%. Comparing base (70abdd9) to head (c494888).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnxscript/backend/onnx_export.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2747      +/-   ##
==========================================
- Coverage   70.10%   70.09%   -0.01%     
==========================================
  Files         228      228              
  Lines       27394    27385       -9     
  Branches     2781     2783       +2     
==========================================
- Hits        19204    19195       -9     
+ Misses       7234     7231       -3     
- Partials      956      959       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

try:
return s.decode("utf-8")
except UnicodeDecodeError:
return s.decode("latin1") # or "cp1252" or other fallback
Copy link
Collaborator

@justinchuby justinchuby Dec 27, 2025

Choose a reason for hiding this comment

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

I have seen cases where the string attributes iare used to store binary data (e.g. in the custom Tokenizer op, even though this is invalid onnx). Is this trying to address those cases? If so, I would simply preserve the b-string to avoid accidental modifications.

Related: onnx/ir-py#184

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know. All I know is that this enabled me to convert a recent model (Word Fluency) into onnxscript so that I could see the control-flow structure of the model in a compact readable format. I don't mind alternatives if they allow me to do this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right - that's the same model I looked at. Making a suggestion

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you try the current change?

Updated string decoding logic and attribute value check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants