mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
TypeError: Client.__init__() got an unexpected keyword argument 'follow_redirects' #74
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chozillla on GitHub (Apr 26, 2024).
`TypeError Traceback (most recent call last)
Cell In[24], line 21
19 from tqdm.notebook import tqdm
20 import os
---> 21 import ollama
File ~/anaconda3/lib/python3.11/site-packages/ollama/__init__.py:34
2 from ollama._types import (
3 GenerateResponse,
4 ChatResponse,
(...)
9 ResponseError,
10 )
12 all = [
13 'Client',
14 'AsyncClient',
(...)
31 'show',
32 ]
---> 34 _client = Client()
36 generate = _client.generate
37 chat = _client.chat
File ~/anaconda3/lib/python3.11/site-packages/ollama/_client.py:65, in Client.init(self, host, **kwargs)
64 def init(self, host: Optional[str] = None, **kwargs) -> None:
---> 65 super().init(httpx.Client, host, **kwargs)
File ~/anaconda3/lib/python3.11/site-packages/ollama/_client.py:54, in BaseClient.init(self, client, host, follow_redirects, timeout, **kwargs)
51 headers['Accept'] = 'application/json'
52 headers['User-Agent'] = f'ollama-python/{version} ({platform.machine()} {platform.system().lower()}) Python/{platform.python_version()}'
---> 54 self._client = client(
55 base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),
56 follow_redirects=follow_redirects,
57 timeout=timeout,
58 headers=headers,
59 **kwargs,
60 )
TypeError: Client.init() got an unexpected keyword argument 'follow_redirects'`
So I tried to import Ollama got that issue :(
@chozillla commented on GitHub (Apr 26, 2024):
Nvm just exited vscode and restarted it.