Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BerriAI/litellm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: tsmdt/litellm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jan 7, 2025

  1. Add nest_asyncio to fix ollama embed 'event loop closed' error

    tsmdt committed Jan 7, 2025
    Copy the full SHA
    f3c1b77 View commit details
Showing with 5 additions and 1 deletion.
  1. +4 −1 litellm/llms/ollama/completion/handler.py
  2. +1 −0 pyproject.toml
5 changes: 4 additions & 1 deletion litellm/llms/ollama/completion/handler.py
Original file line number Diff line number Diff line change
@@ -5,15 +5,18 @@
"""

import asyncio
import nest_asyncio

from typing import Any, Dict, List

import litellm
from litellm.types.utils import EmbeddingResponse

nest_asyncio.apply()

# ollama wants plain base64 jpeg/png files as images. strip any leading dataURI
# and convert to jpeg if necessary.


async def ollama_aembeddings(
api_base: str,
model: str,
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ azure-keyvault-secrets = {version = "^4.8.0", optional = true}
google-cloud-kms = {version = "^2.21.3", optional = true}
resend = {version = "^0.8.0", optional = true}
pynacl = {version = "^1.5.0", optional = true}
nest-asyncio = "1.6.0"

[tool.poetry.extras]
proxy = [