Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Exception in ASGI application || ValueError: When localhost is not accessible, a shareable link must be created #5240

Closed
1 task done
GeorgiaM-honestly opened this issue Jan 11, 2024 · 14 comments
Labels
bug Something isn't working stale

Comments

@GeorgiaM-honestly
Copy link

GeorgiaM-honestly commented Jan 11, 2024

Describe the bug

After a fresh checkout today (by fresh I mean I removed all containers, images, storage, and ~/text-generation-webui, and then doing a git clone), and following the instructions at https://github.com/oobabooga/text-generation-webui/wiki/09-%E2%80%90-Docker, during docker compose up --build I am met with the following errors at the end:

ERROR: Exception in ASGI application (lots of stuff here, will put it later)

and:

ValueError: When localhost is not accessible, a shareable link must be created

I do not believe this is related to #5235 or #5239

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

  1. cd ~/ ; git clone https://github.com/oobabooga/text-generation-webui.git
  2. cd text-generation-webui
  3. ln -s docker/{nvidia/Dockerfile,docker-compose.yml,.dockerignore} .
  4. cp docker/.env.example .env
  5. edit .env appropriately
  6. docker compose up --build

The download / build process finishes after some time, and then it dies after a lot of errors, which I will place in the Logs section.

Screenshot

N/A

Logs

