text-generation-webui
text-generation-webui copied to clipboard
API doesn't load in docker version
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
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)
This issue has been closed due to inactivity for 30 days. If you believe it is still relevant, please leave a comment below.