chat-with-gpt icon indicating copy to clipboard operation
chat-with-gpt copied to clipboard

No Whisper STT on Docker version

Open Arche151 opened this issue 1 year ago • 7 comments

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/ ?

Arche151 avatar Mar 21 '23 05:03 Arche151

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 .

cogentapps avatar Mar 21 '23 05:03 cogentapps

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?

Arche151 avatar Mar 21 '23 06:03 Arche151

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

cogentapps avatar Mar 21 '23 07:03 cogentapps

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

Arche151 avatar Mar 21 '23 07:03 Arche151

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

cogentapps avatar Mar 21 '23 07:03 cogentapps

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)

Arche151 avatar Mar 21 '23 07:03 Arche151

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.

vesector avatar Mar 21 '23 18:03 vesector