lollms-webui icon indicating copy to clipboard operation
lollms-webui copied to clipboard

ChatWithDocs Personality bug?

Open ediweber opened this issue 2 years ago • 3 comments

Expected Behavior

I would like ChatWithDocs read from a .txt file and use this information in the answer.

Current Behavior

  • Retreiving personality settings
  • Setting personality settings Saving configuration Loading discussion for client 4f0wvzad9SBA7nw3AAAB Loading discussion for client 4f0wvzad9SBA7nw3AAAB File received and saved successfully --> Step started:Vectorizing database -> Vectorizing the database File E:\loldata\uploads\chat_with_docs\Outline English.txt added successfully File E:\loldata\uploads\chat_with_docs\Outline English.txt added successfully Indexing database ...ok Database indexed successfully --> Step ended:Vectorizing database Starting message generation by Chat With Docs Text generation requested by client: 4f0wvzad9SBA7nw3AAAB Received message : Tell me about Octagoria Started generation task Running workflow --> Step started:Analyzing request Text generation started: Warming up '>=' not supported between instances of 'int' and 'str' --> Step ended:Analyzing request Traceback (most recent call last): File "E:\lollms-webui\api_init_.py", line 1736, in generate self.personality.processor.run_workflow( prompt, full_prompt, callback) File "E:\lollms-webui\zoos\personalities_zoo\data\chat_with_docs\scripts\processor.py", line 306, in run_workflow self.process_state(prompt, full_context, callback) File "e:\lollms-webui\lollms_core\lollms\personality.py", line 1000, in process_state default_func(command, full_context) File "E:\lollms-webui\zoos\personalities_zoo\data\chat_with_docs\scripts\processor.py", line 142, in chat_with_doc docs, sorted_similarities = self.vector_store.recover_text(self.vector_store.embed_query(preprocessed_prompt), top_k=self.personality_config.nb_chunks) File "e:\lollms-webui\utilities\safe_store\safe_store\text_vectorizer.py", line 499, in recover_text query_embedding = self.embed_query(query) File "e:\lollms-webui\utilities\safe_store\safe_store\text_vectorizer.py", line 450, in embed_query query_embedding = self.model.embed(query_text) File "E:\lollms-webui\zoos\bindings_zoo\c_transformers_init_.py", line 265, in embed return self.model.embed(text) File "C:\Users\eduar\anaconda3\envs\lol\lib\site-packages\ctransformers\llm.py", line 688, in embed self.eval(input, batch_size=batch_size, threads=threads) File "C:\Users\eduar\anaconda3\envs\lol\lib\site-packages\ctransformers\llm.py", line 402, in eval tokens = (c_int * n_tokens)(*tokens) TypeError: 'float' object cannot be interpreted as an integer

Workflow run failed. Error:'float' object cannot be interpreted as an integer Traceback (most recent call last): File "E:\lollms-webui\api_init_.py", line 1736, in generate self.personality.processor.run_workflow( prompt, full_prompt, callback) File "E:\lollms-webui\zoos\personalities_zoo\data\chat_with_docs\scripts\processor.py", line 306, in run_workflow self.process_state(prompt, full_context, callback) File "e:\lollms-webui\lollms_core\lollms\personality.py", line 1000, in process_state default_func(command, full_context) File "E:\lollms-webui\zoos\personalities_zoo\data\chat_with_docs\scripts\processor.py", line 142, in chat_with_doc docs, sorted_similarities = self.vector_store.recover_text(self.vector_store.embed_query(preprocessed_prompt), top_k=self.personality_config.nb_chunks) File "e:\lollms-webui\utilities\safe_store\safe_store\text_vectorizer.py", line 499, in recover_text query_embedding = self.embed_query(query) File "e:\lollms-webui\utilities\safe_store\safe_store\text_vectorizer.py", line 450, in embed_query query_embedding = self.model.embed(query_text) File "E:\lollms-webui\zoos\bindings_zoo\c_transformers_init_.py", line 265, in embed return self.model.embed(text) File "C:\Users\eduar\anaconda3\envs\lol\lib\site-packages\ctransformers\llm.py", line 688, in embed self.eval(input, batch_size=batch_size, threads=threads) File "C:\Users\eduar\anaconda3\envs\lol\lib\site-packages\ctransformers\llm.py", line 402, in eval tokens = (c_int * n_tokens)(*tokens) TypeError: 'float' object cannot be interpreted as an integer

--> Exception from personality:Workflow run failed Error:'float' object cannot be interpreted as an integer Finished executing the workflow

#SORRY_FOR-FLOODING.WITH_ISSUES/TONIGHT@noSLEEP

ediweber avatar Nov 08 '23 04:11 ediweber

Hi there. I am sorry for that. In fact, now all personalities can chat with docs which comes in handy. Just activate the data vectorization in your settings main configurations section then you can use the send file button on any personality. image

The bug you have is caused by the fact that the chatwithdocs persona has its own script for vectorization which is outdated.

I have just updated it to use the last version of safe_store so now it should work.

ParisNeo avatar Nov 08 '23 10:11 ParisNeo

Hi, I now have updated lollms but still encountering problems. Maybe I'll try to reinstall everything. I might have destroeyd something regarding safe store?

Loading vectorized discussions Database file found : E:\loldata\databases\vectorized_dbs\database.db Loading vectorized documents 1- Exporting discussions 2- Adding discussions to vectorizer Traceback (most recent call last): File "E:\lollms-webui\api_init_.py", line 168, in init self.discussions_store.add_document(title, discussion, chunk_size=self.config.data_vectorization_chunk_size, overlap_size=self.config.data_vectorization_overlap_size, force_vectorize=False, add_as_a_bloc=False) File "e:\lollms-webui\utilities\safe_store\safe_store\text_vectorizer.py", line 371, in add_document chunks_text = DocumentDecomposer.decompose_document(text, chunk_size, overlap_size) File "e:\lollms-webui\utilities\safe_store\safe_store\document_decomposer.py", line 47, in decompose_document if nb_tokens > max_chunk_size: TypeError: '>' not supported between instances of 'int' and 'str'

ediweber avatar Nov 13 '23 02:11 ediweber

...or... reading the error message .... maybe find out why max_chunk_size is of type str.

ediweber avatar Nov 13 '23 02:11 ediweber