text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

yaml error

Open leejw51 opened this issue 1 year ago • 14 comments

Describe the bug

when start_linux.sh, yaml error

Is there an existing issue for this?

  • [X] I have searched the existing issues

Reproduction

start_linux.sh

Screenshot

No response

Logs

ModuleNotFoundError: No module named 'yaml'

System Info

linux

leejw51 avatar Jan 05 '24 07:01 leejw51

the same bug yaml version can't match python 3.11

laishuzhong avatar Jan 05 '24 07:01 laishuzhong

能不能来个人解决一下啊,can somebody fix this bug? i run the start_windows.bat firsttime,but i fail it. when i start_windows.bat next time,it will always be this bug,

tk666ttkk avatar Jan 06 '24 15:01 tk666ttkk

I have the same issue in macOS (Apple Silicon).

davidgutierrezpalma avatar Jan 08 '24 06:01 davidgutierrezpalma

Same here on Windows

jrruethe avatar Jan 08 '24 15:01 jrruethe

try: python -m pip install pyyaml

tangd avatar Jan 11 '24 07:01 tangd

@tangd thanks for your the reply.

After executing the proposed command, the error disappeared... but now I have a similar error:

ModuleNotFoundError: No module named 'rich'

Both packages seem to appear in the requirements_apple_silicon.txt file, so my guess the bash script isn't installing all the dependencies. Once I executed this line after conda activate "$INSTALL_ENV_DIR":

pip install -r "requirements_apple_silicon.txt"

All the dependencies were installed and the server was launched successfully.

davidgutierrezpalma avatar Jan 11 '24 08:01 davidgutierrezpalma

mac os 14.2.1 , Apple silicon M1 max

% ./cmd_macos.sh bash-5.2$ pip install -r "re^Cirements_apple_silicon.txt" bash-5.2$ ./start_macos.sh

many many error ...

*******************************************************************
* WARNING: You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************


