paper-qa
paper-qa copied to clipboard
Pydantic throwing an error when following example code
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)))
I am also getting this error, seems the docs for local models might need to be updated?
me too, the same error
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