UnicodeEncodeError when deploying Nemo Text Normalization on Triton Inference Server
See original GitHub issueDescribe the bug
I have a problem when deloy Text Nemo Text Normarlzation on Triton Inference Server. The Normalizer can not load the default “whitelist.tsv” file. Whenever I run tritonserver --model-repository models/
, the bug will appear.
from nemo_text_processing.text_normalization.normalize import Normalizer
normalizer = Normalizer(input_case='cased', lang='en')
Results:
Internal: UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 150: ordinal not in range(128)
At:
/usr/lib/python3.8/encodings/ascii.py(26): decode
/usr/local/lib/python3.8/dist-packages/nemo_text_processing/text_normalization/en/utils.py(41): load_labels
/usr/local/lib/python3.8/dist-packages/nemo_text_processing/text_normalization/en/taggers/whitelist.py(49): _get_whitelist_graph
/usr/local/lib/python3.8/dist-packages/nemo_text_processing/text_normalization/en/taggers/whitelist.py(64): __init__
/usr/local/lib/python3.8/dist-packages/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify.py(107): __init__
/usr/local/lib/python3.8/dist-packages/nemo_text_processing/text_normalization/normalize.py(76): __init__
Environment overview (please complete the following information)
- Environment: Triton Inference Server 21.10
- Method of NeMo install: pip install nemo_toolkit[‘all’]
Additional context
There is no problem when I test this code without Triton Inference Server!.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Deploying Machine Translation to Triton Inference Server
Hi, I am trying to deploy a Nemo Machine Translation model to triton inference server. In my understanding the pipeline looks something like ......
Read more >ecprice › Public › wordlist.ranked – MIT
... board location change white st text small rating rate government children ... medical test friend come server pc study application cart staff...
Read more >Untitled
... ,fully,diet,basis,military,sell,jesus,council,function,text,wall,november ... ,characters,defense,album,cultural,distance,football,server,mouth,paying ...
Read more >https://huggingface.co/sentence-transformers/avera...
... "sound", "text", "friend", "practice", "recognized", "figure", "consider", "participated", "write", "leaving", "short", "once", "rather", "activities", ...
Read more >2m-subdomains.txt - Index of /
... Ponomar maso GT-S7500 LGPL Plugin IO Telegram Sparkle biz text eigen logo ... site2011 hazelcast-browser metron-deployment box2d Validation server-auth ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Would you please try running your code with “export PYTHONIOENCODING=utf8”?
I tried fixing the “load labels(abs_path)” function in the “nemo_text_processing/text normalization/en/utils.py” file at the line 40.
label_tsv = open(abs_path)
>>>label_tsv = open(abs_path, encoding='utf-8')
And the problem was solved. I know it’s not a good idea to do this with libraries that have been installed directly through pip. I hope that this can be fixed in future updates.