self-operating-computer icon indicating copy to clipboard operation
self-operating-computer copied to clipboard

Fix ollama client

Open westoque opened this issue 10 months ago • 2 comments

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

westoque avatar Jan 27 '25 20:01 westoque

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

joshbickett avatar Feb 19 '25 21:02 joshbickett

@westoque Let me know if you have any input on the question above!

joshbickett avatar Feb 28 '25 22:02 joshbickett