[GH-ISSUE #56] chromadb setup #43

Closed
opened 2026-10-15 18:03:43 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Enferlain on GitHub (Jun 15, 2023).
Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/56

I'd like to try chromadb locally, so I reinstalled extras with requirements and tried requirements-complete as well but I get this output after enabling it.

127.0.0.1 - - [15/Jun/2023 21:01:23] "OPTIONS /api/modules HTTP/1.1" 200 -
127.0.0.1 - - [15/Jun/2023 21:01:24] "GET /api/modules HTTP/1.1" 200 -
127.0.0.1 - - [15/Jun/2023 21:01:51] "OPTIONS /api/chromadb/query HTTP/1.1" 200 -
[2023-06-15 21:01:52,040] ERROR in app: Exception on /api/chromadb/query [POST]
Traceback (most recent call last):
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "D:\textgen\kobold\SillyTavern-extras\server.py", line 285, in decorated_view
    return fn(*args, **kwargs)
  File "D:\textgen\kobold\SillyTavern-extras\server.py", line 764, in chromadb_query
    query_result = collection.query(
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\api\models\Collection.py", line 196, in query
    n_results = validate_n_results(n_results)
  File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\api\types.py", line 269, in validate_n_results
    raise TypeError(
TypeError: Number of requested results 0, cannot be negative, or zero.
127.0.0.1 - - [15/Jun/2023 21:01:52] "POST /api/chromadb/query HTTP/1.1" 500 -
127.0.0.1 - - [15/Jun/2023 21:01:52] "OPTIONS /api/classify HTTP/1.1" 200 -

Anyone know what could be causing this? Is there anything extra I need to do other than the install steps?

Originally created by @Enferlain on GitHub (Jun 15, 2023). Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/56 I'd like to try chromadb locally, so I reinstalled extras with requirements and tried requirements-complete as well but I get this output after enabling it. ``` 127.0.0.1 - - [15/Jun/2023 21:01:23] "OPTIONS /api/modules HTTP/1.1" 200 - 127.0.0.1 - - [15/Jun/2023 21:01:24] "GET /api/modules HTTP/1.1" 200 - 127.0.0.1 - - [15/Jun/2023 21:01:51] "OPTIONS /api/chromadb/query HTTP/1.1" 200 - [2023-06-15 21:01:52,040] ERROR in app: Exception on /api/chromadb/query [POST] Traceback (most recent call last): File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "D:\textgen\kobold\SillyTavern-extras\server.py", line 285, in decorated_view return fn(*args, **kwargs) File "D:\textgen\kobold\SillyTavern-extras\server.py", line 764, in chromadb_query query_result = collection.query( File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\api\models\Collection.py", line 196, in query n_results = validate_n_results(n_results) File "C:\Users\Imi\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\api\types.py", line 269, in validate_n_results raise TypeError( TypeError: Number of requested results 0, cannot be negative, or zero. 127.0.0.1 - - [15/Jun/2023 21:01:52] "POST /api/chromadb/query HTTP/1.1" 500 - 127.0.0.1 - - [15/Jun/2023 21:01:52] "OPTIONS /api/classify HTTP/1.1" 200 - ``` Anyone know what could be causing this? Is there anything extra I need to do other than the install steps?
Author
Owner

@Enferlain commented on GitHub (Jun 15, 2023):

Didn't inject txt

<!-- gh-comment-id:1593684356 --> @Enferlain commented on GitHub (Jun 15, 2023): Didn't inject txt
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SillyTavern/SillyTavern-Extras#43
No description provided.