Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Modular Converter on Windows #34266

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hlky
Copy link
Contributor

@hlky hlky commented Oct 20, 2024

What does this PR do?

This PR fixes some issues with Modular Converter on Windows.

  1. Relative path regex. rf"(src{os.sep}transformers{os.sep}.*|examples{os.sep}.*)" results in (src\transformers\.*|examples\.*), due to \t and \. this regex fails, we use \\ here instead.
  2. Relative path in auto generated message. On Windows this generates as This file was automatically generated from src\transformers\models\florence2\modular_florence2.py. This could potentially cause issues elsewhere, and it's better to be standardized, so when os.sep == \ we replace os.sep with /.
  3. open encoding. On Windows the default encoding is cp1252 which doesn't work with 🚨, so we use encoding=utf-8 instead for all open. This particular fix is in effect in many other places in the codebase.

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker

@hlky
Copy link
Contributor Author

hlky commented Oct 20, 2024

Please note the test failure here is unrelated, looks like modeling_glm needs to be overwritten with modular generated code.

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.

1 participant