trickme-interface
trickme-interface copied to clipboard
Failed to load resource error
I followed the instructions for setup and trained my own RNN guesser via Qanta. However, after running gunicorn, downloading the qanta sqlite3 db, starting server.py, and loading the rnn, I encountered the following errors on the frontend:
There are no files in the logs folder for debugging.
Is this a firewall issue? Or perhaps a URL needs to be updated?
Possibly. I'm running this in chrome browser, but even with the "Allow invalid certificates for resources loaded from localhost" flag enabled and all extensions disabled, it is still having trouble with CORS, namely access control. It seems it does not trust write.qanta.org?
I also tried running this in the GNOME Web browser, but that browser would not load "due to access control checks".
It would be helpful if you listed the commands you ran and on which machine you ran them (eg on laptop versus not).
It would seem though that the write.qanta.org path is hard coded here, which is at least one issue (easily fixed though)
https://github.com/Eric-Wallace/trickme-interface/blob/c47fa53efa6365e001bb1bb52279ea65ed8678f8/interface/templates/server.html#L441
I ran the commands exactly as they were described in the README, expect I loaded QANTA through the poetry virtual env from the qanta repo since I didn't want to reinstall torch. I used a desktop PC.
Can you please given the exact you commands (copy / paste) and the output that you got with each command?
In interface, I ran gunicorn --bind 0.0.0.0:7000 web_server:app --workers 4
:
[2021-04-23 13:30:03 -0400] [35296] [INFO] Starting gunicorn 20.1.0
[2021-04-23 13:30:03 -0400] [35296] [INFO] Listening at: http://0.0.0.0:7000 (35296)
[2021-04-23 13:30:03 -0400] [35296] [INFO] Using worker: sync
[2021-04-23 13:30:03 -0400] [35302] [INFO] Booting worker with pid: 35302
[2021-04-23 13:30:03 -0400] [35303] [INFO] Booting worker with pid: 35303
[2021-04-23 13:30:03 -0400] [35304] [INFO] Booting worker with pid: 35304
[2021-04-23 13:30:03 -0400] [35305] [INFO] Booting worker with pid: 35305
[2021-04-23 13:30:24 -0400] [35296] [INFO] Handling signal: winch
In non_qanta, I ran python server.py
:
* Serving Flask app "server" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
In the qanta poetry virtual env, I ran the following python file load.py
:
import qanta.guesser.rnn
RnnGuesserLocal = qanta.guesser.rnn.RnnGuesser.load('/home/poxter/qb/output/guesser/qanta.guesser.rnn.RnnGuesser/0')
RnnGuesserLocal.web_api(port=6000)
python load.py
:
/home/poxter/.cache/pypoetry/virtualenvs/qanta-virId68h-py3.9/lib/python3.9/site-packages/torch/nn/modules/rnn.py:60: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.265 and num_layers=1
warnings.warn("dropout option adds dropout after all but last "
* Serving Flask app "qanta.guesser.rnn" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:6000/ (Press CTRL+C to quit)
The above is all that's in the output before the local host times out due to long response time.
I noticed that commenting out these http to https redirect lines in the interface server template kept it from timing out for me: https://github.com/Eric-Wallace/trickme-interface/blob/master/interface/templates/server.html#L323-L329