Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.45k stars 44.06k forks source link

playbin.props.uri ... AttributeError: 'NoneType' object has no attribute 'props' #2074

Closed charltonh closed 12 months ago

charltonh commented 1 year ago

Using the --speak flag breaks the script even with all the requirements. Not sure if this is a bug on linux or perhaps a simple python setup issue, but after some time I haven't been able to fix it. Anyone have any ideas? (note the "Response content: b'{"detail":"Not Found"}' " in the beginning too)

(Auto-GPT) oberon /home/charlton/Auto-GPT [84]>run.sh --debug --speak
All packages are installed.
Debug Mode:  ENABLED
Speak Mode:  ENABLED
Welcome back!  Would you like Request failed with status code: 404
Response content: b'{"detail":"Not Found"}'
me to return to being PostmanAI?
Continue with the last settings?
Name:  PostmanAI
Role:  An AI designed to improve my linux mail server setup and filter spam more efficiently.
Goals: ['Engineer a spam-filtering solution that works with postfix and procmail, using AI or other modern tools available on linux.', 'Provide a configuration for my mutt mail client to be able to train spam vs ham messages']
Continue (y/n): Exception in thread Thread-1 (speak):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/charlton/Auto-GPT/autogpt/speech/say.py", line 36, in speak
    DEFAULT_VOICE_ENGINE.say(text)
  File "/home/charlton/Auto-GPT/autogpt/speech/base.py", line 33, in say
    return self._speech(text, voice_index)
  File "/home/charlton/Auto-GPT/autogpt/speech/gtts.py", line 19, in _speech
    playsound("speech.mp3", True)
  File "/home/charlton/Auto-GPT/lib/python3.10/site-packages/playsound.py", line 101, in _playsoundNix
    playbin.props.uri = 'file://' + pathname2url(os.path.abspath(sound))
AttributeError: 'NoneType' object has no attribute 'props'
charltonh commented 1 year ago

This seems to be a common problem on linux with the python playsound.py module. I was able to get around this by rewriting autogpt/speech/eleven_labs.py to this:

            # playsound("speech.mpeg", True)
            os.system('mpg123 -q speech.mpeg')
taaha commented 1 year ago

Did what you did image

- It gave this error sh: 1: mpg123: not found

charltonh commented 1 year ago

Do a pip install mpg123 or otherwise install it on your system.

taaha commented 1 year ago

My fault. Did following command

sudo apt-get install mpg123

It started working. Thanks

frozen905 commented 1 year ago

I am having the dreaded NoneType 'props' problem here as well, I found this thread after posting about it here: https://github.com/TaylorSMarks/playsound/issues/142

However I am not looking for alternative solutions just yet, is this not fixable in playsound itself? I have scripts already relying on it's function and it would be nice to have this working since many others use it as well

github-actions[bot] commented 1 year ago

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] commented 12 months ago

This issue was closed automatically because it has been stale for 10 days with no activity.