[GH-ISSUE #7468] when call /api/embed via code, it throws error: alueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have dict attribute')] #14759

Closed
opened 2026-04-19 21:03:09 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @sycbbyes on GitHub (Nov 29, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7468

Bug Report

Important Notes

Installation Method

[Describe the method you used to install the project, e.g., git clone, Docker, pip, etc.]

Environment

  • **Open WebUI Version:
    v0.4.5, v0.4.6
  • **Ollama (if applicable):
    v0.4.5
  • Operating System:
    linux
  • Browser (if applicable):
    chrome

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

[Describe what you expected to happen.]

Actual Behavior:

[Describe what actually happened.]

Description

Bug Summary:
when call /api/embed via code, it throws error: alueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have dict attribute')]

Reproduction Details

import requests

baseUrl = "http://192.168.1.48:8080/ollama/api"
headers = {"Content-Type": "application/json",
"Authorization": "Bearer sk-b4818467521b4b0daa76609f923ff2b8",
}

def generateEmbeding(valText,modelLLM):
url = f"{baseUrl}/embed"
data = {
"model": modelLLM,
"input": valText,
# "stream": True,
# "truncate": True,
}
response = requests.post(url, headers=headers, json=data)
print(response)
return response

testTxt = generateEmbeding(["who you are"],"gemma2:latest")
print(testTxt)

Logs and Screenshots

Browser Console Logs:
[Include relevant browser console logs, if applicable]

Docker Container Logs:
ollama-webui | 2024-11-29T01:53:13.072532123Z INFO: 172.19.0.1:39808 - "POST /ollama/api/embed HTTP/1.1" 500 Internal Server Error
ollama-webui | 2024-11-29T01:53:13.080277305Z ERROR: Exception in ASGI application
ollama-webui | 2024-11-29T01:53:13.080293231Z Traceback (most recent call last):
ollama-webui | 2024-11-29T01:53:13.080297311Z File "/usr/local/lib/python3.11/site-packages/fastapi/encoders.py", line 324, in jsonable_encoder
ollama-webui | 2024-11-29T01:53:13.080300945Z data = dict(obj)
ollama-webui | 2024-11-29T01:53:13.080303962Z ^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080307054Z TypeError: 'coroutine' object is not iterable
ollama-webui | 2024-11-29T01:53:13.080310294Z
ollama-webui | 2024-11-29T01:53:13.080313431Z During handling of the above exception, another exception occurred:
ollama-webui | 2024-11-29T01:53:13.080316592Z
ollama-webui | 2024-11-29T01:53:13.080319612Z Traceback (most recent call last):
ollama-webui | 2024-11-29T01:53:13.080322627Z File "/usr/local/lib/python3.11/site-packages/fastapi/encoders.py", line 329, in jsonable_encoder
ollama-webui | 2024-11-29T01:53:13.080325978Z data = vars(obj)
ollama-webui | 2024-11-29T01:53:13.080328964Z ^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080331967Z TypeError: vars() argument must have dict attribute
ollama-webui | 2024-11-29T01:53:13.080335271Z
ollama-webui | 2024-11-29T01:53:13.080338311Z The above exception was the direct cause of the following exception:
ollama-webui | 2024-11-29T01:53:13.080341334Z
ollama-webui | 2024-11-29T01:53:13.080344315Z Traceback (most recent call last):
ollama-webui | 2024-11-29T01:53:13.080347387Z File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
ollama-webui | 2024-11-29T01:53:13.080350718Z result = await app( # type: ignore[func-returns-value]
ollama-webui | 2024-11-29T01:53:13.080353667Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080356952Z File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in call
ollama-webui | 2024-11-29T01:53:13.080360519Z return await self.app(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080363718Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080366702Z File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
ollama-webui | 2024-11-29T01:53:13.080397071Z await super().call(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080422475Z File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
ollama-webui | 2024-11-29T01:53:13.080432531Z await self.middleware_stack(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080435979Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
ollama-webui | 2024-11-29T01:53:13.080439329Z raise exc
ollama-webui | 2024-11-29T01:53:13.080442360Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
ollama-webui | 2024-11-29T01:53:13.080445682Z await self.app(scope, receive, _send)
ollama-webui | 2024-11-29T01:53:13.080448660Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080451918Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080454913Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080458109Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080461045Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080464638Z raise exc
ollama-webui | 2024-11-29T01:53:13.080468422Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080472027Z await func()
ollama-webui | 2024-11-29T01:53:13.080474986Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080478350Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080481355Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080484412Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080487599Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080496889Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080500266Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080503167Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080506457Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080509443Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080512710Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080515657Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080518744Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080521677Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080524850Z raise exc
ollama-webui | 2024-11-29T01:53:13.080527794Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080530940Z await func()
ollama-webui | 2024-11-29T01:53:13.080536464Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080539770Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080542821Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080545897Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080549067Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080552044Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080555214Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080558109Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080561263Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080564284Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080567441Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080570374Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080573800Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080576967Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080580140Z raise exc
ollama-webui | 2024-11-29T01:53:13.080583170Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080586344Z await func()
ollama-webui | 2024-11-29T01:53:13.080589353Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080592553Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080595614Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080598577Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080617303Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080620617Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080623951Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080626851Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080630137Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080633151Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080636467Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080639388Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080642665Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080648118Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080651752Z raise exc
ollama-webui | 2024-11-29T01:53:13.080654694Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080657972Z await func()
ollama-webui | 2024-11-29T01:53:13.080660980Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080664160Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080667209Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080670208Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080673498Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080676589Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080679748Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080682647Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080685842Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080689648Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080693131Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080696105Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080699344Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080702276Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080705565Z raise exc
ollama-webui | 2024-11-29T01:53:13.080708565Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080711839Z await func()
ollama-webui | 2024-11-29T01:53:13.080714851Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080718122Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080721169Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080724212Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080727394Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080730425Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080733579Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080736566Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080739813Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080745376Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in call
ollama-webui | 2024-11-29T01:53:13.080748728Z await self.app(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080751703Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080754916Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080757828Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080760918Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080763985Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080767238Z raise exc
ollama-webui | 2024-11-29T01:53:13.080770260Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080773478Z await func()
ollama-webui | 2024-11-29T01:53:13.080776548Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080779766Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080783072Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080786143Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080789316Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080792725Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080795958Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080803105Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080812377Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080815596Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080818919Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080821866Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080825093Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080828065Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080831362Z raise exc
ollama-webui | 2024-11-29T01:53:13.080834539Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080837803Z await func()
ollama-webui | 2024-11-29T01:53:13.080840687Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080843953Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080846906Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080849980Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080855940Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080859162Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080862433Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080865436Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080868561Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080871826Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
ollama-webui | 2024-11-29T01:53:13.080875026Z with collapse_excgroups():
ollama-webui | 2024-11-29T01:53:13.080878053Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
ollama-webui | 2024-11-29T01:53:13.080881127Z self.gen.throw(typ, value, traceback)
ollama-webui | 2024-11-29T01:53:13.080884493Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
ollama-webui | 2024-11-29T01:53:13.080887686Z raise exc
ollama-webui | 2024-11-29T01:53:13.080890697Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
ollama-webui | 2024-11-29T01:53:13.080893867Z await func()
ollama-webui | 2024-11-29T01:53:13.080896878Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
ollama-webui | 2024-11-29T01:53:13.080900033Z return await super().stream_response(send)
ollama-webui | 2024-11-29T01:53:13.080903097Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.080906348Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
ollama-webui | 2024-11-29T01:53:13.080909703Z async for chunk in self.body_iterator:
ollama-webui | 2024-11-29T01:53:13.080912686Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
ollama-webui | 2024-11-29T01:53:13.080915946Z raise app_exc
ollama-webui | 2024-11-29T01:53:13.080918824Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
ollama-webui | 2024-11-29T01:53:13.080922096Z await self.app(scope, receive_or_disconnect, send_no_error)
ollama-webui | 2024-11-29T01:53:13.080925284Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in call
ollama-webui | 2024-11-29T01:53:13.080928481Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080932758Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
ollama-webui | 2024-11-29T01:53:13.080935988Z raise exc
ollama-webui | 2024-11-29T01:53:13.080939105Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
ollama-webui | 2024-11-29T01:53:13.080942321Z await app(scope, receive, sender)
ollama-webui | 2024-11-29T01:53:13.080945410Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in call
ollama-webui | 2024-11-29T01:53:13.080950820Z await self.middleware_stack(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080954105Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
ollama-webui | 2024-11-29T01:53:13.080957301Z await route.handle(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080960415Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 485, in handle
ollama-webui | 2024-11-29T01:53:13.080963631Z await self.app(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080966778Z File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
ollama-webui | 2024-11-29T01:53:13.080970175Z await super().call(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080973297Z File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
ollama-webui | 2024-11-29T01:53:13.080976632Z await self.middleware_stack(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080979651Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
ollama-webui | 2024-11-29T01:53:13.080982941Z raise exc
ollama-webui | 2024-11-29T01:53:13.080985835Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
ollama-webui | 2024-11-29T01:53:13.080989030Z await self.app(scope, receive, _send)
ollama-webui | 2024-11-29T01:53:13.080992111Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in call
ollama-webui | 2024-11-29T01:53:13.080995288Z await self.app(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.080998272Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in call
ollama-webui | 2024-11-29T01:53:13.081003617Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.081022467Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
ollama-webui | 2024-11-29T01:53:13.081026982Z raise exc
ollama-webui | 2024-11-29T01:53:13.081030055Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
ollama-webui | 2024-11-29T01:53:13.081033241Z await app(scope, receive, sender)
ollama-webui | 2024-11-29T01:53:13.081036249Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in call
ollama-webui | 2024-11-29T01:53:13.081039421Z await self.middleware_stack(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.081042439Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
ollama-webui | 2024-11-29T01:53:13.081045625Z await route.handle(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.081048608Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
ollama-webui | 2024-11-29T01:53:13.081051784Z await self.app(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.081054775Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
ollama-webui | 2024-11-29T01:53:13.081057948Z await wrap_app_handling_exceptions(app, request)(scope, receive, send)
ollama-webui | 2024-11-29T01:53:13.081064058Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
ollama-webui | 2024-11-29T01:53:13.081067361Z raise exc
ollama-webui | 2024-11-29T01:53:13.081070271Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
ollama-webui | 2024-11-29T01:53:13.081073425Z await app(scope, receive, sender)
ollama-webui | 2024-11-29T01:53:13.081076369Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
ollama-webui | 2024-11-29T01:53:13.081086356Z response = await func(request)
ollama-webui | 2024-11-29T01:53:13.081089491Z ^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.081092448Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 296, in app
ollama-webui | 2024-11-29T01:53:13.081095786Z content = await serialize_response(
ollama-webui | 2024-11-29T01:53:13.081098720Z ^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.081101799Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 180, in serialize_response
ollama-webui | 2024-11-29T01:53:13.081104992Z return jsonable_encoder(response_content)
ollama-webui | 2024-11-29T01:53:13.081108105Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ollama-webui | 2024-11-29T01:53:13.081111205Z File "/usr/local/lib/python3.11/site-packages/fastapi/encoders.py", line 332, in jsonable_encoder
ollama-webui | 2024-11-29T01:53:13.081114529Z raise ValueError(errors) from e
ollama-webui | 2024-11-29T01:53:13.081117489Z ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have dict attribute')]

Screenshots/Screen Recordings (if applicable):
[Attach any relevant screenshots to help illustrate the issue]

Additional Information

[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @sycbbyes on GitHub (Nov 29, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/7468 # Bug Report ## Important Notes ## Installation Method [Describe the method you used to install the project, e.g., git clone, Docker, pip, etc.] ## Environment - **Open WebUI Version: v0.4.5, v0.4.6 - **Ollama (if applicable): v0.4.5 - **Operating System:** linux - **Browser (if applicable):** chrome **Confirmation:** - [ ] I have read and followed all the instructions provided in the README.md. - [ ] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [ ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: [Describe what you expected to happen.] ## Actual Behavior: [Describe what actually happened.] ## Description **Bug Summary:** when call /api/embed via code, it throws error: alueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have dict attribute')] ## Reproduction Details import requests baseUrl = "http://192.168.1.48:8080/ollama/api" headers = {"Content-Type": "application/json", "Authorization": "Bearer sk-b4818467521b4b0daa76609f923ff2b8", } def generateEmbeding(valText,modelLLM): url = f"{baseUrl}/embed" data = { "model": modelLLM, "input": valText, # "stream": True, # "truncate": True, } response = requests.post(url, headers=headers, json=data) print(response) return response testTxt = generateEmbeding(["who you are"],"gemma2:latest") print(testTxt) ## Logs and Screenshots **Browser Console Logs:** [Include relevant browser console logs, if applicable] **Docker Container Logs:** ollama-webui | 2024-11-29T01:53:13.072532123Z INFO: 172.19.0.1:39808 - "POST /ollama/api/embed HTTP/1.1" 500 Internal Server Error ollama-webui | 2024-11-29T01:53:13.080277305Z ERROR: Exception in ASGI application ollama-webui | 2024-11-29T01:53:13.080293231Z Traceback (most recent call last): ollama-webui | 2024-11-29T01:53:13.080297311Z File "/usr/local/lib/python3.11/site-packages/fastapi/encoders.py", line 324, in jsonable_encoder ollama-webui | 2024-11-29T01:53:13.080300945Z data = dict(obj) ollama-webui | 2024-11-29T01:53:13.080303962Z ^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080307054Z TypeError: 'coroutine' object is not iterable ollama-webui | 2024-11-29T01:53:13.080310294Z ollama-webui | 2024-11-29T01:53:13.080313431Z During handling of the above exception, another exception occurred: ollama-webui | 2024-11-29T01:53:13.080316592Z ollama-webui | 2024-11-29T01:53:13.080319612Z Traceback (most recent call last): ollama-webui | 2024-11-29T01:53:13.080322627Z File "/usr/local/lib/python3.11/site-packages/fastapi/encoders.py", line 329, in jsonable_encoder ollama-webui | 2024-11-29T01:53:13.080325978Z data = vars(obj) ollama-webui | 2024-11-29T01:53:13.080328964Z ^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080331967Z TypeError: vars() argument must have __dict__ attribute ollama-webui | 2024-11-29T01:53:13.080335271Z ollama-webui | 2024-11-29T01:53:13.080338311Z The above exception was the direct cause of the following exception: ollama-webui | 2024-11-29T01:53:13.080341334Z ollama-webui | 2024-11-29T01:53:13.080344315Z Traceback (most recent call last): ollama-webui | 2024-11-29T01:53:13.080347387Z File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi ollama-webui | 2024-11-29T01:53:13.080350718Z result = await app( # type: ignore[func-returns-value] ollama-webui | 2024-11-29T01:53:13.080353667Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080356952Z File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ ollama-webui | 2024-11-29T01:53:13.080360519Z return await self.app(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080363718Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080366702Z File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ ollama-webui | 2024-11-29T01:53:13.080397071Z await super().__call__(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080422475Z File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ ollama-webui | 2024-11-29T01:53:13.080432531Z await self.middleware_stack(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080435979Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ ollama-webui | 2024-11-29T01:53:13.080439329Z raise exc ollama-webui | 2024-11-29T01:53:13.080442360Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ ollama-webui | 2024-11-29T01:53:13.080445682Z await self.app(scope, receive, _send) ollama-webui | 2024-11-29T01:53:13.080448660Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080451918Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080454913Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080458109Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080461045Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080464638Z raise exc ollama-webui | 2024-11-29T01:53:13.080468422Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080472027Z await func() ollama-webui | 2024-11-29T01:53:13.080474986Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080478350Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080481355Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080484412Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080487599Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080496889Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080500266Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080503167Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080506457Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080509443Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080512710Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080515657Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080518744Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080521677Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080524850Z raise exc ollama-webui | 2024-11-29T01:53:13.080527794Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080530940Z await func() ollama-webui | 2024-11-29T01:53:13.080536464Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080539770Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080542821Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080545897Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080549067Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080552044Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080555214Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080558109Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080561263Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080564284Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080567441Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080570374Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080573800Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080576967Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080580140Z raise exc ollama-webui | 2024-11-29T01:53:13.080583170Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080586344Z await func() ollama-webui | 2024-11-29T01:53:13.080589353Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080592553Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080595614Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080598577Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080617303Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080620617Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080623951Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080626851Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080630137Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080633151Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080636467Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080639388Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080642665Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080648118Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080651752Z raise exc ollama-webui | 2024-11-29T01:53:13.080654694Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080657972Z await func() ollama-webui | 2024-11-29T01:53:13.080660980Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080664160Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080667209Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080670208Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080673498Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080676589Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080679748Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080682647Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080685842Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080689648Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080693131Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080696105Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080699344Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080702276Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080705565Z raise exc ollama-webui | 2024-11-29T01:53:13.080708565Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080711839Z await func() ollama-webui | 2024-11-29T01:53:13.080714851Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080718122Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080721169Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080724212Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080727394Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080730425Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080733579Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080736566Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080739813Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080745376Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ ollama-webui | 2024-11-29T01:53:13.080748728Z await self.app(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080751703Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080754916Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080757828Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080760918Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080763985Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080767238Z raise exc ollama-webui | 2024-11-29T01:53:13.080770260Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080773478Z await func() ollama-webui | 2024-11-29T01:53:13.080776548Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080779766Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080783072Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080786143Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080789316Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080792725Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080795958Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080803105Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080812377Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080815596Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080818919Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080821866Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080825093Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080828065Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080831362Z raise exc ollama-webui | 2024-11-29T01:53:13.080834539Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080837803Z await func() ollama-webui | 2024-11-29T01:53:13.080840687Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080843953Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080846906Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080849980Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080855940Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080859162Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080862433Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080865436Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080868561Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080871826Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ ollama-webui | 2024-11-29T01:53:13.080875026Z with collapse_excgroups(): ollama-webui | 2024-11-29T01:53:13.080878053Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ ollama-webui | 2024-11-29T01:53:13.080881127Z self.gen.throw(typ, value, traceback) ollama-webui | 2024-11-29T01:53:13.080884493Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups ollama-webui | 2024-11-29T01:53:13.080887686Z raise exc ollama-webui | 2024-11-29T01:53:13.080890697Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap ollama-webui | 2024-11-29T01:53:13.080893867Z await func() ollama-webui | 2024-11-29T01:53:13.080896878Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response ollama-webui | 2024-11-29T01:53:13.080900033Z return await super().stream_response(send) ollama-webui | 2024-11-29T01:53:13.080903097Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.080906348Z File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response ollama-webui | 2024-11-29T01:53:13.080909703Z async for chunk in self.body_iterator: ollama-webui | 2024-11-29T01:53:13.080912686Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream ollama-webui | 2024-11-29T01:53:13.080915946Z raise app_exc ollama-webui | 2024-11-29T01:53:13.080918824Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro ollama-webui | 2024-11-29T01:53:13.080922096Z await self.app(scope, receive_or_disconnect, send_no_error) ollama-webui | 2024-11-29T01:53:13.080925284Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ ollama-webui | 2024-11-29T01:53:13.080928481Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080932758Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app ollama-webui | 2024-11-29T01:53:13.080935988Z raise exc ollama-webui | 2024-11-29T01:53:13.080939105Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app ollama-webui | 2024-11-29T01:53:13.080942321Z await app(scope, receive, sender) ollama-webui | 2024-11-29T01:53:13.080945410Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ ollama-webui | 2024-11-29T01:53:13.080950820Z await self.middleware_stack(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080954105Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app ollama-webui | 2024-11-29T01:53:13.080957301Z await route.handle(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080960415Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 485, in handle ollama-webui | 2024-11-29T01:53:13.080963631Z await self.app(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080966778Z File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ ollama-webui | 2024-11-29T01:53:13.080970175Z await super().__call__(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080973297Z File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ ollama-webui | 2024-11-29T01:53:13.080976632Z await self.middleware_stack(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080979651Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ ollama-webui | 2024-11-29T01:53:13.080982941Z raise exc ollama-webui | 2024-11-29T01:53:13.080985835Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ ollama-webui | 2024-11-29T01:53:13.080989030Z await self.app(scope, receive, _send) ollama-webui | 2024-11-29T01:53:13.080992111Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ ollama-webui | 2024-11-29T01:53:13.080995288Z await self.app(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.080998272Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ ollama-webui | 2024-11-29T01:53:13.081003617Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.081022467Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app ollama-webui | 2024-11-29T01:53:13.081026982Z raise exc ollama-webui | 2024-11-29T01:53:13.081030055Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app ollama-webui | 2024-11-29T01:53:13.081033241Z await app(scope, receive, sender) ollama-webui | 2024-11-29T01:53:13.081036249Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ ollama-webui | 2024-11-29T01:53:13.081039421Z await self.middleware_stack(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.081042439Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app ollama-webui | 2024-11-29T01:53:13.081045625Z await route.handle(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.081048608Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle ollama-webui | 2024-11-29T01:53:13.081051784Z await self.app(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.081054775Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app ollama-webui | 2024-11-29T01:53:13.081057948Z await wrap_app_handling_exceptions(app, request)(scope, receive, send) ollama-webui | 2024-11-29T01:53:13.081064058Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app ollama-webui | 2024-11-29T01:53:13.081067361Z raise exc ollama-webui | 2024-11-29T01:53:13.081070271Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app ollama-webui | 2024-11-29T01:53:13.081073425Z await app(scope, receive, sender) ollama-webui | 2024-11-29T01:53:13.081076369Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app ollama-webui | 2024-11-29T01:53:13.081086356Z response = await func(request) ollama-webui | 2024-11-29T01:53:13.081089491Z ^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.081092448Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 296, in app ollama-webui | 2024-11-29T01:53:13.081095786Z content = await serialize_response( ollama-webui | 2024-11-29T01:53:13.081098720Z ^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.081101799Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 180, in serialize_response ollama-webui | 2024-11-29T01:53:13.081104992Z return jsonable_encoder(response_content) ollama-webui | 2024-11-29T01:53:13.081108105Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ollama-webui | 2024-11-29T01:53:13.081111205Z File "/usr/local/lib/python3.11/site-packages/fastapi/encoders.py", line 332, in jsonable_encoder ollama-webui | 2024-11-29T01:53:13.081114529Z raise ValueError(errors) from e ollama-webui | 2024-11-29T01:53:13.081117489Z ValueError: [TypeError("'coroutine' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')] **Screenshots/Screen Recordings (if applicable):** [Attach any relevant screenshots to help illustrate the issue] ## Additional Information [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.] ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@tjbck commented on GitHub (Nov 29, 2024):

Good catch, fixed on dev!

<!-- gh-comment-id:2506942159 --> @tjbck commented on GitHub (Nov 29, 2024): Good catch, fixed on dev!
Author
Owner

@sycbbyes commented on GitHub (Dec 5, 2024):

in 0.4.8-rc0 it fixed ,but did not return right result in the api response.

`
import requests

baseUrl = "http://192.168.1.48:8080/ollama/api"
headers = {"Content-Type": "application/json",
"Authorization": "Bearer sk-b4818467521b4b0daa76609f923ff2b8",
}

def generateEmbeding(valText,modelLLM):
url = f"{baseUrl}/embed"
data = {
"model": modelLLM,
"input": valText,
# "stream": True,
# "truncate": True,
}
response = requests.post(url, headers=headers, json=data)
print(response)
return response

testTxt = generateEmbeding("who you are","gemma2:latest")
print(testTxt)
`

<Response [200]>
<Response [200]>

<!-- gh-comment-id:2519481828 --> @sycbbyes commented on GitHub (Dec 5, 2024): in 0.4.8-rc0 it fixed ,but did not return right result in the api response. ` import requests baseUrl = "http://192.168.1.48:8080/ollama/api" headers = {"Content-Type": "application/json", "Authorization": "Bearer sk-b4818467521b4b0daa76609f923ff2b8", } def generateEmbeding(valText,modelLLM): url = f"{baseUrl}/embed" data = { "model": modelLLM, "input": valText, # "stream": True, # "truncate": True, } response = requests.post(url, headers=headers, json=data) print(response) return response testTxt = generateEmbeding("who you are","gemma2:latest") print(testTxt) ` > <Response [200]> <Response [200]>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#14759