18:46:27-098972 INFO     Starting Text generation web UI                                                                             
18:46:27-100721 INFO     Loading the extension "gallery"                                                                             
Running on local URL:  http://127.0.0.1:7860
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: replace() argument 1 must be str, not bytes
╭──────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────╮
│ /Volumes/SSD/git/text-generation-webui/server.py:254 in <module>                                                            │
│                                                                                                                                   │
│   253         # Launch the web UI                                                                                                 │
│ ❱ 254         create_interface()                                                                                                  │
│   255         while True:                                                                                                         │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/server.py:162 in create_interface                                                    │
│                                                                                                                                   │
│   161     with OpenMonkeyPatch():                                                                                                 │
│ ❱ 162         shared.gradio['interface'].launch(                                                                                  │
│   163             prevent_thread_lock=True,                                                                                       │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py:2115 in launch     │
│                                                                                                                                   │
│   2114         ):                                                                                                                 │
│ ❱ 2115             raise ValueError(                                                                                              │
│   2116                 "When localhost is not accessible, a shareable link must be created. Ple                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to
allow access to localhost.

nasuadachi avatar Jan 11 '24 09:01 nasuadachi

mac os 14.2.1 , Apple silicon M1 max

% ./cmd_macos.sh bash-5.2$ pip install -r "re^Cirements_apple_silicon.txt" bash-5.2$ ./start_macos.sh

many many error ...

*******************************************************************
* WARNING: You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************


18:46:27-098972 INFO     Starting Text generation web UI                                                                             
18:46:27-100721 INFO     Loading the extension "gallery"                                                                             
Running on local URL:  http://127.0.0.1:7860
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: replace() argument 1 must be str, not bytes
╭──────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────╮
│ /Volumes/SSD/git/text-generation-webui/server.py:254 in <module>                                                            │
│                                                                                                                                   │
│   253         # Launch the web UI                                                                                                 │
│ ❱ 254         create_interface()                                                                                                  │
│   255         while True:                                                                                                         │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/server.py:162 in create_interface                                                    │
│                                                                                                                                   │
│   161     with OpenMonkeyPatch():                                                                                                 │
│ ❱ 162         shared.gradio['interface'].launch(                                                                                  │
│   163             prevent_thread_lock=True,                                                                                       │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py:2115 in launch     │
│                                                                                                                                   │
│   2114         ):                                                                                                                 │
│ ❱ 2115             raise ValueError(                                                                                              │
│   2116                 "When localhost is not accessible, a shareable link must be created. Ple                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to
allow access to localhost.

I tried to comment out line 39 to 47 in file modules/block_requests.py and wrote line 47 to line 48.

tangd avatar Jan 11 '24 10:01 tangd

mac os 14.2.1 , Apple silicon M1 max % ./cmd_macos.sh bash-5.2$ pip install -r "re^Cirements_apple_silicon.txt" bash-5.2$ ./start_macos.sh many many error ...

*******************************************************************
* WARNING: You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************


18:46:27-098972 INFO     Starting Text generation web UI                                                                             
18:46:27-100721 INFO     Loading the extension "gallery"                                                                             
Running on local URL:  http://127.0.0.1:7860
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: replace() argument 1 must be str, not bytes
╭──────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────╮
│ /Volumes/SSD/git/text-generation-webui/server.py:254 in <module>                                                            │
│                                                                                                                                   │
│   253         # Launch the web UI                                                                                                 │
│ ❱ 254         create_interface()                                                                                                  │
│   255         while True:                                                                                                         │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/server.py:162 in create_interface                                                    │
│                                                                                                                                   │
│   161     with OpenMonkeyPatch():                                                                                                 │
│ ❱ 162         shared.gradio['interface'].launch(                                                                                  │
│   163             prevent_thread_lock=True,                                                                                       │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py:2115 in launch     │
│                                                                                                                                   │
│   2114         ):                                                                                                                 │
│ ❱ 2115             raise ValueError(                                                                                              │
│   2116                 "When localhost is not accessible, a shareable link must be created. Ple                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to
allow access to localhost.

I tried to comment out line 39 to 47 in file modules/block_requests.py and wrote line 47 to line 48.

image

tangd avatar Jan 11 '24 10:01 tangd

same, after yaml error, got "ModuleNotFoundError: No module named 'rich'"

sdwcn avatar Jan 11 '24 10:01 sdwcn

I ended up doing pip install -r requirements.txt to get past this. I did it with the conda env set.

jrruethe avatar Jan 11 '24 18:01 jrruethe

@jrruethe tks for the tips, however i ran into another error: I reinstall by running "./start_linux.sh" after clean up installer_files folder After "ModuleNotFoundError: No module named 'yaml'" poped up, running "pip install -r requirements.txt" give me this error which is weried: my env is centos 7, Linux 3.10.0-1160.105.1.el7.x86_64 x86_64 GNU/Linux, python = 3.11, CUDA 12.2 installed 2024-01-18 141031

Any clues will be appreciated!

sdwcn avatar Jan 18 '24 06:01 sdwcn

Further to @jrruethe 's last comment: I added the following to wsl.sh, which is run by start_wsl.bat (as I am using WSL on an AMD processor):

# Originally in wsl.sh
conda activate "$INSTALL_ENV_DIR"

# ADDED: install requirements
conda update -n base -c defaults conda
conda install pip
pip install -r $INSTALL_DIR/requirements_amd.txt

Obviously the file/script in which you make these changes, and the specific requirements file to use, will depend on your environment/system.

nhaus12 avatar Jan 26 '24 08:01 nhaus12

mac os 14.2.1 , Apple silicon M1 max % ./cmd_macos.sh bash-5.2$ pip install -r "re^Cirements_apple_silicon.txt" bash-5.2$ ./start_macos.sh many many error ...

*******************************************************************
* WARNING: You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************


18:46:27-098972 INFO     Starting Text generation web UI                                                                             
18:46:27-100721 INFO     Loading the extension "gallery"                                                                             
Running on local URL:  http://127.0.0.1:7860
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: replace() argument 1 must be str, not bytes
╭──────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────╮
│ /Volumes/SSD/git/text-generation-webui/server.py:254 in <module>                                                            │
│                                                                                                                                   │
│   253         # Launch the web UI                                                                                                 │
│ ❱ 254         create_interface()                                                                                                  │
│   255         while True:                                                                                                         │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/server.py:162 in create_interface                                                    │
│                                                                                                                                   │
│   161     with OpenMonkeyPatch():                                                                                                 │
│ ❱ 162         shared.gradio['interface'].launch(                                                                                  │
│   163             prevent_thread_lock=True,                                                                                       │
│                                                                                                                                   │
│ /Volumes/SSD/git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/blocks.py:2115 in launch     │
│                                                                                                                                   │
│   2114         ):                                                                                                                 │
│ ❱ 2115             raise ValueError(                                                                                              │
│   2116                 "When localhost is not accessible, a shareable link must be created. Ple                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to
allow access to localhost.

I tried to comment out line 39 to 47 in file modules/block_requests.py and wrote line 47 to line 48.

image

comment out line 39 to 47 in file modules/block_requests.py and wrote line 47 to line 48 works for me:

modules/block_requests.py

Kindly provided by our friend WizardLM-30B

def my_open(*args, **kwargs): filename = str(args[0]) # if filename.endswith('index.html'): # with original_open(*args, **kwargs) as f: # file_contents = f.read() # # file_contents = file_contents.replace(b'\t\t<script\n\t\t\tsrc="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.7/iframeResizer.contentWindow.min.js"\n\t\t\tasync\n\t\t>', b'') # file_contents = file_contents.replace(b'cdnjs.cloudflare.com', b'127.0.0.1') # return io.BytesIO(file_contents) # else: # return original_open(*args, **kwargs)

return original_open(*args, **kwargs)

Jason-Chen-2017 avatar Jan 28 '24 12:01 Jason-Chen-2017

This issue has been closed due to inactivity for 2 months. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.

github-actions[bot] avatar May 25 '24 23:05 github-actions[bot]