text-generation-webui-text-generation-webui-1  | 
text-generation-webui-text-generation-webui-1  | ==========
text-generation-webui-text-generation-webui-1  | == CUDA ==
text-generation-webui-text-generation-webui-1  | ==========
text-generation-webui-text-generation-webui-1  | 
text-generation-webui-text-generation-webui-1  | CUDA Version 12.1.1
text-generation-webui-text-generation-webui-1  | 
text-generation-webui-text-generation-webui-1  | Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
text-generation-webui-text-generation-webui-1  | 
text-generation-webui-text-generation-webui-1  | This container image and its contents are governed by the NVIDIA Deep Learning Container License.
text-generation-webui-text-generation-webui-1  | By pulling and using the container, you accept the terms and conditions of this license:
text-generation-webui-text-generation-webui-1  | https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
text-generation-webui-text-generation-webui-1  | 
text-generation-webui-text-generation-webui-1  | A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
text-generation-webui-text-generation-webui-1  | 
text-generation-webui-text-generation-webui-1  | 21:23:26-498193 INFO     Starting Text generation web UI
text-generation-webui-text-generation-webui-1  | 21:23:26-502579 WARNING 
text-generation-webui-text-generation-webui-1  |                          You are potentially exposing the web UI to the entire
text-generation-webui-text-generation-webui-1  |                          internet without any access password.
text-generation-webui-text-generation-webui-1  |                          You can create one with the "--gradio-auth" flag like
text-generation-webui-text-generation-webui-1  |                          this:
text-generation-webui-text-generation-webui-1  |                 
text-generation-webui-text-generation-webui-1  |                          --gradio-auth username:password
text-generation-webui-text-generation-webui-1  |                 
text-generation-webui-text-generation-webui-1  |                          Make sure to replace username:password with your own.
text-generation-webui-text-generation-webui-1  | 21:23:26-505219 INFO     Loading the extension "gallery"
text-generation-webui-text-generation-webui-1  | Running on local URL:  http://0.0.0.0:7860
text-generation-webui-text-generation-webui-1  | ERROR:    Exception in ASGI application
text-generation-webui-text-generation-webui-1  | Traceback (most recent call last):
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
text-generation-webui-text-generation-webui-1  |     result = await app(  # type: ignore[func-returns-value]
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
text-generation-webui-text-generation-webui-1  |     return await self.app(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
text-generation-webui-text-generation-webui-1  |     await super().__call__(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
text-generation-webui-text-generation-webui-1  |     await self.middleware_stack(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
text-generation-webui-text-generation-webui-1  |     raise exc
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
text-generation-webui-text-generation-webui-1  |     await self.app(scope, receive, _send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 83, in __call__
text-generation-webui-text-generation-webui-1  |     await self.app(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
text-generation-webui-text-generation-webui-1  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
text-generation-webui-text-generation-webui-1  |     raise exc
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
text-generation-webui-text-generation-webui-1  |     await app(scope, receive, sender)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/routing.py", line 762, in __call__
text-generation-webui-text-generation-webui-1  |     await self.middleware_stack(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/routing.py", line 782, in app
text-generation-webui-text-generation-webui-1  |     await route.handle(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
text-generation-webui-text-generation-webui-1  |     await self.app(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
text-generation-webui-text-generation-webui-1  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
text-generation-webui-text-generation-webui-1  |     raise exc
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
text-generation-webui-text-generation-webui-1  |     await app(scope, receive, sender)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/routing.py", line 72, in app
text-generation-webui-text-generation-webui-1  |     response = await func(request)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/fastapi/routing.py", line 299, in app
text-generation-webui-text-generation-webui-1  |     raise e
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/fastapi/routing.py", line 294, in app
text-generation-webui-text-generation-webui-1  |     raw_response = await run_endpoint_function(
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
text-generation-webui-text-generation-webui-1  |     return await run_in_threadpool(dependant.call, **values)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
text-generation-webui-text-generation-webui-1  |     return await anyio.to_thread.run_sync(func, *args)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
text-generation-webui-text-generation-webui-1  |     return await get_async_backend().run_sync_in_worker_thread(
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
text-generation-webui-text-generation-webui-1  |     return await future
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 851, in run
text-generation-webui-text-generation-webui-1  |     result = context.run(func, *args)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/gradio/routes.py", line 335, in main
text-generation-webui-text-generation-webui-1  |     return templates.TemplateResponse(
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/templating.py", line 223, in TemplateResponse
text-generation-webui-text-generation-webui-1  |     template = self.get_template(name)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/starlette/templating.py", line 137, in get_template
text-generation-webui-text-generation-webui-1  |     return self.env.get_template(name)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template
text-generation-webui-text-generation-webui-1  |     return self._load_template(name, globals)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template
text-generation-webui-text-generation-webui-1  |     template = self.loader.load(self, name, self.make_globals(globals))
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/jinja2/loaders.py", line 125, in load
text-generation-webui-text-generation-webui-1  |     source, filename, uptodate = self.get_source(environment, name)
text-generation-webui-text-generation-webui-1  |   File "/home/app/.local/lib/python3.10/site-packages/jinja2/loaders.py", line 206, in get_source
text-generation-webui-text-generation-webui-1  |     with open(filename, encoding=self.encoding) as f:
text-generation-webui-text-generation-webui-1  |   File "/home/app/text-generation-webui/modules/block_requests.py", line 43, in my_open
text-generation-webui-text-generation-webui-1  |     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></script>', b'')
text-generation-webui-text-generation-webui-1  | TypeError: replace() argument 1 must be str, not bytes







^^ This happens numerous times and it would be quite painful to paste ALL of it. After these repetitions:









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

System Info

Operating system: Ubuntu Server 22.04.3 LTS
GPU: Nvidia 3090 founders edition, ti, 24GB
GPU drivers: 535.129.03
CUDA version in Ubuntu Server: 12.2
Docker Compose version: v2.21.0
Docker version: 24.0.7, build afdd53b
@GeorgiaM-honestly GeorgiaM-honestly added the bug Something isn't working label Jan 11, 2024
@545zXfk
Copy link

545zXfk commented Jan 11, 2024

same for me. cant install it.
Run it on win11 newst updates.

@dbillor
Copy link

dbillor commented Jan 11, 2024

same on my macbook

@araleza
Copy link

araleza commented Jan 11, 2024

Yep, me as well:

#5239

(I got this same error as you once I'd gotten past the yaml error)

@elikoga
Copy link

elikoga commented Jan 12, 2024

Put jinja2==3.1.2 into requirements.txt

Or do pip install jinja2==3.1.2

Or whatever

@Ahrimdon
Copy link
Contributor

Same issue here! Thought I was going crazy as it was just working yesterday. Thank you @elikoga for the solution, you are truly a saint!

@GeorgiaM-honestly
Copy link
Author

Put jinja2==3.1.2 into requirements.txt

Or do pip install jinja2==3.1.2

Or whatever

This is the solution! Thank you so much friend!

@towardreal
Copy link

@GeorgiaM-honestly I can't find the PR for this (you marked the issue people are having as completed so I figured there was a PR, unless you were marking it completed for yourself). I just tested and it still seems to be an issue.

@GeorgiaM-honestly
Copy link
Author

GeorgiaM-honestly commented Jan 13, 2024

@towardreal I apologize, I can chalk this up to a simple misunderstanding; I am not a dev or coder and am not familiar with the bugs / issues workflow. Opening this back up, and i'll look into creating a PR by looking at other PRs and refer to here.

UPDATE: I looked into creating a PR and it's just completely over my head; I am not sure how to proceed. Is there someone who can assist? The only change is that requirements.txt has "jinja2==3.1.2" added to it.

I apologize for the extra work for anybody.

@towardreal
Copy link

@GeorgiaM-honestly Hey sorry my tone was really formal, might come across the wrong way - you did great opening this issue in the first place, many people don't bother, so thank you, because it's clearly helping a few people! Don't stress about the PR, I'm sure someone will chip in to help!

@Ahrimdon
Copy link
Contributor

@GeorgiaM-honestly @towardreal PR just submitted 👍👍

@GratefulDave
Copy link

I am getting the same error on my M1. I added jinja2==3.1.2.

cd PyCharmProjects/ ; git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui
./start_macos.sh

OS==Sonoma 14.2.1

** LOGS **

ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/davidandrews/PycharmProjects/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]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 762, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 782, in app
await route.handle(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 299, in app
raise e
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/routes.py", line 335, in main
return templates.TemplateResponse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 223, in TemplateResponse
template = self.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 137, in get_template
return self.env.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 206, in get_source
with open(filename, encoding=self.encoding) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/modules/block_requests.py", line 43, in my_open
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></script>', b'')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: replace() argument 1 must be str, not bytes
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/davidandrews/PycharmProjects/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]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 762, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 782, in app
await route.handle(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 299, in app
raise e
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/routes.py", line 335, in main
return templates.TemplateResponse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 223, in TemplateResponse
template = self.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 137, in get_template
return self.env.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 206, in get_source
with open(filename, encoding=self.encoding) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/modules/block_requests.py", line 43, in my_open
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></script>', b'')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: replace() argument 1 must be str, not bytes
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/davidandrews/PycharmProjects/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]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 762, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 782, in app
await route.handle(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 299, in app
raise e
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/routes.py", line 335, in main
return templates.TemplateResponse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 223, in TemplateResponse
template = self.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 137, in get_template
return self.env.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 206, in get_source
with open(filename, encoding=self.encoding) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/modules/block_requests.py", line 43, in my_open
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></script>', b'')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: replace() argument 1 must be str, not bytes
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/davidandrews/PycharmProjects/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]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 762, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 782, in app
await route.handle(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 299, in app
raise e
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/routes.py", line 335, in main
return templates.TemplateResponse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 223, in TemplateResponse
template = self.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 137, in get_template
return self.env.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 206, in get_source
with open(filename, encoding=self.encoding) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/modules/block_requests.py", line 43, in my_open
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></script>', b'')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: replace() argument 1 must be str, not bytes
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/davidandrews/PycharmProjects/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]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 762, in call
await self.middleware_stack(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 782, in app
await route.handle(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 299, in app
raise e
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/gradio/routes.py", line 335, in main
return templates.TemplateResponse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 223, in TemplateResponse
template = self.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/starlette/templating.py", line 137, in get_template
return self.env.get_template(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/installer_files/env/lib/python3.11/site-packages/jinja2/loaders.py", line 206, in get_source
with open(filename, encoding=self.encoding) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidandrews/PycharmProjects/text-generation-webui/modules/block_requests.py", line 43, in my_open
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></script>', b'')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: replace() argument 1 must be str, not bytes
╭───────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────╮
│ /Users/davidandrews/PycharmProjects/text-generation-webui/server.py:254 in │
│ │
│ 253 # Launch the web UI │
│ ❱ 254 create_interface() │
│ 255 while True: │
│ │
│ /Users/davidandrews/PycharmProjects/text-generation-webui/server.py:162 in create_interface │
│ │
│ 161 with OpenMonkeyPatch(): │
│ ❱ 162 shared.gradio['interface'].launch( │
│ 163 prevent_thread_lock=True, │
│ │
│ /Users/davidandrews/PycharmProjects/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.

@wangqiang-kubota
Copy link

wangqiang-kubota commented Jan 13, 2024

I think this is the same issue as #5248 (comment). You can have a try to follow that solution to fix this issue.

oobabooga added a commit that referenced this issue Jan 14, 2024
@towardreal
Copy link

@GratefulDave Adding it to the requirements.txt alone doesn't do anything in most cases. Are you running it in Docker? If so you need to rebuild the container (docker-compose up --build). Otherwise perform the pip instruction the post describes, ensuring to first uninstall, then when doing pip install add --no-cache-dir to the command to ensure it doesn't simply reuse the old version (this is a guess, I don't have the same issue)

PoetOnTheRun pushed a commit to PoetOnTheRun/text-generation-webui that referenced this issue Feb 22, 2024
@github-actions github-actions bot added the stale label Mar 14, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

9 participants