Skip to content

Commit

Permalink
Merge pull request #311 from reecelikesramen/issue-310-ollama-autocommit
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD authored Oct 18, 2024
2 parents 0161dee + 70d4e9e commit 612aa39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ell/models/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def register(base_url):
It logs any errors encountered during the process.
"""
global client
client = openai.Client(base_url=base_url)
client = openai.Client(base_url=base_url, api_key="ollama")

try:
response = requests.get(f"{base_url}/../api/tags")
Expand Down
4 changes: 2 additions & 2 deletions src/ell/util/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def {fn.__name__}(...):


def _autocommit_warning():
if (config.get_client_for("gpt-4o-mini")[0] is None):
logger.warning(f"{Fore.LIGHTYELLOW_EX}WARNING: Autocommit is enabled but no OpenAI client found for autocommit model 'gpt-4o-mini' (set your OpenAI API key). Commit messages will not be written.{Style.RESET_ALL}")
if (config.get_client_for(config.autocommit_model)[0] is None):
logger.warning(f"{Fore.LIGHTYELLOW_EX}WARNING: Autocommit is enabled but no client found for autocommit model '{config.autocommit_model}'. Commit messages will not be written.{Style.RESET_ALL}")
return True
return False

0 comments on commit 612aa39

Please sign in to comment.