oobabooga / text-generation-webui

A Gradio web UI for Large Language Models.
GNU Affero General Public License v3.0
38.64k stars 5.1k forks source link

Superbooga error in instruct mode #2160

Closed mykeehu closed 1 year ago

mykeehu commented 1 year ago

Describe the bug

If I am in instruct mode and superbooga is enabled, I get the error after sending the first message:

Traceback (most recent call last):
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\routes.py", line 414, in run_predict
    output = await app.get_blocks().process_api(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\blocks.py", line 1067, in call_function
    prediction = await utils.async_iteration(iterator)
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 339, in async_iteration
    return await iterator.__anext__()
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 332, in __anext__
    return await anyio.to_thread.run_sync(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\gradio\utils.py", line 315, in run_sync_iterator_async
    return next(iterator)
  File "J:\oobabooga_windows\text-generation-webui\modules\chat.py", line 307, in generate_chat_reply_wrapper
    for history in generate_chat_reply(text, state, regenerate, _continue):
  File "J:\oobabooga_windows\text-generation-webui\modules\chat.py", line 301, in generate_chat_reply
    for history in chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue):
  File "J:\oobabooga_windows\text-generation-webui\modules\chat.py", line 217, in chatbot_wrapper
    prompt = apply_extensions('custom_generate_chat_prompt', text, state, **kwargs)
  File "J:\oobabooga_windows\text-generation-webui\modules\extensions.py", line 183, in apply_extensions
    return EXTENSION_MAP[typ](*args, **kwargs)
  File "J:\oobabooga_windows\text-generation-webui\modules\extensions.py", line 80, in _apply_custom_generate_chat_prompt
    return extension.custom_generate_chat_prompt(text, state, **kwargs)
  File "J:\oobabooga_windows\text-generation-webui\extensions\superbooga\script.py", line 99, in custom_generate_chat_prompt
    results = collector.get_sorted(user_input, n_results=chunk_count)
  File "J:\oobabooga_windows\text-generation-webui\extensions\superbooga\chromadb.py", line 67, in get_sorted
    documents, ids = self.get_documents_and_ids(search_strings, n_results)
  File "J:\oobabooga_windows\text-generation-webui\extensions\superbooga\chromadb.py", line 50, in get_documents_and_ids
    result = self.collection.query(query_texts=search_strings, n_results=n_results, include=['documents'])
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\chromadb\api\models\Collection.py", line 203, in query
    return self._client._query(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\chromadb\api\local.py", line 247, in _query
    uuids, distances = self._db.get_nearest_neighbors(
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\chromadb\db\clickhouse.py", line 521, in get_nearest_neighbors
    uuids, distances = index.get_nearest_neighbors(embeddings, n_results, ids)
  File "J:\oobabooga_windows\installer_files\env\lib\site-packages\chromadb\db\index\hnswlib.py", line 223, in get_nearest_neighbors
    raise NoIndexException("Index not found, please create an instance before querying")
chromadb.errors.NoIndexException: Index not found, please create an instance before querying

I use the WizardLM template.

Is there an existing issue for this?

Reproduction

  1. Load webui with superbooga extension
  2. Change to instruct mode
  3. Type anything and send.

Screenshot

No response

Logs

See above

System Info

RTX 3060 12 GB
Windows 10 64-bit
valden80 commented 1 year ago

Right now you need to import some data to database (memory) before try to chat. Extension just don't check if database is not initialized. (Initialization done on any text import.)

mykeehu commented 1 year ago

If I understand correctly, should I first start without superbooga, then talk in instruct mode, and then switch it back? Because in chat mode you can do without it.

valden80 commented 1 year ago

Don't start without superbooga. Just try to switch chat mode to instruct/chat-instruct, load something into superbooga's base, then switch back to chat.

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity for 30 days. If you believe it is still relevant, please leave a comment below.