-
Notifications
You must be signed in to change notification settings - Fork 546
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
import ollama error when os.environ["HTTP_PROXY"] = "socks5h://xxx" #424
Comments
If you do not need to use proxy for reaching ollama, set evn. variable for ignoring localhost: import os
os.environ['NO_PROXY'] = 'localhost,127.0.0.1,::1' |
Thank you, but not work. My Problem is not "not need to use proxy", but "import ollama" error, below is error stack:
CODE1 call Client() without any args, and CODE2 call Proxy(url="socks5h://xxx") if get_environment_proxies() found one(whether used or not used), then ValueError CODE1 is only used to set variables generate, chat, ...
change it to
will set variables to same result, and no ValueError thanks |
httpx >= 0.28.0 support socks5h done |
I use ollama in a proxy environment, so os.environ["HTTP_PROXY"] = "socks5h://xxx", But
I use this code to create ollama client, so I can control the proxy:
client = ollama.Client(host="http://127.0.0.1:11434", trust_env = False)
But in ollama/__init__.py, this code cause error:
_client = Client()
the error is:
ValueError: Unknown scheme for proxy URL URL('socks5h://
cause by this judge:
if url.scheme not in ("http", "https", "socks5"):
So, my question is, could:
The text was updated successfully, but these errors were encountered: