paper-qa icon indicating copy to clipboard operation
paper-qa copied to clipboard

Pydantic throwing an error when following example code

Open afonsoguerra opened this issue 1 year ago • 2 comments

I'm just trying to use a local ollama server and a sentence transformers embedding. But this seems to be failing I don't quite understand why. Any hints?

Thanks!

Error:

Extra inputs are not permitted [type=extra_forbidden, input_value=SentenceTransformerEmbedd...ti-qa-MiniLM-L6-cos-v1'), input_type=SentenceTransformerEmbeddingModel] For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden

Code:

docs = Docs(client=local_client, embedding_model=SentenceTransformerEmbeddingModel(), llm_model=OpenAILLMModel(config=dict(model="gpt-3.5-turbo", temperature=0.1, frequency_penalty=1.5, max_tokens=512)))

afonsoguerra avatar Apr 07 '24 10:04 afonsoguerra

I am also getting this error, seems the docs for local models might need to be updated?

zekemorton avatar Apr 30 '24 21:04 zekemorton

me too, the same error

wxjttxs avatar Jun 11 '24 09:06 wxjttxs

It's because Docs forbids extra parameters: https://github.com/Future-House/paper-qa/blob/v4.9.0/paperqa/docs.py#L75

It looks like you were trying to set an embedding_model, which is not an attribute of Docs.

What you should do instead is utilize Docs.set_client.


We rewrote most of paperqa in v5, so please reopen a new issue if the problem persists

jamesbraza avatar Sep 11 '24 17:09 jamesbraza