Closed dcmouth closed 1 month ago
Pretty tricky to tell what is going on here:
python
command that would be of interest?@LaurentMazare Exactly same problem here on a ubuntu server. After clicking "Connect" my Chrome browser will return following message in the browser's console. No error message or anything on the backend.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addModule') at index-ClFQVzk0.js:431:71092 at index-ClFQVzk0.js:431:71260 at onClick (index-ClFQVzk0.js:431:73819) at Object.Nb (index-ClFQVzk0.js:37:9852) at Tb (index-ClFQVzk0.js:37:10006) at Ub (index-ClFQVzk0.js:37:10063) at nf (index-ClFQVzk0.js:37:31422) at se (index-ClFQVzk0.js:37:31839) at index-ClFQVzk0.js:37:36991 at Qk (index-ClFQVzk0.js:40:36798)
In this last case, I would guess the issue is on this line where audioContext.audioWorlket
is undefined. This seems quite surprising as this has been available in chrome for a long time (chrome 66 in 2018) so not sure what is going on here. You can try this page to see if audio worklets work properly in your browser, but besides that I don't have much ideas to offer.
Use localhost:8998
in place of 0.0.0.0:8998
. I had the same issue.
I had the same issue. are you solved? @KaruroChori
I use a Chrome browser with verion 129.0.6668. Could not try localhost:8998 because I use a remote server.
After a bit of research, it appears to be a https issue, audioWorklet is only available in a https context: see here
I don't think the https restriction applies to localhost actually.
I don't think the https restriction applies to localhost actually.
this only happens if not run on localhost, so for example providing "--host 0.0.0.0"
@AWAS666 Hi,are you solved?
@hugh-min Hi, I also use remote server, are you sloved?
After a bit of research, it appears to be a https issue, audioWorklet is only available in a https context: see here
confirmed that's the issue
In that case, you should just tunnel the remote port through ssh so that you can actually use http://localhost:8998 (details in the readme).
After a bit of research, it appears to be a https issue, audioWorklet is only available in a https context: see here经过一番研究,它似乎是一个https问题,audioWorklet只在https上下文中可用:请参阅此处
confirmed that's the issue证实这就是问题所在
so what can i do to solve the problem ?
gen your CERT_FILE and KEY_FILE use cmd: openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
update your iptables iptables -A INPUT -p tcp --dport 8998 -j ACCEPT service iptables restart
update server.py and restart server
CERT_FILE = f'{HOME}/.ssh/cert.pem' KEY_FILE = f'{HOME}/.ssh/key.pem'
import ssl ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_context.load_cert_chain(certfile=CERT_FILE, keyfile=KEY_FILE) web.run_app(app, port=args.port, ssl_context=ssl_context)
After a bit of research, it appears to be a https issue, audioWorklet is only available in a https context: see here经过一番研究,它似乎是一个https问题,audioWorklet只在https上下文中可用:请参阅此处
confirmed that's the issue证实这就是问题所在
so what can i do to solve the problem ?
- gen your CERT_FILE and KEY_FILE use cmd: openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
- update your iptables iptables -A INPUT -p tcp --dport 8998 -j ACCEPT service iptables restart
- update server.py and restart server CERT_FILE = f'{HOME}/.ssh/cert.pem' KEY_FILE = f'{HOME}/.ssh/key.pem' import ssl ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_context.load_cert_chain(certfile=CERT_FILE, keyfile=KEY_FILE) web.run_app(app, port=args.port, ssl_context=ssl_context)
- use https://x.x.x.x:8998/
thats great,thx. I solve my problem . according to you notice that is my step below .
(1) openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
(2)sudo update-alternatives --config iptables
and chose iptables-legacy
(3)sudo iptables -A INPUT -p tcp --dport 8998 -j ACCEPT
(4) service iptables restart
(5) In moshi/server.py add
HOME = os.path.expanduser("~")
CERT_FILE = f'{HOME}/cert.pem'
KEY_FILE = f'{HOME}/key.pem'
import ssl
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.load_cert_chain(certfile=CERT_FILE, keyfile=KEY_FILE)
web.run_app(app, port=args.port, ssl_context=ssl_context)
then restart server (6)use https://x.x.x.x:8998/
Just to mention that there is now a --ssl
argument for both the pytorch and mlx version so that serving is done over https rather than http. You have to pass to this argument a directory that contains the key and certificate files.
Backend impacted
The PyTorch implementation
Operating system
Linux
Hardware
GPU
Description
when i run python -m moshi.server then but i can click settings but i can't click connect
Extra information
none
Environment
Fill in the following information on your system.
If the backend impacted is PyTorch:
python -c 'import torch; print(torch.version.cuda)'
): 12.1ubuntu