Fix ollama client
What does this PR do?
This fixes the ollama client code that is supposed to use the configured client vs ollama.chat directly.
Requirement/Documentation
Use client code vs direct
Notice the use of client and custom URL.
Type of change
- [X] Bug fix (non-breaking change which fixes an issue)
Mandatory Tasks
- [X] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected. Make sure before submmiting this PR you run tests with evaluate.py
Hi @westoque, thanks for the PR. I'm not super knowledgable about Ollama, but I was looking at the commit and it looks like the variable name was changed to client from model. My understanding is that is just cosmetic and doesn't change the underlying functionality. Let me know if I'm missing something. I do see that you added http://localhost:11434 as the fallback. I'm not as aware about what that does.
self.ollama_host = os.getenv("OLLAMA_HOST", "http://localhost:11434")
client = Client(host=self.ollama_host)
return client
self.ollama_host = os.getenv("OLLAMA_HOST", None)
model = Client(host=self.ollama_host)
return model
@westoque Let me know if you have any input on the question above!