question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeEncodeError when deploying Nemo Text Normalization on Triton Inference Server

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
VahidooXcommented, Jan 20, 2022

Would you please try running your code with “export PYTHONIOENCODING=utf8”?

0reactions
xuanbinh-nguyen96commented, Jan 26, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found