fix: improve pyopenjtalk compatibility for newer versions and localhost binding#239
Open
Ryo722 wants to merge 1 commit into
Open
fix: improve pyopenjtalk compatibility for newer versions and localhost binding#239Ryo722 wants to merge 1 commit into
Ryo722 wants to merge 1 commit into
Conversation
…st binding - Add hasattr check for `unset_user_dict()` which was removed in pyopenjtalk 0.4+. This prevents AttributeError on newer versions. - Handle missing function names in worker server gracefully instead of raising KeyError. - Change socket binding from `socket.gethostname()` to `"localhost"` for more reliable connection on macOS and other environments where hostname resolution may be unreliable. - Wrap `unset_user_dict()` call in user_dict/__init__.py with try-except for backward compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hasattrcheck forunset_user_dict()which was removed in pyopenjtalk 0.4+socket.gethostname()to"localhost"for reliable connection on macOSunset_user_dict()call with try-except for backward compatibilityMotivation
When running on macOS,
socket.gethostname()can fail to resolve properly, causing connection errors in the pyopenjtalk worker. Additionally, newer versions of pyopenjtalk (0.4+) removed theunset_user_dict()method, causingAttributeError.Changes
pyopenjtalk_worker/__init__.pyhasattrcheck before callingunset_user_dict()pyopenjtalk_worker/worker_client.pysocket.gethostname()→"localhost"pyopenjtalk_worker/worker_server.py"localhost"binding + missing func handlinguser_dict/__init__.pyunset_user_dict()Testing
Tested on macOS 14 (Apple Silicon M4) with pyopenjtalk 0.3.x and 0.4+.
These changes are backward-compatible and do not affect existing CUDA/Linux environments.