You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the commands in the world_language_model readme should finish without error.
Current Behavior
During generate.py, an UnicodeEncodeError is thrown when trying to write 'ზ' to the file.
Possible Solution
I resolved the issue by changing line 66 of generate.py
from:
with open(args.outf, 'w') as outf:
to:
with open(args.outf, 'w', encoding="utf-8") as outf:
Steps to Reproduce
cd .\word_language_model
python main.py --cuda --epochs 6
python generate.py
Failure Logs [if any]
| Generated 0/1000 words
| Generated 100/1000 words
| Generated 200/1000 words
| Generated 300/1000 words
| Generated 400/1000 words
| Generated 500/1000 words
Traceback (most recent call last):
File "REDACTED\word_language_model\generate.py", line 83, in
outf.write(word + ('\n' if i % 20 == 19 else ' '))
File "REDACTED\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u10d6' in position 0: character maps to
The text was updated successfully, but these errors were encountered:
Your issue may already be reported!
Please search on the issue tracker before creating one.
Context
Your Environment
Expected Behavior
Following the commands in the world_language_model readme should finish without error.
Current Behavior
During generate.py, an UnicodeEncodeError is thrown when trying to write 'ზ' to the file.
Possible Solution
I resolved the issue by changing line 66 of generate.py
from:
with open(args.outf, 'w') as outf:
to:
with open(args.outf, 'w', encoding="utf-8") as outf:
Steps to Reproduce
cd .\word_language_model
python main.py --cuda --epochs 6
python generate.py
Failure Logs [if any]
| Generated 0/1000 words
| Generated 100/1000 words
| Generated 200/1000 words
| Generated 300/1000 words
| Generated 400/1000 words
| Generated 500/1000 words
Traceback (most recent call last):
File "REDACTED\word_language_model\generate.py", line 83, in
outf.write(word + ('\n' if i % 20 == 19 else ' '))
File "REDACTED\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u10d6' in position 0: character maps to
The text was updated successfully, but these errors were encountered: