Skip to content

Fix ollama client #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

westoque
Copy link

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

  • Bug fix (non-breaking change which fixes an issue)

Mandatory Tasks

  • 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

Use the actual client code to be able to use remote ollama.
@joshbickett
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants