segment-any-text / wtpsplit

Toolkit to segment text into sentences or other semantic units in a robust, efficient and adaptable way.
MIT License
758 stars 44 forks source link

ImportError: cannot import name 'SaT' from 'wtpsplit' (/usr/local/lib/python3.10/site-packages/wtpsplit/__init__.py) #139

Closed hwang136 closed 2 weeks ago

hwang136 commented 1 month ago

after pip install wtpsplit I tried to from wtpsplit import SaT but it shows ImportError: cannot import name 'SaT' from 'wtpsplit' (/usr/local/lib/python3.10/site-packages/wtpsplit/init.py)

hwang136 commented 1 month ago

Also, How can I load a local model using SaT it seems to only support huggingface connection

markus583 commented 1 month ago

Hi! For the first issue related to importing, could you share your error message? I just tried again using a fresh install and it works just fine. Could you double-check your environment and installation? You can simply load a local model by providing a directory with model files. See this line here.

hwang136 commented 4 weeks ago

simply boosting the version solved this problem. regarding to 2nd question. I can provide a local model but not a local tokenizer whose path is hard coded so I create another segmenter class for this.

markus583 commented 3 weeks ago

Great! I see, that is not a current feature, indeed. Out of curiosity, why would you need such a feature? :)