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

Error on startup: name 'sys_prompt' is not defined #27

Open
anik120 opened this issue Mar 1, 2024 · 1 comment
Open

Error on startup: name 'sys_prompt' is not defined #27

anik120 opened this issue Mar 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@anik120
Copy link

anik120 commented Mar 1, 2024

Hi @qnguyen3 I'm trying to use your project, and I followed the instructions on cloning and installing the cli, and then starting it with chat-with-mlx, but I get the following error when I try to use the chat:

<All keys matched successfully>
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Traceback (most recent call last):
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/queueing.py", line 495, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/route_utils.py", line 235, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/blocks.py", line 1627, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/blocks.py", line 1185, in call_function
    prediction = await utils.async_iteration(iterator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/utils.py", line 514, in async_iteration
    return await iterator.__anext__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/utils.py", line 640, in asyncgen_wrapper
    response = await iterator.__anext__()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/chat_interface.py", line 490, in _stream_fn
    first_response = await async_iteration(generator)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/utils.py", line 514, in async_iteration
    return await iterator.__anext__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/utils.py", line 507, in __anext__
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/venv/lib/python3.11/site-packages/gradio/utils.py", line 490, in run_sync_iterator_async
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/Users/anbhatta/DeepLearning/chat-with-mlx/chat_with_mlx/app.py", line 151, in chatbot
    if sys_prompt is not None:
       ^^^^^^^^^^
NameError: name 'sys_prompt' is not defined

Am I doing something wrong?

@qnguyen3
Copy link
Owner

qnguyen3 commented Mar 1, 2024

Hi, you need to choose a dataset type (files or youtube url) before hitting start indexing.

@onuralpszr onuralpszr added the bug Something isn't working label Mar 9, 2024
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

3 participants