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

Broken check_characters.py #3599

Closed
lissyx opened this issue Apr 2, 2021 · 17 comments · Fixed by #3600
Closed

Broken check_characters.py #3599

lissyx opened this issue Apr 2, 2021 · 17 comments · Fixed by #3600

Comments

@lissyx
Copy link
Collaborator

lissyx commented Apr 2, 2021

Regression from remote IO work:

This fails with

Traceback (most recent call last):
  File "training/coqui_stt_training/util/check_characters.py", line 22, in <module>
    from .io import open_remote
ModuleNotFoundError: No module named '__main__.io'; '__main__' is not a package

Repro'd on mozilla/deepspeech-train:v0.9.3 Docker image

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 2, 2021

@CatalinVoss Do you mind checking?

@CatalinVoss
Copy link
Collaborator

Ah sorry about that! I think two options

  1. We update the instructions to call this script as a module like
    python -m deepspeech_training.util.check_characters
    
    That allows you to call the script from the base directory as long as you specify the right relative module path and there are __init__.pys along the way.
  2. We update the import to from io import open_remote which assumes that you're calling the script from within the util directory.

Do you have a preference between these two?

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 2, 2021

Ah sorry about that! I think two options

1. We update the instructions to call this script as a module like
   ```
   python -m deepspeech_training.util.check_characters
   ```
   
   
   That allows you to call the script from the base directory as long as you specify the right relative module path and there are `__init__.py`s along the way.

2. We update the import to ` from io import open_remote` which assumes that you're calling the script from within the `util` directory.

Do you have a preference between these two?

I'd prefer 1

It could be awesome if you can add GitHub Actions coverage :)

@CatalinVoss
Copy link
Collaborator

I updated the docs. It's awesome that you moved to Github Actions -- I love them. However, I couldn't figure out at a quick glance where you'd want to add an invocation of this script in the various workflows. I'm probably not the right person to write a test for this as I've also never used this script…

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 4, 2021

where you'd want to add an invocation of this script in the various workflows.

I'd suggest adding a new job for that, next to e.g. the C++ binary tests

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 6, 2021

1. `python -m deepspeech_training.util.check_characters`

So after thinking again, it also means we are breaking backward compatility.

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 6, 2021

@reuben Do you have an opinion on whether it is sound we break backward compat here?

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 6, 2021

We update the import to from io import open_remote which assumes that you're calling the script from within the util directory.

it's even going to break because io is a python provided module, so usually it should take precedence.

@CatalinVoss
Copy link
Collaborator

CatalinVoss commented Apr 6, 2021 via email

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 6, 2021

If you prefer, we can also just revert the remote I/O changes for this file, which would mean that you just can’t do this for remote files.

On Tue, Apr 6, 2021 at 05:26 lissyx @.***> wrote: We update the import to from io import open_remote which assumes that you're calling the script from within the util directory. it's even going to break because io is a python provided module, so usually it should take precedence. — You are receiving this because you were assigned. Reply to this email directly, view it on GitHub <#3599 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRFKYFY647VTVZXPWLOTTTHL4YBANCNFSM42JBTP7A .

Either way, current 0.9.3 images and docs are broken, and whatever fix we pick we need to make a new dot release (which makes me unhappy), so I prefer to wwait for reuben's opinion :)

@CatalinVoss
Copy link
Collaborator

which makes me unhappy

Sorry 😞

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 6, 2021

It was not against you, it's just that it's not the best time to have to do one. It just proves that what is not tested is broken ;)

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 7, 2021

@CatalinVoss Do you mind sending the same PR agaisnt r0.9 please?

@lissyx lissyx reopened this Apr 7, 2021
@lissyx
Copy link
Collaborator Author

lissyx commented Apr 7, 2021

Reopening for r0.9

@CatalinVoss
Copy link
Collaborator

@lissyx OK. Are there any other docs to update or is this one file change the only one?

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 7, 2021

@lissyx OK. Are there any other docs to update or is this one file change the only one?

No it's the same one

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 7, 2021

@CatalinVoss Thanks!

@lissyx lissyx closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants