Update requirements.txt
https://github.com/huggingface/transformers/issues/29527
based on the above suggestion updating the reqirements.txt file to solve the following issue when generating inference endpoint:
e = importlib.import_module(module_str)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/webservice_starlette.py", line 19, in
from huggingface_inference_toolkit.handler import get_inference_handler_either_custom_or_default_handler
File "/app/huggingface_inference_toolkit/handler.py", line 5, in
from huggingface_inference_toolkit.utils import check_and_register_custom_pipeline_from_directory, get_pipeline
File "/app/huggingface_inference_toolkit/utils.py", line 17, in
from huggingface_inference_toolkit.sentence_transformers_utils import (
File "/app/huggingface_inference_toolkit/sentence_transformers_utils.py", line 11, in
from sentence_transformers import CrossEncoder, SentenceTransformer, util
File "/usr/local/lib/python3.10/dist-packages/sentence_transformers/init.py", line 3, in
from .datasets import SentencesDataset, ParallelSentencesDataset
File "/usr/local/lib/python3.10/dist-packages/sentence_transformers/datasets/init.py", line 1, in
from .DenoisingAutoEncoderDataset import DenoisingAutoEncoderDataset
File "/usr/local/lib/python3.10/dist-packages/sentence_transformers/datasets/DenoisingAutoEncoderDataset.py", line 5, in
from transformers.utils.import_utils import is_nltk_available, NLTK_IMPORT_ERROR
ImportError: cannot import name 'is_nltk_available' from 'transformers.utils.import_utils' (/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py)