Adri6336 / gpt-voice-conversation-chatbot

Allows you to have an engaging and safely emotive spoken / CLI conversation with the AI ChatGPT / GPT-4 while giving you the option to let it remember things discussed.
GNU General Public License v3.0
298 stars 50 forks source link

fix(macOS): Move pyaudio to main thread #20

Closed dahifi closed 9 months ago

dahifi commented 1 year ago

The error message NSWindow drag regions should only be invalidated on the Main Thread! suggests that you should update the UI on the main thread only. In this case, Pygame is expecting to run on the main thread.

Code completion by gpt with following prompt:

if __name__ == '__main__':
    gui = GUI()
    gui.main_thread.join()

    def main_loop(self):

        pygame.init()
        self.display = pygame.display.set_mode((500, 500), pygame.RESIZABLE)
        pygame.display.set_caption(f'Chat With {self.chatbot.gpt_model.upper()}')

 self.display = pygame.display.set_mode((500, 500), pygame.RESIZABLE)
pygame.error: NSWindow drag regions should only be invalidated on the Main Thread!
dahifi commented 1 year ago

I must have had a bad commit as the script broke, but I managed to get it fixed. This PR should be good to go.

aodrasa commented 1 year ago

Not getting a Pygame gui popup when it runs. Any ideas?