Find answers from the community

Updated 5 months ago

Ollama

At a glance

The community member is encountering a TypeError when trying to use the OllamaQueryEnginePack with the "stablelm-zephyr" model and some documents. The full error message indicates that the __init__ method of the Ollama class is expecting 1 positional argument but 2 were given.

Other community members have suggested that the issue may be related to the llama_packs-ollama_query_engine package, and that the code in the package may need to be updated. One community member has provided a potential solution, which is to download the package and edit the code to use llm = Ollama(model=self_model, base_url=self._base_url) instead of the original code.

However, there is no explicitly marked answer, and the community member who is new to Python has requested further elaboration on what to do exactly to resolve the issue.

Useful resources
is there change to this loader ?

‘’’

ollama_pack = OllamaQueryEnginePack(model="stablelm-zephyr", documents=documents)

TypeError: init() takes 1 positional argument but 2 were given#
‘’’
L
m
7 comments
What's the full error?
Plain Text
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_41001/2211308542.py in <module>
      1 # You can use any llama-hub loader to get documents!
----> 2 ollama_pack = OllamaQueryEnginePack(model="stablelm-zephyr", documents=documents)

~/Desktop/dummy/code-server/workspace/SPEED/ollama_pack/base.py in __init__(self, model, base_url, documents)
     23         self._base_url = base_url
     24 
---> 25         llm = Ollama(self._model, base_url=self._base_url)
     26 
     27         embed_model = OllamaEmbedding(model_name=self._model, base_url=self._base_url)

TypeError: __init__() takes 1 positional argument but 2 were given
tried it on my linux ubuntu and m1 mac mini
The llamapack code just needs to be updated.

Download the pack and edit the code

Plain Text
llm = Ollama(model=self_model, base_url=self._base_url)
Fairly new to python can you please elaborate on what to do exactly. Im running this on jupyter notebook
Add a reply
Sign up and join the conversation on Discord