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

OpenAI API endpoint v1/completions won't load model after unload unlike v1/chat/completions #6517

Open
1 task done
Originalimoc opened this issue Nov 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Originalimoc
Copy link

Describe the bug

Enable model auto unload then in the unloaded state call v1/completions will result in No Tokenizer Loaded error because it won't auto load back like v1/chat/completions

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

Above

Screenshot

No response

Logs

Above

System Info

WSL2
@Originalimoc Originalimoc added the bug Something isn't working label Nov 5, 2024
@SirFlobo
Copy link

I'm getting the same error message. I'm using a fresh install of the latest release (v1.16) on windows.
I've posted the relevant console logs below.

12:08:04-495353 INFO     Unloading the model for inactivity.
Exception in ASGI application
Traceback (most recent call last):
  File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\sse_starlette\sse.py", line 247, in __call__
    await wrap(partial(self.listen_for_disconnect, receive))
  File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\sse_starlette\sse.py", line 236, in wrap
    await func()
  File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\sse_starlette\sse.py", line 191, in listen_for_disconnect
    message = await receive()
              ^^^^^^^^^^^^^^^
  File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 534, in receive
    await self.message_event.wait()
  File "P:\AI\oobabooga\installer_files\env\Lib\asyncio\locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 22f631f7290

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 406, in run_asgi
  |     result = await app(  # type: ignore[func-returns-value]
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
  |     return await self.app(scope, receive, send)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\fastapi\applications.py", line 1054, in __call__
  |     await super().__call__(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\applications.py", line 113, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\middleware\errors.py", line 187, in __call__
  |     raise exc
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\middleware\errors.py", line 165, in __call__
  |     await self.app(scope, receive, _send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\middleware\cors.py", line 85, in __call__
  |     await self.app(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in __call__
  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\_exception_handler.py", line 62, in wrapped_app
  |     raise exc
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\_exception_handler.py", line 51, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\routing.py", line 715, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\routing.py", line 735, in app
  |     await route.handle(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\routing.py", line 288, in handle
  |     await self.app(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\routing.py", line 76, in app
  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\_exception_handler.py", line 62, in wrapped_app
  |     raise exc
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\_exception_handler.py", line 51, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\starlette\routing.py", line 74, in app
  |     await response(scope, receive, send)
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\sse_starlette\sse.py", line 233, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\anyio\_backends\_asyncio.py", line 763, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\sse_starlette\sse.py", line 236, in wrap
    |     await func()
    |   File "P:\AI\oobabooga\installer_files\env\Lib\site-packages\sse_starlette\sse.py", line 221, in stream_response
    |     async for data in self.body_iterator:
    |   File "P:\AI\oobabooga\extensions\openai\script.py", line 106, in generator
    |     for resp in response:
    |   File "P:\AI\oobabooga\extensions\openai\completions.py", line 559, in stream_completions
    |     for resp in completions_common(body, is_legacy, stream=True):
    |   File "P:\AI\oobabooga\extensions\openai\completions.py", line 485, in completions_common
    |     token_count = len(encode(prompt)[0])
    |                       ^^^^^^^^^^^^^^
    |   File "P:\AI\oobabooga\modules\text_generation.py", line 133, in encode
    |     raise ValueError('No tokenizer is loaded')
    | ValueError: No tokenizer is loaded
    +------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants