Skip to content
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

ollama error #414

Open
kuatroka opened this issue Jan 5, 2025 · 1 comment
Open

ollama error #414

kuatroka opened this issue Jan 5, 2025 · 1 comment

Comments

@kuatroka
Copy link

kuatroka commented Jan 5, 2025

When using ollama, I always get a json unmarshal error, no matter json or no or what model is used.

ell version
0.0.15

code

from openai import OpenAI

MODEL = "qwen2.5-coder:14b"
client_ollama = OpenAI(
    base_url = "http://localhost:11434/v1",
    api_key = "ollama", # required but not used
)

ell.config.verbose = True
ell.config.register_model(MODEL, client_ollama)

@ell.simple(model=MODEL, client=client_ollama)
def extract_data2():
    """You are a friendly  coding AI assistant."""
    return f'''What's the time?
          '''
output = extract_data2()

error

File "/Users/Documents/dev/TMP/ell-test/.venv/lib/python3.12/site-packages/openai/_base_client.py", line 1061, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'json: cannot unmarshal array into Go struct field Message.messages.content of type string', 'type': 'invalid_request_error', 'param': None, 'code': None}}
@Metasymbols
Copy link

不需要 ell.config.register_model(MODEL, client_ollama) 这行代码,试一下

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

No branches or pull requests

2 participants