ChatGLM2-6B icon indicating copy to clipboard operation
ChatGLM2-6B copied to clipboard

[BUG/Help] <run web_demo.py on server>

Open FreeYiran opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

When running the web_demo.py on server, it shows Running on local URL: http://127.0.0.1:7860

image However, after connecting to the server through Windows shell SSH and doing forwarding, the website cannot be opened in the browser within the same LAN. image image

Expected Behavior

Does anyone know what's going on?

Steps To Reproduce

  1. python web_demo.py

  2. windows shell: ssh -L7861:compute3:7860 user_name@ip_address

  3. open browser: http://127.0.0.1:7861/

Environment

- OS:
- Python:3.9
- Transformers:
- PyTorch:2.0
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :cuda-11.7

Anything else?

No response

FreeYiran avatar Jul 01 '23 04:07 FreeYiran

I think you should replace compute3 with 127.0.0.1

duzx16 avatar Jul 01 '23 11:07 duzx16

I think you should replace compute3 with 127.0.0.1 Thank you very much, I tried, but it didn't work.

FreeYiran avatar Jul 02 '23 08:07 FreeYiran

  1. terminal: ssh -L 0.0.0.0:7860:localhost:7860 [email protected]
  2. in remote server: python web_demo.py
  3. local PC or LAN: http://localhost:7860 , http://your_ip_in_LAN:7860

change your step 1 and 2.

weihaopeng avatar Jul 03 '23 07:07 weihaopeng

  1. terminal: ssh -L 0.0.0.0:7860:localhost:7860 [email protected]
  2. in remote server: python web_demo.py
  3. local PC or LAN: http://localhost:7860 , http://your_ip_in_LAN:7860

change your step 1 and 2.

Thank you,still didn't work...

FreeYiran avatar Jul 05 '23 02:07 FreeYiran

  1. terminal: ssh -L 0.0.0.0:7860:localhost:7860 [email protected]
  2. in remote server: python web_demo.py
  3. local PC or LAN: http://localhost:7860 , http://your_ip_in_LAN:7860

change your step 1 and 2.

Thank you,still didn't work...

image

Then may be some firewall settings, or do you have some web proxies locally? The steps are no problem.

Or you can use vscode for remote and then start python web_demo.py in vscode's command line. When vscode remotely starts the service, it will automatically do port mapping, and normally, the web page will pop up directly in your browser after startup.

image

weihaopeng avatar Jul 05 '23 03:07 weihaopeng