404 error while running as server
I get this error,when i run the app,can you please check
I0820 00:52:43.132686 139656716896064 _internal.py:113] 127.0.0.1 - - [20/Aug/2020 00:52:43] "GET / HTTP/1.1" 404 - W0820 00:52:44.045591 139656716896064 wsgi_app.py:57] IOError [Errno 2] No such file or directory: './lit_nlp/client/build/static/index.html' on path ./lit_nlp/client/build/static/index.html I0820 00:52:44.046047 139656716896064 wsgi_app.py:147] path ./lit_nlp/client/build/static/index.html not found, sending 404
and when i changed the path to index.html in app.py,and when i run,the output is blank...The html page is blank and the error in prompt is
I0820 00:58:09.279273 140288821880640 _internal.py:113] 127.0.0.1 - - [20/Aug/2020 00:58:09] "GET /main.js HTTP/1.1" 404 - I0820 00:58:11.933842 140288821880640 _internal.py:113] 127.0.0.1 - - [20/Aug/2020 00:58:11] "GET / HTTP/1.1" 200 - W0820 00:58:12.075612 140288821880640 wsgi_app.py:57] IOError [Errno 2] No such file or directory: './lit_nlp/client/build/main.js' on path ./lit_nlp/client/build/main.js I0820 00:58:12.075828 140288821880640 wsgi_app.py:147] path ./lit_nlp/client/build/main.js not found, sending 404
The error I run yesterday might be similar to yours. I created a python environment from scratch and it worked. BTW, did you run yarn && yarn build successfully?
@kumarvrsec did the above (building the client) resolve this? Yarn needs to run to compile the typescript and produce the main.js file; we've set it to also copy the other static assets into the build directory.
yeah ,I am able to resolve that issue,but I am facing another issue frequently.

That's odd - possible that you're running from an environment that can't access the hosted files for HuggingFace Transformers?
If so, you can manually download from https://huggingface.co/bert-base-uncased#list-files and pass a pass to that directory instead of the model name.
@iftenney i have met the same problem as this issue, and the teriminal shows :
I0429 10:50:03.855530 11980 lm_demo.py:123] Dataset: 'sst_dev' with 872 examples I0429 10:50:03.855530 11980 lm_demo.py:123] Dataset: 'sst_dev' with 872 examples I0429 10:50:03.856530 11980 lm_demo.py:123] Dataset: 'imdb_train' with 1000 examples I0429 10:50:03.856530 11980 lm_demo.py:123] Dataset: 'imdb_train' with 1000 examples I0429 10:50:03.856530 11980 lm_demo.py:123] Dataset: 'blank' with 0 examples I0429 10:50:03.856530 11980 lm_demo.py:123] Dataset: 'blank' with 0 examples I0429 10:50:03.857529 11980 dev_server.py:88] ( ( )\ ) )\ ) * ) (()/((()/(` ) /( /())/())( )()) ()) ()) ((()) | | | || _|
I0429 10:50:03.881873 11980 wsgi_serving.py:43]
Starting Server on port 5432 You can navigate to 127.0.0.1:5432
I0429 10:50:03.886013 11980 _internal.py:224] * Running on http://127.0.0.1:5432/ (Press CTRL+C to quit) I0429 10:50:03.886013 11980 _internal.py:224] * Running on http://127.0.0.1:5432/ (Press CTRL+C to quit) W0429 10:51:14.825967 11980 wsgi_app.py:55] IOError [Errno 2] No such file or directory: 'D:\lit-main\lit_nlp\client\build\default\static/index.html' on path D:\lit-main\lit_nlp\client\build\default\static/index.html W0429 10:51:14.825967 11980 wsgi_app.py:55] IOError [Errno 2] No such file or directory: 'D:\lit-main\lit_nlp\client\build\default\static/index.html' on path D:\lit-main\lit_nlp\client\build\default\static/index.html I0429 10:51:14.827513 11980 wsgi_app.py:145] path D:\lit-main\lit_nlp\client\build\default\static/index.html not found, sending 404 I0429 10:51:14.827513 11980 wsgi_app.py:145] path D:\lit-main\lit_nlp\client\build\default\static/index.html not found, sending 404 I0429 10:51:14.827513 11980 _internal.py:224] 127.0.0.1 - - [29/Apr/2022 10:51:14] "GET / HTTP/1.1" 404 - I0429 10:51:14.827513 11980 _internal.py:224] 127.0.0.1 - - [29/Apr/2022 10:51:14] "GET / HTTP/1.1" 404 -
but the file"index.html" has already been in the path, also i can not open this file with google chrome. So, please help me to solve the problem, thanks! i have checked my environment with the yml file and create a python conda envo, but it still can not work. my systemt is windows11, pycharm, google chrome.
Did you run yarn && yarn build?
Did you run
yarn && yarn build?
yes, i have used yarn(on window system) to test my version. and it still can not work.
Hard to tell without seeing what's in the path, you mentioned pycharm - I'm not sure if that might interact with the paths? This is the code that fetches the static files - you could try debugging from here: https://github.com/PAIR-code/lit/blob/main/lit_nlp/lib/wsgi_app.py#L37
(Unfortunately, we don't have official Windows support for this project, if you're not able to resolve with your regular Windows enviroment you might try running under WSL?)
Hard to tell without seeing what's in the path, you mentioned pycharm - I'm not sure if that might interact with the paths? This is the code that fetches the static files - you could try debugging from here: https://github.com/PAIR-code/lit/blob/main/lit_nlp/lib/wsgi_app.py#L37
(Unfortunately, we don't have official Windows support for this project, if you're not able to resolve with your regular Windows enviroment you might try running under WSL?)
ok,i will try to test my path, or i may need to use WSL. thanks!