ollama / ollama-python

Ollama Python library
https://ollama.com
MIT License
2.69k stars 221 forks source link

TypeError: Client.__init__() got an unexpected keyword argument 'follow_redirects' #133

Closed chozillla closed 2 months ago

chozillla commented 2 months ago

`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 2 months ago

Nvm just exited vscode and restarted it.