ParisNeo / ollama_proxy_server

A proxy server for multiple ollama instances with Key security
Apache License 2.0
269 stars 43 forks source link

[Bug?] TypeError: _StoreTrueAction.__init__() got an unexpected keyword argument 'const' #3

Closed VfBfoerst closed 9 months ago

VfBfoerst commented 9 months ago

Hi :),

I tried the new version with the Option "-d" but went into the following error message when starting the proxy via

ollama_proxy_server -d --config ./config.ini --port 8080

Traceback (most recent call last):
  File "/usr/local/bin/ollama_proxy_server", line 33, in <module>
    sys.exit(load_entry_point('ollama-proxy-server', 'console_scripts', 'ollama_proxy_server')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ollama_proxy_server/ollama_proxy_server/main.py", line 50, in main
    parser.add_argument('-d', '--deactivate_security', action='store_true', const=True, default=False, help='Deactivates security')
  File "/usr/local/lib/python3.11/argparse.py", line 1450, in add_argument
    action = action_class(**kwargs)

TypeError: _StoreTrueAction.__init__() got an unexpected keyword argument 'const'

Environment: Debian GNU/Linux 12 (bookworm), Python 3.11

I was able to fix it via:

sed -i "s/action='store_true'/action='store_const'/g" ollama_proxy_server/main.py

(-> changed action='store_true' to action='store_const' in the main.py.)
The proxy then starts as expected.

ParisNeo commented 9 months ago

Can you test now?

VfBfoerst commented 9 months ago

just works again, thx :}