cogentapps / chat-with-gpt

An open-source ChatGPT app with a voice
https://www.chatwithgpt.ai
MIT License
2.31k stars 496 forks source link

No Whisper STT on Docker version #79

Open Arche151 opened 1 year ago

Arche151 commented 1 year ago

For privacy reasons, I wanted to self-host this app via Docker.

Everything works fine, but there is no microphone button to start voice recognition.

I already updated to the newest version. Is the Docker version behind the one hosted on https://chatwithgpt.netlify.app/ ?

cogentapps commented 1 year ago

The action that builds and publishes the docker images is having issues today, will fix soon: https://github.com/cogentapps/chat-with-gpt/actions/runs/4474836411/jobs/7863877059

In the meantime you can try to build locally by cloning the repo and running: docker build -t chat-with-gpt .

Arche151 commented 1 year ago

Thank you for the quick reply and suggested workaround! Now, I see the microphone button but when pressing it I get this error "Sorry, an error occurred trying to record audio.". The website also doesn't ask for access to the microphone like the version hosted by you does. Manually granting the permission didn't help.

Do I need to configure something with Whisper on my Linux server, or do you have a different idea of what might be the cause of this problem?

cogentapps commented 1 year ago

The hosted site is running the same code, so my first guess is that your browser is blocking access to the microphone because your local server isn’t running HTTPS.

If you’re using Chrome, possible workaround here: https://stackoverflow.com/a/67694562

Arche151 commented 1 year ago

I tried this workaround, but it didn't work, unfortunately. I think I'll try to get HTTPS working and see if that helps.

cogentapps commented 1 year ago

Are there any error messages in the JavaScript console in Chrome developer tools? That would help track down the issue.

Arche151 commented 1 year ago

Yes, there are two errors. The first one appears when loading the page and the second when clicking the microphone button. This is the console output: main.f004e82c.js:2 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu 69766 @ main.f004e82c.js:2 n @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 192.168.1.66/:1 Error handling response: TypeError: Cannot set properties of null (setting 'textContent') at chrome-extension://bkkkaebljlanbmkbkajelmjgcmgaiapd/content.js:188:52 main.f004e82c.js:2 No locale data for en-GB (anonymous) @ main.f004e82c.js:2 d @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 r @ main.f004e82c.js:2 u @ main.f004e82c.js:2 Promise.then (async) r @ main.f004e82c.js:2 s @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 Rx @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 (anonymous) @ main.f004e82c.js:2 main.f004e82c.js:2 speech recognition error Error: speech permission was not granted at main.f004e82c.js:2:781268 at d (main.f004e82c.js:2:609309) at Generator.<anonymous> (main.f004e82c.js:2:610652) at Generator.next (main.f004e82c.js:2:609672) at r (main.f004e82c.js:2:603503) at s (main.f004e82c.js:2:603706)

vesector commented 1 year ago

You do not need to set the HTTPS, you can do the following:

  1. Open Chrome and go to chrome://flags/#unsafely-treat-insecure-origin-as-secure
  2. Enter your site address for example http://192.168.1.1:3000 select enable
  3. Relaunch Chrome
  4. Test the site, it should allow you to use the microphone.