Skip to content

Compatibility issues with Chinese and slow response speed. #100

Closed
@B1gM8c

Description

@B1gM8c

There seem to be some compatibility issues with ChatBot, as an error occurs when inputting Chinese characters.

    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 276, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 69, in app
    await response(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/sse_starlette/sse.py", line 227, in __call__
    async with anyio.create_task_group() as task_group:
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
    raise exceptions[0]
  File "/usr/local/lib/python3.10/site-packages/sse_starlette/sse.py", line 230, in wrap
    await func()
  File "/usr/local/lib/python3.10/site-packages/sse_starlette/sse.py", line 219, in stream_response
    async for data in self.body_iterator:
  File "/www/transcribe/ai-language-model/llama-cpp-python/examples/high_level_api/fastapi_server.py", line 215, in server_sent_events
    for chat_chunk in chat_chunks:
  File "/usr/local/lib/python3.10/site-packages/llama_cpp/llama.py", line 720, in _convert_text_completion_chunks_to_chat
    for i, chunk in enumerate(chunks):
  File "/usr/local/lib/python3.10/site-packages/llama_cpp/llama.py", line 482, in _create_completion
    "text": text[start:].decode("utf-8"),
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 0: unexpected end of data

In addition to that, I'm also experiencing some slow speed using the ggml-vicuna-13b-1.1-q4_1.bin model. Although I noticed that the GPU memory usage is not very high, so I'm not sure what could be causing this.

Nonetheless, I would like to express my gratitude to the author for developing such a great interface that mimics OpenAI. If only the response speed could be faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions