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

diff_predictions: 'XlsxWriter' object has not attribute 'save' error. #608

Open
mmartin9684-sil opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mmartin9684-sil
Copy link
Collaborator

The diff_predictions script reports the error shown below with a call to the 'save' method of the XlsxWriter package.

Correcting line 624 of the script from:
write.save()
to:
writer._save()
resolves the error.

(silnlp-py3.10) PS C:\Users\mm9q\PycharmProjects\silnlp> poetry run python -m silnlp.nmt.diff_predictions FieldTests.Attention\Indonesia\Luang\NLLB.1.3B.lex-LNG.en-LBT.NT.SDPA --show-diffs --scorers bleu chrf3 chrF3+ chrF3++
2024-12-10 12:10:49,545 - silnlp.common.environment - INFO - Using workspace: S:/ as per environment variable SIL_NLP_DATA_PATH.
[nltk_data] Downloading package punkt to
[nltk_data]     C:\Users\mm9q\AppData\Roaming\nltk_data...
[nltk_data]   Package punkt is already up-to-date!
2024-12-10 12:10:50,423 - silnlp.common.utils - INFO - Git commit: 73e7c5507a
INFO:silnlp.common.utils:Git commit: 73e7c5507a
Git commit: 73e7c5507a
Analyzing predictions file: S:\MT\experiments\FieldTests.Attention\Indonesia\Luang\NLLB.1.3B.lex-LNG.en-LBT.NT.SDPA\test.trg-predictions.detok.txt.5000
Calculating BLEU scores ...: 4196it [00:01, 2140.68it/s]
Calculating chrF3 scores ...: 4196it [00:02, 1630.27it/s]
Calculating chrF3+ scores ...: 4196it [00:02, 1645.83it/s]
Calculating chrF3++ scores ...: 4196it [00:02, 1567.05it/s]
Traceback (most recent call last):
  File "C:\Users\mm9q\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\mm9q\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\mm9q\PycharmProjects\silnlp\silnlp\nmt\diff_predictions.py", line 630, in <module>
    main()
  File "C:\Users\mm9q\PycharmProjects\silnlp\silnlp\nmt\diff_predictions.py", line 624, in main
    writer.save()
AttributeError: 'XlsxWriter' object has no attribute 'save'. Did you mean: '_save'?
(silnlp-py3.10) PS C:\Users\mm9q\PycharmProjects\silnlp> 

@mmartin9684-sil mmartin9684-sil added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants