SillyTavern / SillyTavern-Extras

Extensions API for SillyTavern.
GNU Affero General Public License v3.0
549 stars 124 forks source link

issue with chromadb not working #100

Closed 0xYc0d0ne closed 1 year ago

0xYc0d0ne commented 1 year ago

here is how i got the error

PS C:\Users\User\SillyTavern-extras> python server.py --enable-modules=chromadb --share --secure

Using torch device: cpu Initializing ChromaDB Traceback (most recent call last): File "C:\Users\alpha\SillyTavern-extras\server.py", line 268, in chromadb_client = chromadb.PersistentClient(path=args.chroma_folder, settings=Settings(anonymized_telemetry=False)) AttributeError: module 'chromadb' has no attribute 'PersistentClient'

also error when trying to purge chromadb in silly tavern terminal window returns this error and silly tavern doesn't show any sign that the chromadb chat was purged from chromadb

127.0.0.1 - - [01/Aug/2023 12:52:35] "POST /api/chromadb/purge HTTP/1.1" 500 - 127.0.0.1 - - [01/Aug/2023 12:52:58] "OPTIONS /api/chromadb/purge HTTP/1.1" 200 - [2023-08-01 12:52:59,192] ERROR in app: Exception on /api/chromadb/purge [POST] Traceback (most recent call last): File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask_cors\extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(args, kwargs))) File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "C:\Users\alpha\SillyTavern-extras\server.py", line 303, in decorated_view return fn(args, **kwargs) File "C:\Users\alpha\SillyTavern-extras\server.py", line 775, in chromadb_purge chromadb_client.persist() AttributeError: 'SegmentAPI' object has no attribute 'persist' 127.0.0.1 - - [01/Aug/2023 12:52:59] "POST /api/chromadb/purge HTTP/1.1" 500 -

so i suspect that chromadb may just be completely broken all together

please fix this issue in another update....

anyone know any solutions if you have ran into this problem yourselves???

Sorro123 commented 1 year ago

Run pip install --upgrade chromadb

wereretot commented 1 year ago

Got this error fixed with @Sorro123 solution.

0xYc0d0ne commented 1 year ago

@Sorro123 i already ran " pip install --upgrade chromadb" which got chromadb to run but when actually trying to use chromadb i get errors like this

"127.0.0.1 - - [01/Aug/2023 12:52:35] "POST /api/chromadb/purge HTTP/1.1" 500 - 127.0.0.1 - - [01/Aug/2023 12:52:58] "OPTIONS /api/chromadb/purge HTTP/1.1" 200 - [2023-08-01 12:52:59,192] ERROR in app: Exception on /api/chromadb/purge [POST] Traceback (most recent call last): File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask_cors\extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(args, kwargs))) File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\alpha\AppData\Roaming\Python\Python310\site-packages\flask\app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "C:\Users\alpha\SillyTavern-extras\server.py", line 303, in decorated_view return fn(args, **kwargs) File "C:\Users\alpha\SillyTavern-extras\server.py", line 775, in chromadb_purge chromadb_client.persist() AttributeError: 'SegmentAPI' object has no attribute 'persist' 127.0.0.1 - - [01/Aug/2023 12:52:59] "POST /api/chromadb/purge HTTP/1.1" 500 -"

Cohee1207 commented 1 year ago

I did an update specifically for your case with purge @0xYc0d0ne https://github.com/SillyTavern/SillyTavern-extras/commit/5ed3013e458317db7977d47d3d985b084547e7fc

Cohee1207 commented 1 year ago

Cleaning up ChromaDB issues into one: https://github.com/SillyTavern/SillyTavern-Extras/issues/110