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

API doesn't load in docker version

Open Reezlaw opened this issue 1 year ago • 1 comments

Describe the bug

If I try to load the extension with the CLI argument "--extensions api" in the .env file I get this:

Loading the extension "api"... Fail. Traceback (most recent call last): File "/app/modules/extensions.py", line 23, in load_extensions extension.setup() File "/app/extensions/api/script.py", line 9, in setup blocking_api.start_server(BLOCKING_PORT, share=shared.args.public_api) AttributeError: 'Namespace' object has no attribute 'public_api'

Is there an existing issue for this?

  • [X] I have searched the existing issues

Reproduction

In .env: CLI_ARGS=--model xyz --no-stream --wbits 4 --groupsize 128 --listen --auto-devices --extensions api

docker-compose up

Screenshot

No response

Logs

Loading the extension "api"... Fail.
Traceback (most recent call last):
  File "/app/modules/extensions.py", line 23, in load_extensions
    extension.setup()
  File "/app/extensions/api/script.py", line 9, in setup
    blocking_api.start_server(BLOCKING_PORT, share=shared.args.public_api)
AttributeError: 'Namespace' object has no attribute 'public_api'

System Info

OS: Manjaro

Reezlaw avatar May 02 '23 02:05 Reezlaw

image This is how chatGPT fixed it for me. Idk if this is ideal way to do it though. But it works, I can now connect to silly tavern.

import extensions.api.blocking_api as blocking_api
import extensions.api.streaming_api as streaming_api
from modules import shared

BLOCKING_PORT = 5000
STREAMING_PORT = 5005

def setup():
    shared.args.public_api = True
    blocking_api.start_server(BLOCKING_PORT, share=shared.args.public_api)
    streaming_api.start_server(STREAMING_PORT, share=shared.args.public_api)

narayanmiani avatar May 02 '23 04:05 narayanmiani

This issue has been closed due to inactivity for 30 days. If you believe it is still relevant, please leave a comment below.

github-actions[bot] avatar Jun 01 '23 23:06 github-actions[bot]