Fix issue #190: Check Python version and locale encoding at startup - #444
Conversation
|
CLA Accepted |
|
Hello Sekhar, thank you for submitting to Naomi. I am reviewing your modifications now. I should have a comprehensive review sometime this weekend. -Aaron |
|
Please bear with me while I review all these changes. It's a lot to get through. The first thing that I see is that you appear to be on the LLM branch, but are pushing to the naomi-dev branch, thus pulling in a bunch of experimental code. It would be easier to just merge this into the LLM branch. Thanks, |
|
Hello Aaron, I have changed the base branch of this PR to the \LLM\ branch as suggested. This separates the experimental LLM changes from |
…at startup before importing naomi package
|
Hello Aaron, I have cleaned up this branch so that it now contains ONLY the single commit for fixing issue #190 (checking the Python version and locale encoding at startup). I have targeted it back to |
|
Hey, thank you. I really appreciate it. What are you interested in working on with this project? |
|
Hello Aaron, I've just pushed a fix to address the CodeQL empty except warnings on the startup locale check. As for what I'm interested in working on, I'd love to help with the LLM integrations, specifically improving the Llama client and database conversation logging (and making them work smoothly with platforms like SillyTavern/Naomi). Let me know if that sounds good or if there is anything else you'd like me to look at! |
|
That is great! You can see that the llm code in Naomi is primitive. I'm about to publish a new version with a few improvements such as pulling the template directly from /props instead of having to specify one. I'll let you know when I put it up. Personally, I'm particularly interested in speaker recognition and accessibility. I did write a little bit of code a couple of weeks ago that allowed me to extract the json data from a .png character card if you'd like to play with implementing character cards. I think being able to import and export conversations and personalities with SillyTavern would be very helpful. Do you have any thoughts about replacing speechhandlers with mcp servers? |
|
By the way, part of what's taking me so long right now is dusting off an old Raspberry Pi to test on. It's still a good test environment for us because it's pretty standard and easy to refresh. I have run an LLM directly off of a 4G Pi5. I've lost my microhdmi->hdmi adapter and for some reason my Pi5 isn't coming up. I should be able to test with a Pi3, and of course I could just start a new virtual machine in VMM. I have read your code and for the most part I understand what it's doing. |
aaronchantrill
left a comment
There was a problem hiding this comment.
This is a simple check for character encoding. Using anything other than a utf-8 encoded character set is likely to cause issues. This check does not prevent the program from running if the character set is wrong, but does provide a warning that could be useful to the end user.
The only change I would request would be to gather all the "import" statements at the top of each module, as is normal within this project, rather than importing them as they are used.
Either way, I'm happy to approve this pull request.
|
So, I finally got an old Raspberry Pi 3B up and running with a brand-new Raspbian Trixie OS, git cloned Naomi (git clone https://github.com/NaomiProject/Naomi), git fetched the pull request (git fetch origin pull/444/head:Sekhar03_naomi-dev). The installer ran normally, which is to be expected since it's written in bash. Once Naomi actually started, there was an error as the audioop library was removed from the standard libraries in Python 3.13. The solution is to pip install audioop-lts and then conditionally import one or the other: try: Now this leaves the issue of the requirements.txt file. The audioop-lts library can be made conditional by adding the line: audioop-lts; python_version >= "3.13" The same thing appears to have happened with flite, where the pipes library has been removed from the standard libraries, but the pipes.quote() function here can be replaced with a shlex.quote(). |
This pull request moves the Python version check to the top of Naomi.py and Populate.py (before naomi is imported) and adds a system locale check to warn the user if a non-UTF-8 locale is detected.