dnhkng / GlaDOS

This is the Personality Core for GLaDOS, the first steps towards a real-life implementation of the AI from the Portal series by Valve.
MIT License
2.73k stars 258 forks source link

Add Mac compatability. #9

Closed johnrtipton closed 1 month ago

johnrtipton commented 1 month ago

DRAFT: Add Mac compatibility, I need to do some cleanup still, this is a rough implementation.

Traxmaxx commented 1 month ago

Installing espeak-ng through homebrew and doing the mentioned change above, espeak is not directly crashing and works for some time until I run into mentioned error. I'm still investigating what is happening there. Any clues?

fonix232 commented 1 month ago

I've been doing some refactor locally, which I think could go into this PR.

Instead of relying on manually compiled and installed libraries, my suggestion would be an init script that:

  1. Enters a Python venv
  2. Checks for libwhisper, if not found, pulls the git repo, builds it, and copies the appropriate files into a local path
  3. Checks for libespeak-ng, if not found, pulls the git repo, builds it, and copies the appropriate files into a local path
  4. Checks for llama.cpp, and you guessed it right, if not found, pulls the git repo, builds it, and copies the appropriate files into a local path
  5. Installs all Python dependencies
  6. Starts the main app

Optionally it could also prompt for installing the make/cmake/etc. build tools as needed, though with all the different distros, this might be a task a smidge too big.

I'd also go for masking ctypes.cdll.LoadLibrary with a custom method that takes care of the dylib or so checking (note that e.g. libwhisper still builds a .so file on macOS, so on Darwin platforms it's best to check first for dylib then for so and only if neither are found, throw the exception).

fonix232 commented 1 month ago

@dnhkng please see my above comment to expand on the discussion under #11

dnhkng commented 1 month ago

We now use the espeak-ng binary, as it resolves the segfault issues, so I am closing this,